[pve-devel] [PATCH 1/2] enable virtio-scsi iothread hot-unplug

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Aug 22 11:21:19 CEST 2016


The hot-remove seems to error out (while it still works in the
background and after doing a 'revert' and a second 'remove' it finishes
successfully.)

But adding the device back into the same slot as before crashes qemu,
whereas a pure hot-add with no removal before works fine.

On Sat, Aug 20, 2016 at 10:02:28AM +0200, Alexandre Derumier wrote:
> This was previously buggy in qemu 2.3 (crash the vm),
> now it's working fine in qemu 2.6
> 
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>  PVE/QemuServer.pm | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 2414fd8..b295ae4 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -3401,10 +3401,6 @@ sub vm_deviceunplug {
>  
>      } elsif ($deviceid =~ m/^(scsi)(\d+)$/) {
>  
> -	#qemu 2.3 segfault on drive_del with virtioscsi + iothread
> -	my $device = parse_drive($deviceid, $conf->{$deviceid});
> -	die "virtioscsi with iothread is not hot-unplugglable currently" if $device->{iothread};
> -
>          qemu_devicedel($vmid, $deviceid);
>          qemu_drivedel($vmid, $deviceid);
>  	qemu_deletescsihw($conf, $vmid, $deviceid);
> @@ -3449,7 +3445,10 @@ sub qemu_iothread_add {
>  sub qemu_iothread_del {
>      my($conf, $vmid, $deviceid) = @_;
>  
> -    my $device = parse_drive($deviceid, $conf->{$deviceid});
> +    my $drive = $deviceid;
> +    $drive =~ s/virtioscsi/scsi/;
> +    my $device = parse_drive($drive, $conf->{$drive});
> +
>      if ($device->{iothread}) {
>  	my $iothreads = vm_iothreads_list($vmid);
>  	qemu_objectdel($vmid, "iothread-$deviceid") if $iothreads->{"iothread-$deviceid"};
> -- 
> 2.1.4




More information about the pve-devel mailing list