]> git.proxmox.com Git - qemu-server.git/commitdiff
nic hot-unplug: delete netdev after device removal
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 6 Mar 2013 14:48:59 +0000 (15:48 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 7 Mar 2013 07:37:23 +0000 (08:37 +0100)
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@odiso.com>
PVE/QemuServer.pm

index 970edb57d82e70565887c3621464fea7ae02a983..4e66cae35347e940168c05574d1cc14027b92182 100644 (file)
@@ -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;