]> git.proxmox.com Git - qemu-server.git/commitdiff
hot-unplug : add some warnings for differents guest os
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 19 Feb 2013 09:22:11 +0000 (10:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 19 Feb 2013 09:38:50 +0000 (10:38 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/API2/Qemu.pm

index 71d39a90bb58d29bf71c6a15e2950e6d22f25d49..daada76ceea0881e946e035dc9a0f2aba79a652e 100644 (file)
@@ -646,8 +646,17 @@ my $vmconfig_delete_option = sub {
            $rpcenv->check($authuser, "/storage/$sid", ['Datastore.Allocate']);
        }
     }
-               
-    die "error hot-unplug $opt" if !PVE::QemuServer::vm_deviceunplug($vmid, $conf, $opt);
+
+    my $unplugwarning = "";
+    if($conf->{ostype} && $conf->{ostype} eq 'l26'){
+       $unplugwarning = "<br>verify that you have acpiphp && pci_hotplug modules loaded in your guest VM";
+    }elsif($conf->{ostype} && $conf->{ostype} eq 'l24'){
+       $unplugwarning = "<br>kernel 2.4 don't support hotplug, please disable hotplug in options";
+    }elsif(!$conf->{ostype} || ($conf->{ostype} && $conf->{ostype} eq 'other')){
+       $unplugwarning = "<br>verify that your guest support acpi hotplug";
+    }
+
+    die "error hot-unplug $opt $unplugwarning" if !PVE::QemuServer::vm_deviceunplug($vmid, $conf, $opt);
 
     PVE::QemuServer::vm_deviceplug(undef, $conf, $vmid, $opt) if $opt eq 'tablet';