qemuMonitorCreateObjectPropsWrap: Open-code in qemuBuildMemoryBackendProps

There's just one caller left. Since qemuBuildMemoryBackendProps is too
complex to be modified for now, just move the adding of 'id' and 'qom'
type directly into the function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2020-11-30 17:08:46 +01:00
parent e0eeb2cc67
commit 71828a7bc0
3 changed files with 4 additions and 21 deletions

View File

@ -3284,10 +3284,12 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps,
rc = 0;
}
if (!(*backendProps = qemuMonitorCreateObjectPropsWrap(backendType, alias,
&props)))
if (virJSONValueObjectPrependString(props, "id", alias) < 0 ||
virJSONValueObjectPrependString(props, "qom-type", backendType) < 0)
return -1;
*backendProps = g_steal_pointer(&props);
return rc;
}

View File

@ -3015,21 +3015,6 @@ qemuMonitorAddDeviceArgs(qemuMonitorPtr mon,
}
virJSONValuePtr
qemuMonitorCreateObjectPropsWrap(const char *type,
const char *alias,
virJSONValuePtr *props)
{
if (virJSONValueObjectPrependString(*props, "id", alias) < 0 ||
virJSONValueObjectPrependString(*props, "qom-type", type))
return NULL;
return g_steal_pointer(props);
}
/**
* qemuMonitorCreateObjectProps:
* @propsret: returns full object properties

View File

@ -1006,10 +1006,6 @@ int qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon,
int qemuMonitorDelDevice(qemuMonitorPtr mon,
const char *devalias);
virJSONValuePtr qemuMonitorCreateObjectPropsWrap(const char *type,
const char *alias,
virJSONValuePtr *props);
int qemuMonitorCreateObjectProps(virJSONValuePtr *propsret,
const char *type,
const char *alias,