提交 a47508d9 编写于 作者: P Peter Krempa

qemu: monitor: Rename qemuMonitorAddObject to qemuMonitorAddObjectType

The function adds the object of a certain type. Change the name so that
we make room for the generic function.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 7317a83f
......@@ -5819,7 +5819,7 @@ qemuDomainHotplugAddIOThread(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorAddObject(priv->mon, "iothread", alias, NULL);
rc = qemuMonitorAddObjectType(priv->mon, "iothread", alias, NULL);
exp_niothreads++;
if (rc < 0)
goto exit_monitor;
......
......@@ -487,28 +487,28 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, vm);
if (secobjProps) {
rv = qemuMonitorAddObject(priv->mon, "secret", secinfo->s.aes.alias,
secobjProps);
secobjProps = NULL; /* qemuMonitorAddObject consumes */
rv = qemuMonitorAddObjectType(priv->mon, "secret", secinfo->s.aes.alias,
secobjProps);
secobjProps = NULL; /* qemuMonitorAddObjectType consumes */
if (rv < 0)
goto exit_monitor;
secobjAdded = true;
}
if (encobjProps) {
rv = qemuMonitorAddObject(priv->mon, "secret", encinfo->s.aes.alias,
encobjProps);
encobjProps = NULL; /* qemuMonitorAddObject consumes */
rv = qemuMonitorAddObjectType(priv->mon, "secret", encinfo->s.aes.alias,
encobjProps);
encobjProps = NULL; /* qemuMonitorAddObjectType consumes */
if (rv < 0)
goto exit_monitor;
encobjAdded = true;
}
if (prmgrProps) {
rv = qemuMonitorAddObject(priv->mon, "pr-manager-helper",
disk->src->pr->mgralias,
prmgrProps);
prmgrProps = NULL; /* qemuMonitorAddObject consumes */
rv = qemuMonitorAddObjectType(priv->mon, "pr-manager-helper",
disk->src->pr->mgralias,
prmgrProps);
prmgrProps = NULL; /* qemuMonitorAddObjectType consumes */
if (rv < 0)
goto exit_monitor;
prmgrAdded = true;
......@@ -1465,17 +1465,17 @@ qemuDomainAddTLSObjects(virQEMUDriverPtr driver,
return -1;
if (secAlias) {
rc = qemuMonitorAddObject(priv->mon, "secret",
secAlias, *secProps);
*secProps = NULL; /* qemuMonitorAddObject consumes */
rc = qemuMonitorAddObjectType(priv->mon, "secret",
secAlias, *secProps);
*secProps = NULL; /* qemuMonitorAddObjectType consumes */
if (rc < 0)
goto error;
}
if (tlsAlias) {
rc = qemuMonitorAddObject(priv->mon, "tls-creds-x509",
tlsAlias, *tlsProps);
*tlsProps = NULL; /* qemuMonitorAddObject consumes */
rc = qemuMonitorAddObjectType(priv->mon, "tls-creds-x509",
tlsAlias, *tlsProps);
*tlsProps = NULL; /* qemuMonitorAddObjectType consumes */
if (rc < 0)
goto error;
}
......@@ -2037,8 +2037,8 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
goto exit_monitor;
chardevAdded = true;
rv = qemuMonitorAddObject(priv->mon, type, objAlias, props);
props = NULL; /* qemuMonitorAddObject consumes */
rv = qemuMonitorAddObjectType(priv->mon, type, objAlias, props);
props = NULL; /* qemuMonitorAddObjectType consumes */
if (rv < 0)
goto exit_monitor;
objAdded = true;
......@@ -2168,8 +2168,8 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver,
goto removedef;
qemuDomainObjEnterMonitor(driver, vm);
rv = qemuMonitorAddObject(priv->mon, backendType, objalias, props);
props = NULL; /* qemuMonitorAddObject consumes */
rv = qemuMonitorAddObjectType(priv->mon, backendType, objalias, props);
props = NULL; /* qemuMonitorAddObjectType consumes */
if (rv < 0)
goto exit_monitor;
objAdded = true;
......@@ -2407,9 +2407,9 @@ qemuDomainAttachHostSCSIDevice(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, vm);
if (secobjProps) {
rv = qemuMonitorAddObject(priv->mon, "secret", secinfo->s.aes.alias,
secobjProps);
secobjProps = NULL; /* qemuMonitorAddObject consumes */
rv = qemuMonitorAddObjectType(priv->mon, "secret", secinfo->s.aes.alias,
secobjProps);
secobjProps = NULL; /* qemuMonitorAddObjectType consumes */
if (rv < 0)
goto exit_monitor;
secobjAdded = true;
......@@ -2780,8 +2780,8 @@ qemuDomainAttachShmemDevice(virQEMUDriverPtr driver,
&shmem->server.chr) < 0)
goto exit_monitor;
} else {
if (qemuMonitorAddObject(priv->mon, "memory-backend-file",
memAlias, props) < 0) {
if (qemuMonitorAddObjectType(priv->mon, "memory-backend-file",
memAlias, props) < 0) {
props = NULL;
goto exit_monitor;
}
......
......@@ -2992,7 +2992,7 @@ qemuMonitorAddDeviceArgs(qemuMonitorPtr mon,
/**
* qemuMonitorAddObject:
* qemuMonitorAddObjectType:
* @mon: Pointer to monitor object
* @type: Type name of object to add
* @objalias: Alias of the new object
......@@ -3002,10 +3002,10 @@ qemuMonitorAddDeviceArgs(qemuMonitorPtr mon,
* Returns 0 on success -1 on error.
*/
int
qemuMonitorAddObject(qemuMonitorPtr mon,
const char *type,
const char *objalias,
virJSONValuePtr props)
qemuMonitorAddObjectType(qemuMonitorPtr mon,
const char *type,
const char *objalias,
virJSONValuePtr props)
{
VIR_DEBUG("type=%s objalias=%s props=%p", type, objalias, props);
......
......@@ -797,10 +797,10 @@ int qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon,
int qemuMonitorDelDevice(qemuMonitorPtr mon,
const char *devalias);
int qemuMonitorAddObject(qemuMonitorPtr mon,
const char *type,
const char *objalias,
virJSONValuePtr props);
int qemuMonitorAddObjectType(qemuMonitorPtr mon,
const char *type,
const char *objalias,
virJSONValuePtr props);
int qemuMonitorDelObject(qemuMonitorPtr mon,
const char *objalias);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册