qemuBuildChrDeviceCommandLine: Generate via JSON

Build commandlines for character devices via JSON.

For devices using 'VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL' address
type 'qemuBuildDeviceAddressProps' will now generate the address. The
only special property is 'nr'. QEMU declares it as:

  nr=<uint32>            -  (default: 4294967295)

The test fallout is caused by formatting addresses as decimal numbers
instead of hex as described in the commit which added
'qemuBuildDeviceAddressProps'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-10-05 15:24:58 +02:00
parent a0d70f96ca
commit 9ac91fcceb
27 changed files with 163 additions and 133 deletions

View File

@ -752,8 +752,27 @@ qemuBuildDeviceAddressProps(virJSONValue *props,
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE: case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE:
return qemuBuildDeviceAddresDriveProps(props, domainDef, info); return qemuBuildDeviceAddresDriveProps(props, domainDef, info);
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL: {
const char *contAlias;
g_autofree char *bus = NULL;
if (!(contAlias = virDomainControllerAliasFind(domainDef,
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
info->addr.vioserial.controller)))
return -1;
bus = g_strdup_printf("%s.%d", contAlias, info->addr.vioserial.bus);
if (virJSONValueObjectAdd(props,
"s:bus", bus,
"i:nr", info->addr.vioserial.port,
NULL) < 0)
return -1;
return 0;
}
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE: case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID: case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390: case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390:
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO: case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO:
@ -5673,19 +5692,21 @@ qemuBuildMonitorCommandLine(virLogManager *logManager,
} }
static char * static virJSONValue *
qemuBuildVirtioSerialPortDevStr(const virDomainDef *def, qemuBuildVirtioSerialPortDevProps(const virDomainDef *def,
virDomainChrDef *dev) virDomainChrDef *dev)
{ {
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autoptr(virJSONValue) props = NULL;
const char *contAlias; const char *driver;
const char *targetname = NULL;
g_autofree char *chardev = NULL;
switch (dev->deviceType) { switch (dev->deviceType) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
virBufferAddLit(&buf, "virtconsole"); driver = "virtconsole";
break; break;
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
virBufferAddLit(&buf, "virtserialport"); driver = "virtserialport";
break; break;
default: default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@ -5702,14 +5723,6 @@ qemuBuildVirtioSerialPortDevStr(const virDomainDef *def,
return NULL; return NULL;
} }
contAlias = virDomainControllerAliasFind(def, VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
dev->info.addr.vioserial.controller);
if (!contAlias)
return NULL;
virBufferAsprintf(&buf, ",bus=%s.%d,nr=%d", contAlias,
dev->info.addr.vioserial.bus,
dev->info.addr.vioserial.port);
} }
if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
@ -5722,29 +5735,50 @@ qemuBuildVirtioSerialPortDevStr(const virDomainDef *def,
return NULL; return NULL;
} }
virBufferAsprintf(&buf, ",chardev=char%s,id=%s", if (virJSONValueObjectCreate(&props,
dev->info.alias, dev->info.alias); "s:driver", driver,
NULL) < 0)
return NULL;
if (qemuBuildDeviceAddressProps(props, def, &dev->info) < 0)
return NULL;
chardev = g_strdup_printf("char%s", dev->info.alias);
if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL &&
(dev->source->type == VIR_DOMAIN_CHR_TYPE_SPICEVMC || (dev->source->type == VIR_DOMAIN_CHR_TYPE_SPICEVMC ||
dev->target.name)) { dev->target.name)) {
virBufferAsprintf(&buf, ",name=%s", dev->target.name if (dev->target.name)
? dev->target.name : "com.redhat.spice.0"); targetname = dev->target.name;
else
targetname = "com.redhat.spice.0";
} }
return virBufferContentAndReset(&buf); if (virJSONValueObjectAdd(props,
"s:chardev", chardev,
"s:id", dev->info.alias,
"S:name", targetname,
NULL) < 0)
return NULL;
return g_steal_pointer(&props);
} }
static char *
qemuBuildSclpDevStr(virDomainChrDef *dev) static virJSONValue *
qemuBuildSclpDevProps(virDomainChrDef *dev)
{ {
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autoptr(virJSONValue) props = NULL;
g_autofree char *chardev = g_strdup_printf("char%s", dev->info.alias);
const char *driver = NULL;
if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE) { if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE) {
switch (dev->targetType) { switch (dev->targetType) {
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP:
virBufferAddLit(&buf, "sclpconsole"); driver = "sclpconsole";
break; break;
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM:
virBufferAddLit(&buf, "sclplmconsole"); driver = "sclplmconsole";
break; break;
} }
} else { } else {
@ -5752,10 +5786,15 @@ qemuBuildSclpDevStr(virDomainChrDef *dev)
_("Cannot use slcp with devices other than console")); _("Cannot use slcp with devices other than console"));
return NULL; return NULL;
} }
virBufferAsprintf(&buf, ",chardev=char%s,id=%s",
dev->info.alias, dev->info.alias);
return virBufferContentAndReset(&buf); if (virJSONValueObjectCreate(&props,
"s:driver", driver,
"s:chardev", chardev,
"s:id", dev->info.alias,
NULL) < 0)
return NULL;
return g_steal_pointer(&props);
} }
@ -9495,12 +9534,14 @@ qemuBuildChrDeviceCommandLine(virCommand *cmd,
virDomainChrDef *chr, virDomainChrDef *chr,
virQEMUCaps *qemuCaps) virQEMUCaps *qemuCaps)
{ {
g_autofree char *devstr = NULL; g_autoptr(virJSONValue) props = NULL;
if (qemuBuildChrDeviceStr(&devstr, def, chr, qemuCaps) < 0) if (!(props = qemuBuildChrDeviceProps(def, chr, qemuCaps)))
return -1;
if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0)
return -1; return -1;
virCommandAddArgList(cmd, "-device", devstr, NULL);
return 0; return 0;
} }
@ -10950,16 +10991,13 @@ qemuBuildCommandLine(virQEMUDriver *driver,
} }
/* This function generates the correct '-device' string for character static virJSONValue *
* devices of each architecture. qemuBuildSerialChrDeviceProps(const virDomainDef *def,
*/ virDomainChrDef *serial,
static int virQEMUCaps *qemuCaps)
qemuBuildSerialChrDeviceStr(char **deviceStr,
const virDomainDef *def,
virDomainChrDef *serial,
virQEMUCaps *qemuCaps)
{ {
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autoptr(virJSONValue) props = NULL;
g_autofree char *chardev = g_strdup_printf("char%s", serial->info.alias);
virQEMUCapsFlags caps; virQEMUCapsFlags caps;
switch ((virDomainChrSerialTargetModel) serial->targetModel) { switch ((virDomainChrSerialTargetModel) serial->targetModel) {
@ -10976,7 +11014,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("'%s' is not supported in this QEMU binary"), _("'%s' is not supported in this QEMU binary"),
virDomainChrSerialTargetModelTypeToString(serial->targetModel)); virDomainChrSerialTargetModelTypeToString(serial->targetModel));
return -1; return NULL;
} }
break; break;
@ -10990,27 +11028,37 @@ qemuBuildSerialChrDeviceStr(char **deviceStr,
* branch and we will not have ended up here. */ * branch and we will not have ended up here. */
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid target model for serial device")); _("Invalid target model for serial device"));
return -1; return NULL;
} }
virBufferAsprintf(&buf, "%s,chardev=char%s,id=%s", if (virJSONValueObjectCreate(&props,
virDomainChrSerialTargetModelTypeToString(serial->targetModel), "s:driver", virDomainChrSerialTargetModelTypeToString(serial->targetModel),
serial->info.alias, serial->info.alias); "s:chardev", chardev,
"s:id", serial->info.alias,
NULL) < 0)
return NULL;
if (qemuBuildDeviceAddressStr(&buf, def, &serial->info) < 0) if (qemuBuildDeviceAddressProps(props, def, &serial->info) < 0)
return -1; return NULL;
*deviceStr = virBufferContentAndReset(&buf); return g_steal_pointer(&props);
return 0;
} }
static int
qemuBuildParallelChrDeviceStr(char **deviceStr, static virJSONValue *
virDomainChrDef *chr) qemuBuildParallelChrDeviceProps(virDomainChrDef *chr)
{ {
*deviceStr = g_strdup_printf("isa-parallel,chardev=char%s,id=%s", g_autoptr(virJSONValue) props = NULL;
chr->info.alias, chr->info.alias); g_autofree char *chardev = g_strdup_printf("char%s", chr->info.alias);
return 0;
if (virJSONValueObjectCreate(&props,
"s:driver", "isa-parallel",
"s:chardev", chardev,
"s:id", chr->info.alias,
NULL) < 0)
return NULL;
return g_steal_pointer(&props);
} }
@ -11049,48 +11097,38 @@ qemuBuildChannelGuestfwdNetdevProps(virDomainChrDef *chr)
} }
static int static virJSONValue *
qemuBuildChannelChrDeviceStr(char **deviceStr, qemuBuildChannelChrDeviceProps(const virDomainDef *def,
const virDomainDef *def, virDomainChrDef *chr)
virDomainChrDef *chr)
{ {
switch ((virDomainChrChannelTargetType)chr->targetType) { switch ((virDomainChrChannelTargetType)chr->targetType) {
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO:
if (!(*deviceStr = qemuBuildVirtioSerialPortDevStr(def, chr))) return qemuBuildVirtioSerialPortDevProps(def, chr);
return -1;
break;
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD:
/* guestfwd is as a netdev handled separately */ /* guestfwd is as a netdev handled separately */
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN:
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_NONE:
case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST: case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST:
return -1; break;
} }
return 0; return NULL;
} }
static int static virJSONValue *
qemuBuildConsoleChrDeviceStr(char **deviceStr, qemuBuildConsoleChrDeviceProps(const virDomainDef *def,
const virDomainDef *def, virDomainChrDef *chr)
virDomainChrDef *chr)
{ {
switch ((virDomainChrConsoleTargetType)chr->targetType) { switch ((virDomainChrConsoleTargetType)chr->targetType) {
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP:
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM:
if (!(*deviceStr = qemuBuildSclpDevStr(chr))) return qemuBuildSclpDevProps(chr);
return -1;
break;
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO:
if (!(*deviceStr = qemuBuildVirtioSerialPortDevStr(def, chr))) return qemuBuildVirtioSerialPortDevProps(def, chr);
return -1;
break;
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL:
break;
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE:
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN:
case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML:
@ -11100,42 +11138,36 @@ qemuBuildConsoleChrDeviceStr(char **deviceStr,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported console target type %s"), _("unsupported console target type %s"),
NULLSTR(virDomainChrConsoleTargetTypeToString(chr->targetType))); NULLSTR(virDomainChrConsoleTargetTypeToString(chr->targetType)));
return -1; break;
} }
return 0; return NULL;
} }
int
qemuBuildChrDeviceStr(char **deviceStr,
const virDomainDef *vmdef,
virDomainChrDef *chr,
virQEMUCaps *qemuCaps)
{
int ret = -1;
virJSONValue *
qemuBuildChrDeviceProps(const virDomainDef *vmdef,
virDomainChrDef *chr,
virQEMUCaps *qemuCaps)
{
switch ((virDomainChrDeviceType)chr->deviceType) { switch ((virDomainChrDeviceType)chr->deviceType) {
case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL: case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
ret = qemuBuildSerialChrDeviceStr(deviceStr, vmdef, chr, qemuCaps); return qemuBuildSerialChrDeviceProps(vmdef, chr, qemuCaps);
break;
case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL: case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
ret = qemuBuildParallelChrDeviceStr(deviceStr, chr); return qemuBuildParallelChrDeviceProps(chr);
break;
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL: case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
ret = qemuBuildChannelChrDeviceStr(deviceStr, vmdef, chr); return qemuBuildChannelChrDeviceProps(vmdef, chr);
break;
case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE: case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
ret = qemuBuildConsoleChrDeviceStr(deviceStr, vmdef, chr); return qemuBuildConsoleChrDeviceProps(vmdef, chr);
break;
case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST: case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST:
return ret; break;
} }
return ret; return NULL;
} }

View File

@ -79,12 +79,10 @@ int qemuBuildTLSx509BackendProps(const char *tlspath,
int int
qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev) G_GNUC_NO_INLINE; qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev) G_GNUC_NO_INLINE;
/* Generate '-device' string for chardev device */ virJSONValue *
int qemuBuildChrDeviceProps(const virDomainDef *vmdef,
qemuBuildChrDeviceStr(char **deviceStr, virDomainChrDef *chr,
const virDomainDef *vmdef, virQEMUCaps *qemuCaps);
virDomainChrDef *chr,
virQEMUCaps *qemuCaps);
virJSONValue * virJSONValue *
qemuBuildChannelGuestfwdNetdevProps(virDomainChrDef *chr); qemuBuildChannelGuestfwdNetdevProps(virDomainChrDef *chr);

View File

@ -2181,7 +2181,7 @@ int qemuDomainAttachChrDevice(virQEMUDriver *driver,
qemuDomainObjPrivate *priv = vm->privateData; qemuDomainObjPrivate *priv = vm->privateData;
virErrorPtr orig_err; virErrorPtr orig_err;
virDomainDef *vmdef = vm->def; virDomainDef *vmdef = vm->def;
g_autofree char *devstr = NULL; g_autoptr(virJSONValue) devprops = NULL;
g_autoptr(virJSONValue) netdevprops = NULL; g_autoptr(virJSONValue) netdevprops = NULL;
virDomainChrSourceDef *dev = chr->source; virDomainChrSourceDef *dev = chr->source;
g_autofree char *charAlias = NULL; g_autofree char *charAlias = NULL;
@ -2224,7 +2224,7 @@ int qemuDomainAttachChrDevice(virQEMUDriver *driver,
if (!(netdevprops = qemuBuildChannelGuestfwdNetdevProps(chr))) if (!(netdevprops = qemuBuildChannelGuestfwdNetdevProps(chr)))
goto cleanup; goto cleanup;
} else { } else {
if (qemuBuildChrDeviceStr(&devstr, vmdef, chr, priv->qemuCaps) < 0) if (!(devprops = qemuBuildChrDeviceProps(vmdef, chr, priv->qemuCaps)))
goto cleanup; goto cleanup;
} }
@ -2251,8 +2251,8 @@ int qemuDomainAttachChrDevice(virQEMUDriver *driver,
goto exit_monitor; goto exit_monitor;
} }
if (devstr) { if (devprops) {
if (qemuMonitorAddDevice(priv->mon, devstr) < 0) if (qemuMonitorAddDeviceProps(priv->mon, &devprops) < 0)
goto exit_monitor; goto exit_monitor;
} }

View File

@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \
-device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \ -device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-audiodev id=audio1,driver=none \ -audiodev id=audio1,driver=none \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \

View File

@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \
-device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \ -device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-audiodev id=audio1,driver=none \ -audiodev id=audio1,driver=none \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \

View File

@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \
-device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \ -device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-audiodev id=audio1,driver=none \ -audiodev id=audio1,driver=none \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \

View File

@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \
-device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \ -device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-audiodev id=audio1,driver=none \ -audiodev id=audio1,driver=none \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \

View File

@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \
-device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \ -device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-audiodev id=audio1,driver=none \ -audiodev id=audio1,driver=none \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \

View File

@ -30,7 +30,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"qcow2","file":"libvirt-1-storage"}' \
-device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \ -device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-1-format,id=virtio-disk0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-audiodev id=audio1,driver=none \ -audiodev id=audio1,driver=none \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \

View File

@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-netdev user,id=hostnet0 \ -netdev user,id=hostnet0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:a2:44:92,bus=pci.0,addr=0x1 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:a2:44:92,bus=pci.0,addr=0x1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-device usb-tablet,id=input0,bus=usb.0,port=1 \ -device usb-tablet,id=input0,bus=usb.0,port=1 \

View File

@ -33,7 +33,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-guest/.config \
-netdev user,id=hostnet0 \ -netdev user,id=hostnet0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.0,addr=0x1 \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:09:a4:37,bus=pci.0,addr=0x1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-chardev socket,id=charchannel0,fd=1729,server=on,wait=off \ -chardev socket,id=charchannel0,fd=1729,server=on,wait=off \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \ -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 \
-audiodev id=audio1,driver=none \ -audiodev id=audio1,driver=none \

View File

@ -26,5 +26,5 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-usb \ -usb \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -27,5 +27,5 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-usb \ -usb \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -27,5 +27,5 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-usb \ -usb \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -27,5 +27,5 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-usb \ -usb \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -26,5 +26,5 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-usb \ -usb \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -26,5 +26,5 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-usb \ -usb \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -26,5 +26,5 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-usb \ -usb \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -25,5 +25,5 @@ QEMU_AUDIO_DRV=none \
-no-shutdown \ -no-shutdown \
-boot strict=on \ -boot strict=on \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -26,5 +26,5 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-device pci-ohci,id=usb,bus=pci.0,addr=0x1 \ -device pci-ohci,id=usb,bus=pci.0,addr=0x1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -26,6 +26,6 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-device pci-ohci,id=usb,bus=pci.0,addr=0x1 \ -device pci-ohci,id=usb,bus=pci.0,addr=0x1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-device usb-kbd,id=input0,bus=usb.0,port=1 \ -device usb-kbd,id=input0,bus=usb.0,port=1 \
-msg timestamp=on -msg timestamp=on

View File

@ -27,5 +27,5 @@ QEMU_AUDIO_DRV=none \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1 \ -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1 \
-device pci-ohci,id=usb1,bus=pci.0,addr=0x2 \ -device pci-ohci,id=usb1,bus=pci.0,addr=0x2 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-msg timestamp=on -msg timestamp=on

View File

@ -30,7 +30,7 @@ QEMU_AUDIO_DRV=none \
-drive file=/tmp/scsidisk.img,format=raw,if=none,id=drive-scsi1-0-0-0 \ -drive file=/tmp/scsidisk.img,format=raw,if=none,id=drive-scsi1-0-0-0 \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi1-0-0-0,id=scsi1-0-0-0,bootindex=1 \ -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi1-0-0-0,id=scsi1-0-0-0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x20000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=536870912 \
-chardev pty,id=charserial1 \ -chardev pty,id=charserial1 \
-device spapr-vty,chardev=charserial1,id=serial1,reg=0x30001000 \ -device spapr-vty,chardev=charserial1,id=serial1,reg=805310464 \
-msg timestamp=on -msg timestamp=on

View File

@ -30,7 +30,7 @@ QEMU_AUDIO_DRV=none \
-drive file=/tmp/scsidisk.img,format=raw,if=none,id=drive-scsi1-0-0-0 \ -drive file=/tmp/scsidisk.img,format=raw,if=none,id=drive-scsi1-0-0-0 \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi1-0-0-0,id=scsi1-0-0-0,bootindex=1 \ -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi1-0-0-0,id=scsi1-0-0-0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-chardev pty,id=charserial1 \ -chardev pty,id=charserial1 \
-device spapr-vty,chardev=charserial1,id=serial1,reg=0x30001000 \ -device spapr-vty,chardev=charserial1,id=serial1,reg=805310464 \
-msg timestamp=on -msg timestamp=on

View File

@ -26,6 +26,6 @@ QEMU_AUDIO_DRV=none \
-boot strict=on \ -boot strict=on \
-device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \ -device virtio-serial-ccw,id=virtio-serial0,devno=fe.0.0000 \
-chardev pty,id=charconsole0 \ -chardev pty,id=charconsole0 \
-device virtconsole,chardev=charconsole0,id=console0 \ -device virtconsole,devno=fe.0.0001,chardev=charconsole0,id=console0 \
-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0002 \ -device virtio-balloon-ccw,id=balloon0,devno=fe.0.0002 \
-msg timestamp=on -msg timestamp=on

View File

@ -29,6 +29,6 @@ QEMU_AUDIO_DRV=none \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \ -drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
-chardev tty,id=charserial0,path=/dev/ttyS2 \ -chardev tty,id=charserial0,path=/dev/ttyS2 \
-device isa-serial,chardev=charserial0,id=serial0,iobase=0x3f8,irq=0x4 \ -device isa-serial,chardev=charserial0,id=serial0,iobase=1016,irq=4 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
-msg timestamp=on -msg timestamp=on

View File

@ -32,9 +32,9 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-TPM-VM/.config \
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
-device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,device_id=drive-scsi1-0-0-0,drive=libvirt-1-format,id=scsi1-0-0-0,bootindex=1 \ -device scsi-hd,bus=scsi1.0,channel=0,scsi-id=0,lun=0,device_id=drive-scsi1-0-0-0,drive=libvirt-1-format,id=scsi1-0-0-0,bootindex=1 \
-chardev pty,id=charserial0 \ -chardev pty,id=charserial0 \
-device spapr-vty,chardev=charserial0,id=serial0,reg=0x30000000 \ -device spapr-vty,chardev=charserial0,id=serial0,reg=805306368 \
-chardev pty,id=charserial1 \ -chardev pty,id=charserial1 \
-device spapr-vty,chardev=charserial1,id=serial1,reg=0x30001000 \ -device spapr-vty,chardev=charserial1,id=serial1,reg=805310464 \
-tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \ -tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \
-chardev socket,id=chrtpm,path=/dev/test \ -chardev socket,id=chrtpm,path=/dev/test \
-device tpm-spapr,tpmdev=tpm-tpm0,id=tpm0,reg=0x00005000 \ -device tpm-spapr,tpmdev=tpm-tpm0,id=tpm0,reg=0x00005000 \