[pve-devel] applied: [PATCH qemu-server] cfg2cmd: fix serial-bus for spice foldersharing

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Oct 9 08:06:51 CEST 2019


On 10/8/19 5:56 PM, Aaron Lauterer wrote:
> Thanks to Gilberto Nunes for finding a bug where the VM would not start
> with foldersharing enabled and the qemu agent option disabled [0].
> 
> The cause was that the device org.spice-space.webdav.0 would not find a
> virtio-serial-bus in this situation.
> 
> Since we always create a virtio-serial-bus for the spice vdagent it
> seems sensible to use that also for the foldersharing device by moving
> it in front of the other spice devices.
> 
> [0]: https://pve.proxmox.com/pipermail/pve-devel/2019-October/039441.html
> 
> Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
> ---
>  PVE/QemuServer.pm | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 8376260..61d7d12 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -4017,6 +4017,11 @@ sub config_to_command {
>  	my $pfamily = PVE::Tools::get_host_address_family($nodename);
>  	my @nodeaddrs = PVE::Tools::getaddrinfo_all('localhost', family => $pfamily);
>  	die "failed to get an ip address of type $pfamily for 'localhost'\n" if !@nodeaddrs;
> +
> +	push @$devices, '-device', "virtio-serial,id=spice$pciaddr";
> +	push @$devices, '-chardev', "spicevmc,id=vdagent,name=vdagent";
> +	push @$devices, '-device', "virtserialport,chardev=vdagent,name=com.redhat.spice.0";
> +
>  	my $localhost = PVE::Network::addr_to_ip($nodeaddrs[0]->{addr});
>  	$spice_port = PVE::Tools::next_spice_port($pfamily, $localhost);
>  
> @@ -4029,11 +4034,6 @@ sub config_to_command {
>  	my $spice_opts = "tls-port=${spice_port},addr=$localhost,tls-ciphers=HIGH,seamless-migration=on";
>  	$spice_opts .= ",streaming-video=$spice_enhancement->{videostreaming}" if $spice_enhancement->{videostreaming};
>  	push @$devices, '-spice', "$spice_opts";
> -
> -	push @$devices, '-device', "virtio-serial,id=spice$pciaddr";
> -	push @$devices, '-chardev', "spicevmc,id=vdagent,name=vdagent";
> -	push @$devices, '-device', "virtserialport,chardev=vdagent,name=com.redhat.spice.0";
> -
>      }
>  
>      # enable balloon by default, unless explicitly disabled
> 

applied, thanks! I wanted to add a cfg2cmd test for this and then saw
that we sorted both, testing and expected command line output, which is
false, as you patch clearly shows too..
So I adapted the generation of PCI bridges to be sorted and then removed
the sorting in the tests, I'll let them run 100 times to tickle out any
hash random sort stuff I oversaw but seems OK; at least for the current
defined tests. And if we ran into sort issues with future tests the correct
way to solve them will be do adapt the config2command method - not sort the
test results.




More information about the pve-devel mailing list