[pve-devel] [PATCH 2/3] enable virtio-scsi iothread hot-unplug for qemu 2.7 v3

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Oct 17 13:17:45 CEST 2016


So, when testing this on a linux guest (4.7.6, Arch) I still get errors
(and see kernel traces in the guest's dmesg) with the iothread flag...
Removing "works" (it's removed, but the qemu command still errors and
you get an error in the pve GUI) - re-adding doesn't work (always shows
me kernel stack traces in dmesg).

What kind of setup did you test this with?

On Mon, Oct 17, 2016 at 12:20:44PM +0200, Alexandre Derumier wrote:
> changelog: check current running qemu process
> 
> Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
> ---
>  PVE/QemuServer.pm | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 6376323..e4c385f 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -3516,9 +3516,11 @@ 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};
> +	my $kvmver = get_running_qemu_version($vmid);
> +	if (!qemu_machine_feature_enabled (undef, $kvmver, 2, 7)) {
> +	    my $device = parse_drive($deviceid, $conf->{$deviceid});
> +	    die "virtioscsi with iothread is hot-unplugglable since qemu 2.7" if $device->{iothread};
> +	}
>  
>          qemu_devicedel($vmid, $deviceid);
>          qemu_drivedel($vmid, $deviceid);
> @@ -3564,7 +3566,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
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list