mirror of https://gitee.com/openkylin/libvirt.git
qemuBuildObjectCommandlineFromJSON: Format directly into the virCommand
All callers basically end up dumping the buffer into a string and then adding '-object' 'props' arguments to virCommand. Simplify all callers by doing this in the function itself. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f8f9c49302
commit
6da02fecca
|
@ -156,10 +156,11 @@ VIR_ENUM_IMPL(qemuAudioDriver,
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuBuildObjectCommandlineFromJSON(virBuffer *buf,
|
qemuBuildObjectCommandlineFromJSON(virCommand *cmd,
|
||||||
virJSONValue *props,
|
virJSONValue *props,
|
||||||
virQEMUCaps *qemuCaps)
|
virQEMUCaps *qemuCaps)
|
||||||
{
|
{
|
||||||
|
g_autofree char *arg = NULL;
|
||||||
const char *type = virJSONValueObjectGetString(props, "qom-type");
|
const char *type = virJSONValueObjectGetString(props, "qom-type");
|
||||||
const char *alias = virJSONValueObjectGetString(props, "id");
|
const char *alias = virJSONValueObjectGetString(props, "id");
|
||||||
|
|
||||||
|
@ -171,13 +172,22 @@ qemuBuildObjectCommandlineFromJSON(virBuffer *buf,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_QAPIFIED)) {
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_QAPIFIED)) {
|
||||||
return virJSONValueToBuffer(props, buf, false);
|
if (!(arg = virJSONValueToString(props, false)))
|
||||||
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
virBufferAsprintf(buf, "%s,", type);
|
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
return virQEMUBuildCommandLineJSON(props, buf, "qom-type",
|
virBufferAsprintf(&buf, "%s,", type);
|
||||||
virQEMUBuildCommandLineJSONArrayBitmap);
|
|
||||||
|
if (virQEMUBuildCommandLineJSON(props, &buf, "qom-type",
|
||||||
|
virQEMUBuildCommandLineJSONArrayBitmap) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
arg = virBufferContentAndReset(&buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virCommandAddArgList(cmd, "-object", arg, NULL);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -197,7 +207,6 @@ qemuBuildMasterKeyCommandLine(virCommand *cmd,
|
||||||
{
|
{
|
||||||
g_autofree char *alias = NULL;
|
g_autofree char *alias = NULL;
|
||||||
g_autofree char *path = NULL;
|
g_autofree char *path = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
|
|
||||||
if (!(alias = qemuDomainGetMasterKeyAlias()))
|
if (!(alias = qemuDomainGetMasterKeyAlias()))
|
||||||
|
@ -217,12 +226,9 @@ qemuBuildMasterKeyCommandLine(virCommand *cmd,
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, priv->qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, priv->qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -732,18 +738,14 @@ qemuBuildObjectSecretCommandLine(virCommand *cmd,
|
||||||
qemuDomainSecretInfo *secinfo,
|
qemuDomainSecretInfo *secinfo,
|
||||||
virQEMUCaps *qemuCaps)
|
virQEMUCaps *qemuCaps)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
|
|
||||||
if (qemuBuildSecretInfoProps(secinfo, &props) < 0)
|
if (qemuBuildSecretInfoProps(secinfo, &props) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -803,19 +805,15 @@ qemuBuildTLSx509CommandLine(virCommand *cmd,
|
||||||
const char *alias,
|
const char *alias,
|
||||||
virQEMUCaps *qemuCaps)
|
virQEMUCaps *qemuCaps)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
|
|
||||||
if (qemuBuildTLSx509BackendProps(tlspath, isListen, verifypeer, alias,
|
if (qemuBuildTLSx509BackendProps(tlspath, isListen, verifypeer, alias,
|
||||||
certEncSecretAlias, &props) < 0)
|
certEncSecretAlias, &props) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1852,17 +1850,12 @@ qemuBuildObjectCommandline(virCommand *cmd,
|
||||||
virJSONValue *objProps,
|
virJSONValue *objProps,
|
||||||
virQEMUCaps *qemuCaps)
|
virQEMUCaps *qemuCaps)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
|
|
||||||
if (!objProps)
|
if (!objProps)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, objProps, qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, objProps, qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3210,7 +3203,7 @@ qemuBuildMemoryCellBackendProps(virDomainDef *def,
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuBuildMemoryDimmBackendStr(virBuffer *buf,
|
qemuBuildMemoryDimmBackendStr(virCommand *cmd,
|
||||||
virDomainMemoryDef *mem,
|
virDomainMemoryDef *mem,
|
||||||
virDomainDef *def,
|
virDomainDef *def,
|
||||||
virQEMUDriverConfig *cfg,
|
virQEMUDriverConfig *cfg,
|
||||||
|
@ -3231,7 +3224,7 @@ qemuBuildMemoryDimmBackendStr(virBuffer *buf,
|
||||||
priv, def, mem, true, false) < 0)
|
priv, def, mem, true, false) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(buf, props, priv->qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, priv->qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3946,16 +3939,12 @@ qemuBuildInputCommandLine(virCommand *cmd,
|
||||||
|
|
||||||
if (input->type == VIR_DOMAIN_INPUT_TYPE_EVDEV) {
|
if (input->type == VIR_DOMAIN_INPUT_TYPE_EVDEV) {
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
|
|
||||||
if (!(props = qemuBuildInputEvdevProps(input)))
|
if (!(props = qemuBuildInputEvdevProps(input)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
} else {
|
} else {
|
||||||
g_autofree char *devstr = NULL;
|
g_autofree char *devstr = NULL;
|
||||||
|
|
||||||
|
@ -5523,11 +5512,9 @@ qemuBuildRNGCommandLine(virLogManager *logManager,
|
||||||
|
|
||||||
for (i = 0; i < def->nrngs; i++) {
|
for (i = 0; i < def->nrngs; i++) {
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
virDomainRNGDef *rng = def->rngs[i];
|
virDomainRNGDef *rng = def->rngs[i];
|
||||||
g_autofree char *chardev = NULL;
|
g_autofree char *chardev = NULL;
|
||||||
g_autofree char *devstr = NULL;
|
g_autofree char *devstr = NULL;
|
||||||
int rc;
|
|
||||||
|
|
||||||
if (!rng->info.alias) {
|
if (!rng->info.alias) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
@ -5547,14 +5534,9 @@ qemuBuildRNGCommandLine(virLogManager *logManager,
|
||||||
if (qemuBuildRNGBackendProps(rng, &props) < 0)
|
if (qemuBuildRNGBackendProps(rng, &props) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
rc = qemuBuildObjectCommandlineFromJSON(&buf, props, qemuCaps);
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0)
|
||||||
|
|
||||||
if (rc < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
/* add the device */
|
/* add the device */
|
||||||
if (qemuCommandAddExtDevice(cmd, &rng->info) < 0)
|
if (qemuCommandAddExtDevice(cmd, &rng->info) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -7128,7 +7110,6 @@ qemuBuildMemCommandLineMemoryDefaultBackend(virCommand *cmd,
|
||||||
{
|
{
|
||||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver);
|
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver);
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
virDomainMemoryDef mem = { 0 };
|
virDomainMemoryDef mem = { 0 };
|
||||||
|
|
||||||
mem.size = virDomainDefGetMemoryInitial(def);
|
mem.size = virDomainDefGetMemoryInitial(def);
|
||||||
|
@ -7139,11 +7120,9 @@ qemuBuildMemCommandLineMemoryDefaultBackend(virCommand *cmd,
|
||||||
priv, def, &mem, false, true) < 0)
|
priv, def, &mem, false, true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, priv->qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, priv->qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7222,17 +7201,13 @@ qemuBuildIOThreadCommandLine(virCommand *cmd,
|
||||||
|
|
||||||
for (i = 0; i < def->niothreadids; i++) {
|
for (i = 0; i < def->niothreadids; i++) {
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
g_autofree char *alias = g_strdup_printf("iothread%u", def->iothreadids[i]->iothread_id);
|
g_autofree char *alias = g_strdup_printf("iothread%u", def->iothreadids[i]->iothread_id);
|
||||||
|
|
||||||
if (qemuMonitorCreateObjectProps(&props, "iothread", alias, NULL) < 0)
|
if (qemuMonitorCreateObjectProps(&props, "iothread", alias, NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -7461,14 +7436,9 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg,
|
||||||
ssize_t initiator = virDomainNumaGetNodeInitiator(def->numa, i);
|
ssize_t initiator = virDomainNumaGetNodeInitiator(def->numa, i);
|
||||||
|
|
||||||
if (needBackend) {
|
if (needBackend) {
|
||||||
g_auto(virBuffer) objbuf = VIR_BUFFER_INITIALIZER;
|
if (qemuBuildObjectCommandlineFromJSON(cmd, nodeBackends[i],
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&objbuf, nodeBackends[i],
|
|
||||||
priv->qemuCaps) < 0)
|
priv->qemuCaps) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &objbuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-numa");
|
virCommandAddArg(cmd, "-numa");
|
||||||
|
@ -7546,15 +7516,11 @@ qemuBuildMemoryDeviceCommandLine(virCommand *cmd,
|
||||||
/* memory hotplug requires NUMA to be enabled - we already checked
|
/* memory hotplug requires NUMA to be enabled - we already checked
|
||||||
* that memory devices are present only when NUMA is */
|
* that memory devices are present only when NUMA is */
|
||||||
for (i = 0; i < def->nmems; i++) {
|
for (i = 0; i < def->nmems; i++) {
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
char *dimmStr;
|
char *dimmStr;
|
||||||
|
|
||||||
if (qemuBuildMemoryDimmBackendStr(&buf, def->mems[i], def, cfg, priv) < 0)
|
if (qemuBuildMemoryDimmBackendStr(cmd, def->mems[i], def, cfg, priv) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
if (!(dimmStr = qemuBuildMemoryDeviceStr(def, def->mems[i], priv->qemuCaps)))
|
if (!(dimmStr = qemuBuildMemoryDeviceStr(def, def->mems[i], priv->qemuCaps)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -9063,10 +9029,8 @@ qemuBuildShmemCommandLine(virLogManager *logManager,
|
||||||
bool chardevStdioLogd)
|
bool chardevStdioLogd)
|
||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) memProps = NULL;
|
g_autoptr(virJSONValue) memProps = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
g_autofree char *devstr = NULL;
|
g_autofree char *devstr = NULL;
|
||||||
g_autofree char *chardev = NULL;
|
g_autofree char *chardev = NULL;
|
||||||
int rc;
|
|
||||||
unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
|
unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT |
|
||||||
QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
|
QEMU_BUILD_CHARDEV_UNIX_FD_PASS;
|
||||||
if (chardevStdioLogd)
|
if (chardevStdioLogd)
|
||||||
|
@ -9107,14 +9071,9 @@ qemuBuildShmemCommandLine(virLogManager *logManager,
|
||||||
if (!(memProps = qemuBuildShmemBackendMemProps(shmem)))
|
if (!(memProps = qemuBuildShmemBackendMemProps(shmem)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
rc = qemuBuildObjectCommandlineFromJSON(&buf, memProps, qemuCaps);
|
if (qemuBuildObjectCommandlineFromJSON(cmd, memProps, qemuCaps) < 0)
|
||||||
|
|
||||||
if (rc < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
G_GNUC_FALLTHROUGH;
|
G_GNUC_FALLTHROUGH;
|
||||||
case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_DOORBELL:
|
case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_DOORBELL:
|
||||||
devstr = qemuBuildShmemDevStr(def, shmem, qemuCaps);
|
devstr = qemuBuildShmemDevStr(def, shmem, qemuCaps);
|
||||||
|
@ -9835,7 +9794,6 @@ qemuBuildSEVCommandLine(virDomainObj *vm, virCommand *cmd,
|
||||||
virDomainSEVDef *sev)
|
virDomainSEVDef *sev)
|
||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
g_autofree char *dhpath = NULL;
|
g_autofree char *dhpath = NULL;
|
||||||
g_autofree char *sessionpath = NULL;
|
g_autofree char *sessionpath = NULL;
|
||||||
|
@ -9858,11 +9816,9 @@ qemuBuildSEVCommandLine(virDomainObj *vm, virCommand *cmd,
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, priv->qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, priv->qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9871,18 +9827,15 @@ static int
|
||||||
qemuBuildPVCommandLine(virDomainObj *vm, virCommand *cmd)
|
qemuBuildPVCommandLine(virDomainObj *vm, virCommand *cmd)
|
||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
qemuDomainObjPrivate *priv = vm->privateData;
|
qemuDomainObjPrivate *priv = vm->privateData;
|
||||||
|
|
||||||
if (qemuMonitorCreateObjectProps(&props, "s390-pv-guest", "lsec0",
|
if (qemuMonitorCreateObjectProps(&props, "s390-pv-guest", "lsec0",
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, priv->qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, priv->qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10012,7 +9965,6 @@ qemuBuildManagedPRCommandLine(virCommand *cmd,
|
||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
qemuDomainObjPrivate *priv)
|
qemuDomainObjPrivate *priv)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
|
|
||||||
if (!virDomainDefHasManagedPR(def))
|
if (!virDomainDefHasManagedPR(def))
|
||||||
|
@ -10021,12 +9973,9 @@ qemuBuildManagedPRCommandLine(virCommand *cmd,
|
||||||
if (!(props = qemuBuildPRManagedManagerInfoProps(priv)))
|
if (!(props = qemuBuildPRManagedManagerInfoProps(priv)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, priv->qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, priv->qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10095,7 +10044,6 @@ qemuBuildDBusVMStateCommandLine(virCommand *cmd,
|
||||||
virQEMUDriver *driver,
|
virQEMUDriver *driver,
|
||||||
virDomainObj *vm)
|
virDomainObj *vm)
|
||||||
{
|
{
|
||||||
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
|
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
qemuDomainObjPrivate *priv = QEMU_DOMAIN_PRIVATE(vm);
|
qemuDomainObjPrivate *priv = QEMU_DOMAIN_PRIVATE(vm);
|
||||||
|
|
||||||
|
@ -10110,12 +10058,9 @@ qemuBuildDBusVMStateCommandLine(virCommand *cmd,
|
||||||
if (!(props = qemuBuildDBusVMStateInfoProps(driver, vm)))
|
if (!(props = qemuBuildDBusVMStateInfoProps(driver, vm)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuBuildObjectCommandlineFromJSON(&buf, props, priv->qemuCaps) < 0)
|
if (qemuBuildObjectCommandlineFromJSON(cmd, props, priv->qemuCaps) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virCommandAddArg(cmd, "-object");
|
|
||||||
virCommandAddArgBuffer(cmd, &buf);
|
|
||||||
|
|
||||||
priv->dbusVMState = true;
|
priv->dbusVMState = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue