5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-08 21:18:03 +03:00

Fix 'uninitialized value' warning about guest agent type

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
Stefan Reiter 2019-11-20 13:24:57 +01:00 committed by Thomas Lamprecht
parent 092868c4d1
commit 60f03a1168

View File

@ -3892,7 +3892,7 @@ sub config_to_command {
my $qgasocket = qmp_socket($vmid, 1);
push @$devices, '-chardev', "socket,path=$qgasocket,server,nowait,id=qga0";
if ($guest_agent->{type} eq 'virtio') {
if (!$guest_agent->{type} || $guest_agent->{type} eq 'virtio') {
my $pciaddr = print_pci_addr("qga0", $bridges, $arch, $machine_type);
push @$devices, '-device', "virtio-serial,id=qga0$pciaddr";
push @$devices, '-device', 'virtserialport,chardev=qga0,name=org.qemu.guest_agent.0';