[pve-devel] [PATCH qemu-server] fix #1409: do not only check pci bus for net devices

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Jun 12 13:47:52 CEST 2017


On Mon, Jun 12, 2017 at 01:30:49PM +0200, Dominik Csapak wrote:
> when changing properties of a netX device which needs a device_del and
> device_add (model, queues, mac, etc.) there is a race that qemu
> removes the device from the pci bus, but not from its qom tree
> 
> we then go forward and add a network device with the same id, and qemu
> deletes this device now from the qom tree, and we do not see it anymore
> 
> so we do not only check the pci bus, but also the qom-tree, which we
> go through anyway

Can still trigger it. The issue might (also?) be with the netdev (the
tap device reference). If that's the case perhaps we could change the
code to only recreate the pci device and reuse the previous netdev?

> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/QemuServer.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 0efab21..324a7dc 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -3404,7 +3404,7 @@ sub vm_devices_list {
>      # qom-list path=/machine/peripheral
>      my $resperipheral = vm_mon_cmd($vmid, 'qom-list', path => '/machine/peripheral');
>      foreach my $per (@$resperipheral) {
> -	if ($per->{name} =~ m/^usb\d+$/) {
> +	if ($per->{name} =~ m/^(?:usb|net)\d+$/) {
>  	    $devices->{$per->{name}} = 1;
>  	}
>      }
> -- 
> 2.11.0




More information about the pve-devel mailing list