[pve-devel] [PATCH qemu-server v2 3/3] Adding new config option 'spicedesktop'

Andreas Steinel A.Steinel at gmail.com
Tue Jan 8 23:58:01 CET 2019


---
 PVE/QemuServer.pm | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 173ae82..657cfad 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -607,6 +607,12 @@ EODESCR
 	default => "1 (autogenerated)",
 	optional => 1,
     },
+    spicedesktop => {
+	optional => 1,
+	type => 'boolean',
+	description => "Enable/disable SPICE folder sharing and audio support",
+	default => 0,
+    },
 };
 
 my $confdesc_cloudinit = {
@@ -3768,18 +3774,20 @@ sub config_to_command {
 	push @$devices, '-chardev', "spicevmc,id=vdagent,name=vdagent";
 	push @$devices, '-device', "virtserialport,chardev=vdagent,name=com.redhat.spice.0";
 
-	$pciaddr = print_pci_addr("spicewebdav", $bridges, $arch, $machine_type);
-	push @$devices, '-device', "virtio-serial,id=webdav$pciaddr";
-	push @$devices, '-chardev', "spiceport,id=webdav,name=org.spice-space.webdav.0";
-	push @$devices, '-device', "virtserialport,chardev=webdav,name=org.spice-space.webdav.0";
-
-	$pciaddr = print_pci_addr("audio", $bridges, $arch, $machine_type);
-	if ($winversion >= 6) {
-		push @$devices, '-device', "intel-hda,id=sound5$pciaddr";
-		push @$devices, '-device', "hda-micro,id=sound5-codec0,bus=sound5.0,cad=0";
-		push @$devices, '-device', "hda-duplex,id=sound5-codec1,bus=sound5.0,cad=1";
-	} else {
-		push @$devices, '-device', "AC97$pciaddr";
+	if ( defined($conf->{spice_desktop}) && $conf->{spice_desktop} == 1 ) {
+		$pciaddr = print_pci_addr("spicewebdav", $bridges, $arch, $machine_type);
+		push @$devices, '-device', "virtio-serial,id=webdav$pciaddr";
+		push @$devices, '-chardev', "spiceport,id=webdav,name=org.spice-space.webdav.0";
+		push @$devices, '-device', "virtserialport,chardev=webdav,name=org.spice-space.webdav.0";
+
+		$pciaddr = print_pci_addr("audio", $bridges, $arch, $machine_type);
+		if ($winversion >= 6) {
+			push @$devices, '-device', "intel-hda,id=sound5$pciaddr";
+			push @$devices, '-device', "hda-micro,id=sound5-codec0,bus=sound5.0,cad=0";
+			push @$devices, '-device', "hda-duplex,id=sound5-codec1,bus=sound5.0,cad=1";
+		} else {
+			push @$devices, '-device', "AC97$pciaddr";
+		}
 	}
     }
 
-- 
2.11.0




More information about the pve-devel mailing list