diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ecaa1b7a13..72c6ac4680 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1020,7 +1020,6 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-scsi-ccw", QEMU_CAPS_VIRTIO_SCSI }, { "virtio-scsi-device", QEMU_CAPS_VIRTIO_SCSI }, { "megasas", QEMU_CAPS_SCSI_MEGASAS }, - { "spicevmc", QEMU_CAPS_DEVICE_SPICEVMC }, { "qxl", QEMU_CAPS_DEVICE_QXL }, { "sga", QEMU_CAPS_SGA }, { "scsi-block", QEMU_CAPS_SCSI_BLOCK }, @@ -2096,9 +2095,6 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, virStringListFreeCount(values, nvalues); } - /* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */ - virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC); - return 0; } diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 08d521945a..dfed43dfc6 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -127,7 +127,7 @@ typedef enum { /* 55 */ QEMU_CAPS_CCID_PASSTHRU, /* -device ccid-card-passthru */ X_QEMU_CAPS_CHARDEV_SPICEVMC, /* newer -chardev spicevmc */ - QEMU_CAPS_DEVICE_SPICEVMC, /* older -device spicevmc*/ + X_QEMU_CAPS_DEVICE_SPICEVMC, /* older -device spicevmc*/ QEMU_CAPS_VIRTIO_TX_ALG, /* -device virtio-net-pci,tx=string */ X_QEMU_CAPS_DEVICE_QXL_VGA, /* primary qxl device named qxl-vga? */ diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8d8636f73a..b5c97f350a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5360,8 +5360,7 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager, static char * qemuBuildVirtioSerialPortDevStr(const virDomainDef *def, - virDomainChrDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainChrDefPtr dev) { virBuffer buf = VIR_BUFFER_INITIALIZER; const char *contAlias; @@ -5371,13 +5370,7 @@ qemuBuildVirtioSerialPortDevStr(const virDomainDef *def, virBufferAddLit(&buf, "virtconsole"); break; case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: - /* Legacy syntax '-device spicevmc' */ - if (dev->source->type == VIR_DOMAIN_CHR_TYPE_SPICEVMC && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC)) { - virBufferAddLit(&buf, "spicevmc"); - } else { - virBufferAddLit(&buf, "virtserialport"); - } + virBufferAddLit(&buf, "virtserialport"); break; default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -5415,19 +5408,13 @@ qemuBuildVirtioSerialPortDevStr(const virDomainDef *def, goto error; } - if (!(dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && - dev->source->type == VIR_DOMAIN_CHR_TYPE_SPICEVMC && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC))) { - virBufferAsprintf(&buf, ",chardev=char%s,id=%s", - dev->info.alias, dev->info.alias); - if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && - (dev->source->type == VIR_DOMAIN_CHR_TYPE_SPICEVMC || - dev->target.name)) { - virBufferAsprintf(&buf, ",name=%s", dev->target.name - ? dev->target.name : "com.redhat.spice.0"); - } - } else { - virBufferAsprintf(&buf, ",id=%s", dev->info.alias); + virBufferAsprintf(&buf, ",chardev=char%s,id=%s", + dev->info.alias, dev->info.alias); + if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && + (dev->source->type == VIR_DOMAIN_CHR_TYPE_SPICEVMC || + dev->target.name)) { + virBufferAsprintf(&buf, ",name=%s", dev->target.name + ? dev->target.name : "com.redhat.spice.0"); } if (virBufferCheckError(&buf) < 0) goto error; @@ -9174,23 +9161,15 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager, break; case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC) && - channel->source->type == VIR_DOMAIN_CHR_TYPE_SPICEVMC) { - /* spicevmc was originally introduced via a -device - * with a backend internal to qemu; although we prefer - * the newer -chardev interface. */ - ; - } else { - if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, - channel->source, - channel->info.alias, - qemuCaps, true, - chardevStdioLogd))) - return -1; - virCommandAddArg(cmd, "-chardev"); - virCommandAddArg(cmd, devstr); - VIR_FREE(devstr); - } + if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, + channel->source, + channel->info.alias, + qemuCaps, true, + chardevStdioLogd))) + return -1; + virCommandAddArg(cmd, "-chardev"); + virCommandAddArg(cmd, devstr); + VIR_FREE(devstr); if (qemuBuildChrDeviceCommandLine(cmd, def, channel, qemuCaps) < 0) return -1; @@ -10210,8 +10189,7 @@ qemuBuildParallelChrDeviceStr(char **deviceStr, static int qemuBuildChannelChrDeviceStr(char **deviceStr, const virDomainDef *def, - virDomainChrDefPtr chr, - virQEMUCapsPtr qemuCaps) + virDomainChrDefPtr chr) { int ret = -1; char *addr = NULL; @@ -10232,7 +10210,7 @@ qemuBuildChannelChrDeviceStr(char **deviceStr, break; case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: - if (!(*deviceStr = qemuBuildVirtioSerialPortDevStr(def, chr, qemuCaps))) + if (!(*deviceStr = qemuBuildVirtioSerialPortDevStr(def, chr))) goto cleanup; break; @@ -10251,8 +10229,7 @@ qemuBuildChannelChrDeviceStr(char **deviceStr, static int qemuBuildConsoleChrDeviceStr(char **deviceStr, const virDomainDef *def, - virDomainChrDefPtr chr, - virQEMUCapsPtr qemuCaps) + virDomainChrDefPtr chr) { int ret = -1; @@ -10264,7 +10241,7 @@ qemuBuildConsoleChrDeviceStr(char **deviceStr, break; case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO: - if (!(*deviceStr = qemuBuildVirtioSerialPortDevStr(def, chr, qemuCaps))) + if (!(*deviceStr = qemuBuildVirtioSerialPortDevStr(def, chr))) goto cleanup; break; @@ -10306,11 +10283,11 @@ qemuBuildChrDeviceStr(char **deviceStr, break; case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: - ret = qemuBuildChannelChrDeviceStr(deviceStr, vmdef, chr, qemuCaps); + ret = qemuBuildChannelChrDeviceStr(deviceStr, vmdef, chr); break; case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: - ret = qemuBuildConsoleChrDeviceStr(deviceStr, vmdef, chr, qemuCaps); + ret = qemuBuildConsoleChrDeviceStr(deviceStr, vmdef, chr); break; case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: diff --git a/tests/qemuxml2argvdata/channel-spicevmc-old.args b/tests/qemuxml2argvdata/channel-spicevmc-old.args deleted file mode 100644 index 852c8699ea..0000000000 --- a/tests/qemuxml2argvdata/channel-spicevmc-old.args +++ /dev/null @@ -1,30 +0,0 @@ -LC_ALL=C \ -PATH=/bin \ -HOME=/home/test \ -USER=test \ -LOGNAME=test \ -QEMU_AUDIO_DRV=spice \ -/usr/bin/qemu-system-i686 \ --name QEMUGuest1 \ --S \ --M pc \ --m 214 \ --smp 1,sockets=1,cores=1,threads=1 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --no-user-config \ --nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\ -server,nowait \ --mon chardev=charmonitor,id=monitor,mode=control \ --rtc base=utc \ --no-acpi \ --boot c \ --device virtio-serial-pci,id=virtio-serial1,bus=pci.0,addr=0xa \ --usb \ --drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ --device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \ --device spicevmc,bus=virtio-serial1.0,nr=3,id=channel0 \ --spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice,\ -tls-channel=main \ --vga cirrus \ --device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/channel-spicevmc-old.xml b/tests/qemuxml2argvdata/channel-spicevmc-old.xml deleted file mode 100644 index 95d0c20647..0000000000 --- a/tests/qemuxml2argvdata/channel-spicevmc-old.xml +++ /dev/null @@ -1,35 +0,0 @@ - - QEMUGuest1 - c7a5fdbd-edaf-9455-926a-d65c16db1809 - 219136 - 1 - - hvm - - - - destroy - restart - destroy - - /usr/bin/qemu-system-i686 - - - -
- - - - -
- - - - - - -
- - - - diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index af71a037c7..9367754950 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1322,10 +1322,6 @@ mymain(void) DO_TEST("channel-spicevmc", QEMU_CAPS_SPICE, QEMU_CAPS_DEVICE_CIRRUS_VGA); - DO_TEST("channel-spicevmc-old", - QEMU_CAPS_SPICE, - QEMU_CAPS_DEVICE_SPICEVMC, - QEMU_CAPS_DEVICE_CIRRUS_VGA); DO_TEST("channel-virtio-default", QEMU_CAPS_SPICE); DO_TEST("channel-virtio-unix", NONE);