]> git.proxmox.com Git - qemu-server.git/commitdiff
vm_devices_list : also list block devices
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 29 Aug 2014 13:04:15 +0000 (15:04 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 1 Sep 2014 09:33:54 +0000 (11:33 +0200)
This allow scsi disk to be plug|unplug

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/QemuServer.pm

index b4358b08aed5adcf71a4bdb1100142c8dc7ac5c4..20581315c938bb17434ece8c9361c94f6fb6a765 100644 (file)
@@ -2876,7 +2876,14 @@ sub vm_devices_list {
     foreach my $pcibus (@$res) {
        foreach my $device (@{$pcibus->{devices}}) {
            next if !$device->{'qdev_id'};
-           $devices->{$device->{'qdev_id'}} = $device;
+           $devices->{$device->{'qdev_id'}} = 1;
+       }
+    }
+
+    my $resblock = vm_mon_cmd($vmid, 'query-block');
+    foreach my $block (@$resblock) {
+       if($block->{device} =~ m/^drive-(\S+)/){
+               $devices->{$1} = 1;
        }
     }