mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
qemu: deprecate QEMU_CAPS_DEVICE_SPICEVMC
The (now assumed) QEMU_CAPS_CHARDEV_SPICEVMC is preferred. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
c3eaccfa60
commit
bdd92827d3
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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? */
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
@ -1,35 +0,0 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<vcpu placement='static' cpuset='1-4,8-20,525'>1</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-i686</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='ide' index='0'/>
|
||||
<controller type='virtio-serial' index='1'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
|
||||
</controller>
|
||||
<graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'>
|
||||
<channel name='main' mode='secure'/>
|
||||
</graphics>
|
||||
<channel type='spicevmc'>
|
||||
<target type='virtio' name='com.redhat.spice.0'/>
|
||||
<address type='virtio-serial' controller='1' bus='0' port='3'/>
|
||||
</channel>
|
||||
<memballoon model='virtio'/>
|
||||
</devices>
|
||||
</domain>
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user