[pve-devel] [PATCH] nic hot-unplug: delete netdev after device removal

Alexandre Derumier aderumier at odiso.com
Wed Mar 6 15:48:59 CET 2013


Currently we delete netdev before acpi hot-unplug.

if guest don't support hotplug, this break network.

We need to remove netdev after the device had be correctly unplug.(we check that device has been correctly removed)
So, If guest don't support hotplug, It's simply thrown a unplug error message without breaking the network

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 970edb5..4e66cae 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2620,9 +2620,9 @@ sub vm_deviceunplug {
     }
 
     if ($deviceid =~ m/^(net)(\d+)$/) {
-        return undef if !qemu_netdevdel($vmid, $deviceid);
         qemu_devicedel($vmid, $deviceid);
         return undef if !qemu_devicedelverify($vmid, $deviceid);
+        return undef if !qemu_netdevdel($vmid, $deviceid);
     }
 
     return 1;
-- 
1.7.10.4



More information about the pve-devel mailing list