[PATCH] virnwfilterobj: Don't use virObjectLockGuard() with virNWFilterObj
by Michal Privoznik
While its name would suggest that virNWFilterObj is an actual
virObject it is not. It's a plain structure (with virMutex as its
first member). Therefore, when locking the struct
virObjectLockGuard() can' be used and virLockGuardLock() must be
used instead.
Spotted-by: Martin Kletzander <mkletzan(a)redhat.com>
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/virnwfilterobj.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c
index 309f8bddb4..e9bb2b1811 100644
--- a/src/conf/virnwfilterobj.c
+++ b/src/conf/virnwfilterobj.c
@@ -386,7 +386,7 @@ virNWFilterObjListCount(void *key G_GNUC_UNUSED,
{
virNWFilterObj *obj = payload;
struct virNWFilterObjListData *data = opaque;
- VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
+ VIR_LOCK_GUARD lock = virLockGuardLock(&obj->lock);
if (data->filter(data->conn, obj->def))
data->count++;
@@ -423,7 +423,7 @@ virNWFilterObjListCopyNames(void *key G_GNUC_UNUSED,
{
virNWFilterObj *obj = payload;
struct virNWFilterNameData *data = opaque;
- VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
+ VIR_LOCK_GUARD lock = virLockGuardLock(&obj->lock);
if (data->filter &&
!data->filter(data->conn, obj->def))
--
2.34.1
2 years, 9 months
[PATCH] qemu: use qemuDomainSaveStatus() and remove qemuDomainObjSaveStatus()
by Kristina Hanicova
It does not make sense to have both of these, since one of them
is only a wrapper for the other one. I decided to preserve the
more general one, which requires only virDomainObj and rewrote it
a bit, so that it pulls the qemu driver from privateData.
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/qemu/THREADS.txt | 4 +-
src/qemu/qemu_backup.c | 20 +--
src/qemu/qemu_block.c | 18 +-
src/qemu/qemu_blockjob.c | 20 +--
src/qemu/qemu_checkpoint.c | 14 +-
src/qemu/qemu_domain.c | 35 ++--
src/qemu/qemu_domain.h | 7 +-
src/qemu/qemu_domainjob.c | 19 +-
src/qemu/qemu_domainjob.h | 12 +-
src/qemu/qemu_driver.c | 296 +++++++++++++++----------------
src/qemu/qemu_hotplug.c | 136 +++++++-------
src/qemu/qemu_migration.c | 120 ++++++-------
src/qemu/qemu_migration_cookie.c | 2 +-
src/qemu/qemu_migration_params.c | 8 +-
src/qemu/qemu_process.c | 65 ++++---
src/qemu/qemu_process.h | 3 +-
src/qemu/qemu_snapshot.c | 14 +-
17 files changed, 384 insertions(+), 409 deletions(-)
diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt
index 98aa3165e3..30cf3ce210 100644
--- a/src/qemu/THREADS.txt
+++ b/src/qemu/THREADS.txt
@@ -294,7 +294,7 @@ Design patterns
goto error;
}
...start qemu job...
- qemuDomainObjExitMonitor(driver, obj);
+ qemuDomainObjExitMonitor(obj);
while (!finished) {
if (qemuDomainObjEnterMonitorAsync(driver, obj,
@@ -303,7 +303,7 @@ Design patterns
goto error;
}
...monitor job progress...
- qemuDomainObjExitMonitor(driver, obj);
+ qemuDomainObjExitMonitor(obj);
virObjectUnlock(obj);
sleep(aWhile);
diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index 2471242e60..f31b840617 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -132,7 +132,7 @@ qemuBackupDiskDataCleanupOne(virDomainObj *vm,
if (dd->added) {
qemuDomainObjEnterMonitor(priv->driver, vm);
qemuBlockStorageSourceAttachRollback(priv->mon, dd->crdata->srcdata[0]);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (dd->created) {
@@ -474,7 +474,7 @@ qemuBackupDiskPrepareOneStorage(virDomainObj *vm,
rc = qemuBlockStorageSourceAttachApply(priv->mon, dd->crdata->srcdata[0]);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
}
@@ -623,7 +623,7 @@ qemuBackupJobTerminate(virDomainObj *vm,
g_clear_pointer(&priv->backup, virDomainBackupDefFree);
if (priv->job.asyncJob == QEMU_ASYNC_JOB_BACKUP)
- qemuDomainObjEndAsyncJob(priv->driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
}
@@ -681,7 +681,7 @@ qemuBackupJobCancelBlockjobs(virDomainObj *vm,
rc = qemuMonitorBlockJobCancel(priv->mon, job->name, true);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc == 0) {
backupdisk->state = VIR_DOMAIN_BACKUP_DISK_STATE_CANCELLING;
@@ -893,7 +893,7 @@ qemuBackupBegin(virDomainObj *vm,
if (rc == 0)
rc = qemuMonitorTransaction(priv->mon, &actions);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
@@ -915,7 +915,7 @@ qemuBackupBegin(virDomainObj *vm,
/* note that if the export fails we've already created the checkpoint
* and we will not delete it */
rc = qemuBackupBeginPullExportDisks(vm, dd, ndd);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0) {
qemuBackupJobCancelBlockjobs(vm, priv->backup, false, QEMU_ASYNC_JOB_BACKUP);
@@ -939,7 +939,7 @@ qemuBackupBegin(virDomainObj *vm,
ignore_value(qemuMonitorDelObject(priv->mon, tlsAlias, false));
if (tlsSecretAlias)
ignore_value(qemuMonitorDelObject(priv->mon, tlsSecretAlias, false));
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (ret < 0 && !job_started && priv->backup)
@@ -948,7 +948,7 @@ qemuBackupBegin(virDomainObj *vm,
if (ret == 0)
qemuDomainObjReleaseAsyncJob(vm);
else
- qemuDomainObjEndAsyncJob(priv->driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
return ret;
}
@@ -1007,7 +1007,7 @@ qemuBackupNotifyBlockjobEnd(virDomainObj *vm,
ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsAlias, false));
if (backup->tlsSecretAlias)
ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsSecretAlias, false));
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
/* update the final statistics with the current job's data */
backup->pull_tmp_used += cur;
@@ -1165,7 +1165,7 @@ qemuBackupGetJobInfoStats(virQEMUDriver *driver,
rc = qemuMonitorGetJobInfo(priv->mon, &blockjobs, &nblockjobs);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 4195883a1e..f70b6d3e63 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -326,7 +326,7 @@ qemuBlockNodeNamesDetect(virQEMUDriver *driver,
data = qemuMonitorQueryNamedBlockNodes(qemuDomainGetMonitor(vm));
blockstats = qemuMonitorQueryBlockstats(qemuDomainGetMonitor(vm));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (!data || !blockstats)
return -1;
@@ -2133,7 +2133,7 @@ qemuBlockStorageSourceDetachOneBlockdev(virQEMUDriver *driver,
if (ret == 0)
ret = qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), src->nodestorage);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -2712,7 +2712,7 @@ qemuBlockStorageSourceCreateGeneric(virDomainObj *vm,
rc = qemuMonitorBlockdevCreate(priv->mon, job->name, &props);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -2859,7 +2859,7 @@ qemuBlockStorageSourceCreate(virDomainObj *vm,
rc = qemuBlockStorageSourceAttachApplyStorageDeps(priv->mon, data);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -2874,7 +2874,7 @@ qemuBlockStorageSourceCreate(virDomainObj *vm,
if (rc == 0)
rc = qemuBlockStorageSourceAttachApplyFormatDeps(priv->mon, data);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -2893,7 +2893,7 @@ qemuBlockStorageSourceCreate(virDomainObj *vm,
rc = qemuBlockStorageSourceAttachApplyFormat(priv->mon, data);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -2905,7 +2905,7 @@ qemuBlockStorageSourceCreate(virDomainObj *vm,
qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) == 0) {
qemuBlockStorageSourceAttachRollback(priv->mon, data);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
return ret;
@@ -3033,7 +3033,7 @@ qemuBlockGetNamedNodeData(virDomainObj *vm,
blockNamedNodeData = qemuMonitorBlockGetNamedNodeData(priv->mon, supports_flat);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (!blockNamedNodeData)
return NULL;
@@ -3391,7 +3391,7 @@ qemuBlockReopenFormat(virDomainObj *vm,
rc = qemuBlockReopenFormatMon(priv->mon, src);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 7032814d21..87f8ae7b52 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -504,7 +504,7 @@ qemuBlockJobRefreshJobs(virQEMUDriver *driver,
rc = qemuMonitorGetJobInfo(priv->mon, &jobinfo, &njobinfo);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -528,7 +528,7 @@ qemuBlockJobRefreshJobs(virQEMUDriver *driver,
if (rc == -1 && jobinfo[i]->status == QEMU_MONITOR_JOB_STATUS_CONCLUDED)
VIR_WARN("can't cancel job '%s' with invalid data", job->name);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
qemuBlockJobUnregister(job, vm);
@@ -852,7 +852,7 @@ qemuBlockJobEventProcessConcludedRemoveChain(virQEMUDriver *driver,
qemuBlockStorageSourceChainDetach(qemuDomainGetMonitor(vm), data);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
qemuDomainStorageSourceChainAccessRevoke(driver, vm, chain);
}
@@ -967,7 +967,7 @@ qemuBlockJobProcessEventCompletedPullBitmaps(virDomainObj *vm,
qemuMonitorTransaction(priv->mon, &actions);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
return 0;
}
@@ -1140,7 +1140,7 @@ qemuBlockJobProcessEventCompletedCommitBitmaps(virDomainObj *vm,
qemuMonitorTransaction(priv->mon, &actions);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (!active) {
if (qemuBlockReopenReadOnly(vm, job->data.commit.base, asyncJob) < 0)
@@ -1357,7 +1357,7 @@ qemuBlockJobProcessEventCompletedCopyBitmaps(virDomainObj *vm,
qemuMonitorTransaction(priv->mon, &actions);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
return 0;
}
@@ -1455,7 +1455,7 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriver *driver,
disk->mirror->nodeformat,
"libvirt-tmp-activewrite");
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
/* Ideally, we would make the backing chain read only again (yes, SELinux
* can do that using different labels). But that is not implemented yet and
@@ -1501,7 +1501,7 @@ qemuBlockJobProcessEventConcludedCreate(virQEMUDriver *driver,
qemuBlockStorageSourceAttachRollback(qemuDomainGetMonitor(vm), backend);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
qemuDomainStorageSourceAccessRevoke(driver, vm, job->data.create.src);
}
@@ -1536,7 +1536,7 @@ qemuBlockJobProcessEventConcludedBackup(virQEMUDriver *driver,
job->disk->src->nodeformat,
job->data.backup.bitmap);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (job->data.backup.store)
qemuDomainStorageSourceAccessRevoke(driver, vm, job->data.backup.store);
@@ -1649,7 +1649,7 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobData *job,
/* dismiss job in qemu */
ignore_value(qemuMonitorJobDismiss(qemuDomainGetMonitor(vm), job->name));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if ((job->newstate == QEMU_BLOCKJOB_STATE_COMPLETED ||
job->newstate == QEMU_BLOCKJOB_STATE_FAILED) &&
diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
index 69f287399b..2a495dfe08 100644
--- a/src/qemu/qemu_checkpoint.c
+++ b/src/qemu/qemu_checkpoint.c
@@ -237,7 +237,7 @@ qemuCheckpointDiscardBitmaps(virDomainObj *vm,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorTransaction(priv->mon, &actions);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
relabel:
for (next = relabelimages; next; next = next->next) {
@@ -524,7 +524,7 @@ qemuCheckpointCreate(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorTransaction(qemuDomainGetMonitor(vm), &actions);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0) {
qemuCheckpointRollbackMetadata(vm, chk);
return NULL;
@@ -629,7 +629,7 @@ qemuCheckpointCreateXML(virDomainPtr domain,
checkpoint = virGetDomainCheckpoint(domain, chk->def->name);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return checkpoint;
}
@@ -736,7 +736,7 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm,
if (rc == 0)
rc = qemuMonitorTransaction(priv->mon, &mergeactions);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
@@ -748,7 +748,7 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm,
rc = qemuMonitorTransaction(priv->mon, &cleanupactions);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
@@ -768,7 +768,7 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -921,6 +921,6 @@ qemuCheckpointDelete(virDomainObj *vm,
}
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b4184285bf..7180ae616b 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5822,9 +5822,10 @@ virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = {
void
-qemuDomainObjSaveStatus(virQEMUDriver *driver,
- virDomainObj *obj)
+qemuDomainSaveStatus(virDomainObj *obj)
{
+ qemuDomainObjPrivate *priv = obj->privateData;
+ virQEMUDriver *driver = priv->driver;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
if (virDomainObjIsActive(obj)) {
@@ -5834,13 +5835,6 @@ qemuDomainObjSaveStatus(virQEMUDriver *driver,
}
-void
-qemuDomainSaveStatus(virDomainObj *obj)
-{
- qemuDomainObjSaveStatus(QEMU_DOMAIN_PRIVATE(obj)->driver, obj);
-}
-
-
void
qemuDomainSaveConfig(virDomainObj *obj)
{
@@ -5887,7 +5881,7 @@ qemuDomainObjEnterMonitorInternal(virQEMUDriver *driver,
if (!virDomainObjIsActive(obj)) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("domain is no longer running"));
- qemuDomainObjEndJob(driver, obj);
+ qemuDomainObjEndJob(obj);
return -1;
}
} else if (priv->job.asyncOwner == virThreadSelfID()) {
@@ -5916,8 +5910,7 @@ qemuDomainObjEnterMonitorInternal(virQEMUDriver *driver,
*
*/
void
-qemuDomainObjExitMonitor(virQEMUDriver *driver,
- virDomainObj *obj)
+qemuDomainObjExitMonitor(virDomainObj *obj)
{
qemuDomainObjPrivate *priv = obj->privateData;
bool hasRefs;
@@ -5938,7 +5931,7 @@ qemuDomainObjExitMonitor(virQEMUDriver *driver,
priv->mon = NULL;
if (priv->job.active == QEMU_JOB_ASYNC_NESTED)
- qemuDomainObjEndJob(driver, obj);
+ qemuDomainObjEndJob(obj);
}
void qemuDomainObjEnterMonitor(virQEMUDriver *driver,
@@ -7004,7 +6997,7 @@ qemuDomainSnapshotDiscard(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
/* we continue on even in the face of error */
qemuMonitorDeleteSnapshot(priv->mon, snap->def->name);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
}
@@ -7169,7 +7162,7 @@ qemuDomainRemoveInactiveJob(virQEMUDriver *driver,
qemuDomainRemoveInactive(driver, vm);
if (haveJob)
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
@@ -7190,7 +7183,7 @@ qemuDomainRemoveInactiveJobLocked(virQEMUDriver *driver,
qemuDomainRemoveInactiveLocked(driver, vm);
if (haveJob)
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
@@ -8213,7 +8206,7 @@ qemuDomainUpdateDeviceList(virQEMUDriver *driver,
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
return -1;
rc = qemuMonitorGetDeviceAliases(priv->mon, &aliases);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -8241,7 +8234,7 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriver *driver,
rc = qemuMonitorGetMemoryDeviceInfo(priv->mon, &meminfo);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -9515,7 +9508,7 @@ qemuDomainRefreshVcpuInfo(virQEMUDriver *driver,
rc = qemuMonitorGetCPUInfo(qemuDomainGetMonitor(vm), &info, maxvcpus,
hotplug, fast);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -9669,7 +9662,7 @@ qemuDomainRefreshVcpuHalted(virQEMUDriver *driver,
QEMU_CAPS_QUERY_CPUS_FAST);
haltedmap = qemuMonitorGetCpuHalted(qemuDomainGetMonitor(vm), maxvcpus,
fast);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (!haltedmap)
return -1;
@@ -10100,7 +10093,7 @@ qemuDomainCheckMonitor(virQEMUDriver *driver,
ret = qemuMonitorCheck(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index be56b5dbb3..edafb585b3 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -61,10 +61,6 @@ typedef void (*qemuDomainCleanupCallback)(virQEMUDriver *driver,
#define QEMU_DOMAIN_MASTER_KEY_LEN 32 /* 32 bytes for 256 bit random key */
-void
-qemuDomainObjSaveStatus(virQEMUDriver *driver,
- virDomainObj *obj);
-
void qemuDomainSaveStatus(virDomainObj *obj);
void qemuDomainSaveConfig(virDomainObj *obj);
@@ -500,8 +496,7 @@ qemuMonitor *qemuDomainGetMonitor(virDomainObj *vm)
void qemuDomainObjEnterMonitor(virQEMUDriver *driver,
virDomainObj *obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
-void qemuDomainObjExitMonitor(virQEMUDriver *driver,
- virDomainObj *obj)
+void qemuDomainObjExitMonitor(virDomainObj *obj)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuDomainObjEnterMonitorAsync(virQEMUDriver *driver,
virDomainObj *obj,
diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index 28c09ae179..cf1e093e22 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -703,8 +703,7 @@ qemuDomainJobDataToParams(virDomainJobData *jobData,
void
-qemuDomainObjSetJobPhase(virQEMUDriver *driver,
- virDomainObj *obj,
+qemuDomainObjSetJobPhase(virDomainObj *obj,
int phase)
{
qemuDomainObjPrivate *priv = obj->privateData;
@@ -727,7 +726,7 @@ qemuDomainObjSetJobPhase(virQEMUDriver *driver,
priv->job.phase = phase;
priv->job.asyncOwner = me;
- qemuDomainObjSaveStatus(driver, obj);
+ qemuDomainSaveStatus(obj);
}
void
@@ -743,14 +742,14 @@ qemuDomainObjSetAsyncJobMask(virDomainObj *obj,
}
void
-qemuDomainObjDiscardAsyncJob(virQEMUDriver *driver, virDomainObj *obj)
+qemuDomainObjDiscardAsyncJob(virDomainObj *obj)
{
qemuDomainObjPrivate *priv = obj->privateData;
if (priv->job.active == QEMU_JOB_ASYNC_NESTED)
qemuDomainObjResetJob(&priv->job);
qemuDomainObjResetAsyncJob(&priv->job);
- qemuDomainObjSaveStatus(driver, obj);
+ qemuDomainSaveStatus(obj);
}
void
@@ -926,7 +925,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
}
if (qemuDomainTrackJob(job))
- qemuDomainObjSaveStatus(driver, obj);
+ qemuDomainSaveStatus(obj);
return 0;
@@ -1134,7 +1133,7 @@ qemuDomainObjBeginJobNowait(virQEMUDriver *driver,
* earlier qemuDomainBeginJob() call
*/
void
-qemuDomainObjEndJob(virQEMUDriver *driver, virDomainObj *obj)
+qemuDomainObjEndJob(virDomainObj *obj)
{
qemuDomainObjPrivate *priv = obj->privateData;
qemuDomainJob job = priv->job.active;
@@ -1148,7 +1147,7 @@ qemuDomainObjEndJob(virQEMUDriver *driver, virDomainObj *obj)
qemuDomainObjResetJob(&priv->job);
if (qemuDomainTrackJob(job))
- qemuDomainObjSaveStatus(driver, obj);
+ qemuDomainSaveStatus(obj);
/* We indeed need to wake up ALL threads waiting because
* grabbing a job requires checking more variables. */
virCondBroadcast(&priv->job.cond);
@@ -1174,7 +1173,7 @@ qemuDomainObjEndAgentJob(virDomainObj *obj)
}
void
-qemuDomainObjEndAsyncJob(virQEMUDriver *driver, virDomainObj *obj)
+qemuDomainObjEndAsyncJob(virDomainObj *obj)
{
qemuDomainObjPrivate *priv = obj->privateData;
@@ -1185,7 +1184,7 @@ qemuDomainObjEndAsyncJob(virQEMUDriver *driver, virDomainObj *obj)
obj, obj->def->name);
qemuDomainObjResetAsyncJob(&priv->job);
- qemuDomainObjSaveStatus(driver, obj);
+ qemuDomainSaveStatus(obj);
virCondBroadcast(&priv->job.asyncCond);
}
diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h
index a078e62a1f..bec6e3a61c 100644
--- a/src/qemu/qemu_domainjob.h
+++ b/src/qemu/qemu_domainjob.h
@@ -208,21 +208,17 @@ int qemuDomainObjBeginJobNowait(virQEMUDriver *driver,
qemuDomainJob job)
G_GNUC_WARN_UNUSED_RESULT;
-void qemuDomainObjEndJob(virQEMUDriver *driver,
- virDomainObj *obj);
+void qemuDomainObjEndJob(virDomainObj *obj);
void qemuDomainObjEndAgentJob(virDomainObj *obj);
-void qemuDomainObjEndAsyncJob(virQEMUDriver *driver,
- virDomainObj *obj);
+void qemuDomainObjEndAsyncJob(virDomainObj *obj);
void qemuDomainObjAbortAsyncJob(virDomainObj *obj);
-void qemuDomainObjSetJobPhase(virQEMUDriver *driver,
- virDomainObj *obj,
+void qemuDomainObjSetJobPhase(virDomainObj *obj,
int phase);
void qemuDomainObjSetAsyncJobMask(virDomainObj *obj,
unsigned long long allowedJobs);
int qemuDomainObjRestoreJob(virDomainObj *obj,
qemuDomainJobObj *job);
-void qemuDomainObjDiscardAsyncJob(virQEMUDriver *driver,
- virDomainObj *obj);
+void qemuDomainObjDiscardAsyncJob(virDomainObj *obj);
void qemuDomainObjReleaseAsyncJob(virDomainObj *obj);
int qemuDomainJobDataUpdateTime(virDomainJobData *jobData)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index de7d2b93b9..b7e83c769a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -208,7 +208,7 @@ qemuAutostartDomain(virDomainObj *vm,
vm->def->name, virGetLastErrorMessage());
}
- qemuProcessEndJob(driver, vm);
+ qemuProcessEndJob(vm);
}
ret = 0;
@@ -1631,7 +1631,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
start_flags) < 0) {
virDomainAuditStart(vm, "booted", false);
qemuDomainRemoveInactive(driver, vm);
- qemuProcessEndJob(driver, vm);
+ qemuProcessEndJob(vm);
goto cleanup;
}
@@ -1652,7 +1652,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
- qemuProcessEndJob(driver, vm);
+ qemuProcessEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -1706,7 +1706,7 @@ static int qemuDomainSuspend(virDomainPtr dom)
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -1762,7 +1762,7 @@ static int qemuDomainResume(virDomainPtr dom)
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -1827,10 +1827,10 @@ qemuDomainShutdownFlagsMonitor(virQEMUDriver *driver,
qemuDomainSetFakeReboot(vm, isReboot);
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemPowerdown(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -1952,10 +1952,10 @@ qemuDomainRebootMonitor(virQEMUDriver *driver,
qemuDomainSetFakeReboot(vm, isReboot);
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemPowerdown(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -2041,7 +2041,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
priv = vm->privateData;
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemReset(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
priv->fakeReboot = false;
@@ -2050,7 +2050,7 @@ qemuDomainReset(virDomainPtr dom, unsigned int flags)
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_CRASHED);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -2121,7 +2121,7 @@ qemuDomainDestroyFlags(virDomainPtr dom,
endjob:
if (ret == 0)
qemuDomainRemoveInactive(driver, vm);
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -2276,7 +2276,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
priv = vm->privateData;
qemuDomainObjEnterMonitor(driver, vm);
r = qemuMonitorSetBalloon(priv->mon, newmem);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (r < 0)
goto endjob;
@@ -2299,7 +2299,7 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -2357,7 +2357,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
qemuDomainObjEnterMonitor(driver, vm);
r = qemuMonitorSetMemoryStatsPeriod(priv->mon, def->memballoon, period);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (r < 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("unable to set balloon driver collection period"));
@@ -2382,7 +2382,7 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -2414,10 +2414,10 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorInjectNMI(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -2473,10 +2473,10 @@ static int qemuDomainSendKey(virDomainPtr domain,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSendKey(priv->mon, holdtime, keycodes, nkeycodes);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -2739,7 +2739,7 @@ qemuDomainSaveInternal(virQEMUDriver *driver,
virErrorRestore(&save_err);
}
}
- qemuDomainObjEndAsyncJob(driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
if (ret == 0)
qemuDomainRemoveInactiveJob(driver, vm);
@@ -3013,14 +3013,14 @@ qemuDumpToFd(virQEMUDriver *driver,
_("unsupported dumpformat '%s' "
"for this QEMU binary"),
dumpformat);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return -1;
}
}
ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat, detach);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
return -1;
@@ -3199,7 +3199,7 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom,
if ((ret == 0) && (flags & VIR_DUMP_RESET)) {
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemReset(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (resume && virDomainObjIsActive(vm)) {
@@ -3216,7 +3216,7 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom,
}
}
- qemuDomainObjEndAsyncJob(driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
if (ret == 0 && flags & VIR_DUMP_CRASH)
qemuDomainRemoveInactiveJob(driver, vm);
@@ -3313,10 +3313,10 @@ qemuDomainScreenshot(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorScreendump(priv->mon, videoAlias, screen, tmp) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto endjob;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (VIR_CLOSE(tmp_fd) < 0) {
virReportSystemError(errno, _("unable to close %s"), tmp);
@@ -3336,7 +3336,7 @@ qemuDomainScreenshot(virDomainPtr dom,
if (unlink_tmp)
unlink(tmp);
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -3412,7 +3412,7 @@ processWatchdogEvent(virQEMUDriver *driver,
}
endjob:
- qemuDomainObjEndAsyncJob(driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
}
static int
@@ -3524,7 +3524,7 @@ processGuestPanicEvent(virQEMUDriver *driver,
}
endjob:
- qemuDomainObjEndAsyncJob(driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
if (removeInactive)
qemuDomainRemoveInactiveJob(driver, vm);
}
@@ -3561,7 +3561,7 @@ processDeviceDeletedEvent(virQEMUDriver *driver,
qemuDomainSaveStatus(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
@@ -3816,7 +3816,7 @@ processNicRxFilterChangedEvent(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorQueryRxFilter(priv->mon, devAlias, &guestFilter);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto endjob;
@@ -3858,7 +3858,7 @@ processNicRxFilterChangedEvent(virQEMUDriver *driver,
}
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virNetDevRxFilterFree(hostFilter);
@@ -3941,7 +3941,7 @@ processSerialChangedEvent(virQEMUDriver *driver,
}
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
@@ -3980,7 +3980,7 @@ processBlockJobEvent(virQEMUDriver *driver,
qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
@@ -4000,7 +4000,7 @@ processJobStatusChangeEvent(virQEMUDriver *driver,
qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
@@ -4046,7 +4046,7 @@ processMonitorEOFEvent(virQEMUDriver *driver,
endjob:
qemuDomainRemoveInactive(driver, vm);
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
@@ -4160,7 +4160,7 @@ processMemoryDeviceSizeChange(virQEMUDriver *driver,
mem->currentsize);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
virObjectEventStateQueue(driver->domainEventState, event);
}
@@ -4369,7 +4369,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom,
if (useAgent)
qemuDomainObjEndAgentJob(vm);
else
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -4525,7 +4525,7 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -4673,7 +4673,7 @@ qemuDomainPinEmulator(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virObjectEventStateQueue(driver->domainEventState, event);
@@ -4856,7 +4856,7 @@ qemuDomainGetIOThreadsMon(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorGetIOThreads(priv->mon, iothreads, niothreads);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -4918,7 +4918,7 @@ qemuDomainGetIOThreadsLive(virQEMUDriver *driver,
ret = niothreads;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
if (info_ret) {
@@ -5083,7 +5083,7 @@ qemuDomainPinIOThread(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virObjectEventStateQueue(driver->domainEventState, event);
@@ -5130,7 +5130,7 @@ qemuDomainHotplugAddIOThread(virQEMUDriver *driver,
if (qemuMonitorGetIOThreads(priv->mon, &new_iothreads, &new_niothreads) < 0)
goto exit_monitor;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (new_niothreads != exp_niothreads) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -5177,7 +5177,7 @@ qemuDomainHotplugAddIOThread(virQEMUDriver *driver,
if (qemuMonitorDelObject(priv->mon, alias, true) < 0)
VIR_WARN("deletion of iothread object %d of domain %s failed when cleanup",
iothread_id, vm->def->name);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
}
@@ -5191,7 +5191,7 @@ qemuDomainHotplugAddIOThread(virQEMUDriver *driver,
return ret;
exit_monitor:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto cleanup;
}
@@ -5214,7 +5214,7 @@ qemuDomainHotplugModIOThread(virQEMUDriver *driver,
rc = qemuMonitorSetIOThread(priv->mon, &iothread);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -5250,7 +5250,7 @@ qemuDomainHotplugDelIOThread(virQEMUDriver *driver,
if (qemuMonitorGetIOThreads(priv->mon, &new_iothreads, &new_niothreads) < 0)
goto exit_monitor;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (new_niothreads != exp_niothreads) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -5279,7 +5279,7 @@ qemuDomainHotplugDelIOThread(virQEMUDriver *driver,
return ret;
exit_monitor:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto cleanup;
}
@@ -5488,7 +5488,7 @@ qemuDomainChgIOThread(virQEMUDriver *driver,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -5832,7 +5832,7 @@ qemuDomainRestoreFlags(virConnectPtr conn,
ret = qemuSaveImageStartVM(conn, driver, vm, &fd, data, path,
false, reset_nvram, QEMU_ASYNC_JOB_START);
- qemuProcessEndJob(driver, vm);
+ qemuProcessEndJob(vm);
cleanup:
VIR_FORCE_CLOSE(fd);
@@ -6420,7 +6420,7 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
ret = 0;
endjob:
- qemuProcessEndJob(driver, vm);
+ qemuProcessEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -6645,7 +6645,7 @@ qemuDomainUndefineFlags(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -7823,7 +7823,7 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -7926,7 +7926,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
}
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
if (dev != dev_copy)
@@ -8108,7 +8108,7 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -8143,7 +8143,7 @@ qemuDomainDetachDeviceAlias(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -8242,7 +8242,7 @@ static int qemuDomainSetAutostart(virDomainPtr dom,
vm->autostart = autostart;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
ret = 0;
@@ -8382,7 +8382,7 @@ qemuDomainSetBlkioParameters(virDomainPtr dom,
}
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -8554,7 +8554,7 @@ qemuDomainSetMemoryParameters(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -8835,7 +8835,7 @@ qemuDomainSetNumaParameters(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -9028,7 +9028,7 @@ qemuDomainSetPerfEvents(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -9090,7 +9090,7 @@ qemuDomainGetPerfEvents(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -9479,7 +9479,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -9793,15 +9793,15 @@ qemuDomainBlockResize(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorBlockResize(priv->mon, device, nodename, size) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto endjob;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -9888,7 +9888,7 @@ qemuDomainBlocksStatsGather(virQEMUDriver *driver,
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, blockstats);
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (nstats < 0 || rc < 0)
return -1;
@@ -9985,7 +9985,7 @@ qemuDomainBlockStats(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -10073,7 +10073,7 @@ qemuDomainBlockStatsFlags(virDomainPtr dom,
*nparams = nstats;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
VIR_FREE(blockstats);
@@ -10376,7 +10376,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -10509,7 +10509,7 @@ qemuDomainMemoryStatsInternal(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorGetMemoryStats(qemuDomainGetMonitor(vm),
vm->def->memballoon, stats, nr_stats);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0 || ret >= nr_stats)
return ret;
@@ -10552,7 +10552,7 @@ qemuDomainMemoryStats(virDomainPtr dom,
ret = qemuDomainMemoryStatsInternal(driver, vm, stats, nr_stats);
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -10677,16 +10677,16 @@ qemuDomainMemoryPeek(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
if (flags == VIR_MEMORY_VIRTUAL) {
if (qemuMonitorSaveVirtualMemory(priv->mon, offset, size, tmp) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto endjob;
}
} else {
if (qemuMonitorSavePhysicalMemory(priv->mon, offset, size, tmp) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto endjob;
}
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
/* Read the memory file into buffer. */
if (saferead(fd, buffer, size) == (ssize_t)-1) {
@@ -10699,7 +10699,7 @@ qemuDomainMemoryPeek(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
VIR_FORCE_CLOSE(fd);
@@ -11012,7 +11012,7 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
VIR_FREE(entry);
virDomainObjEndAPI(&vm);
@@ -12461,7 +12461,7 @@ qemuDomainGetJobInfoDumpStats(virQEMUDriver *driver,
rc = qemuMonitorQueryDump(priv->mon, &stats);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -12563,7 +12563,7 @@ qemuDomainGetJobStatsInternal(virQEMUDriver *driver,
ret = 0;
cleanup:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -12660,7 +12660,7 @@ qemuDomainAbortJobMigration(virDomainObj *vm)
qemuDomainObjAbortAsyncJob(vm);
qemuDomainObjEnterMonitor(priv->driver, vm);
ret = qemuMonitorMigrateCancel(priv->mon);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -12748,7 +12748,7 @@ static int qemuDomainAbortJob(virDomainPtr dom)
}
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -12801,7 +12801,7 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
} else {
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSetMigrationDowntime(priv->mon, downtime);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
}
@@ -12809,7 +12809,7 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -12862,7 +12862,7 @@ qemuDomainMigrateGetMaxDowntime(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -12917,7 +12917,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
} else {
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
}
@@ -12925,7 +12925,7 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -12983,7 +12983,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
} else {
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSetMigrationCacheSize(priv->mon, cacheSize);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
}
@@ -12991,7 +12991,7 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -13072,7 +13072,7 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSetMigrationSpeed(priv->mon, bandwidth);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
}
@@ -13083,7 +13083,7 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -13138,7 +13138,7 @@ qemuDomainMigrationGetPostcopyBandwidth(virQEMUDriver *driver,
ret = 0;
cleanup:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -13221,10 +13221,10 @@ qemuDomainMigrateStartPostCopy(virDomainPtr dom,
VIR_DEBUG("Starting post-copy");
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorMigrateStartPostCopy(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -13955,10 +13955,10 @@ qemuDomainQemuMonitorCommandWithFiles(virDomainPtr domain,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorArbitraryCommand(priv->mon, cmd, fd, result, hmp);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -14240,7 +14240,7 @@ qemuDomainBlockPivot(virQEMUDriver *driver,
} else {
ret = qemuMonitorDrivePivot(priv->mon, job->name);
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
/* The pivot failed. The block job in QEMU remains in the synchronised state */
if (ret < 0)
@@ -14371,7 +14371,7 @@ qemuDomainBlockPullCommon(virDomainObj *vm,
(!baseSource || basePath))
ret = qemuMonitorBlockStream(priv->mon, device, jobname, persistjob, basePath,
nodebase, backingPath, speed);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto endjob;
@@ -14379,7 +14379,7 @@ qemuDomainBlockPullCommon(virDomainObj *vm,
qemuBlockJobStarted(job, vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
qemuBlockJobStartupFinalize(vm, job);
@@ -14445,7 +14445,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
} else {
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorBlockJobCancel(priv->mon, job->name, false);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto endjob;
@@ -14487,7 +14487,7 @@ qemuDomainBlockJobAbort(virDomainPtr dom,
endjob:
if (job && !async)
qemuBlockJobSyncEnd(vm, job, QEMU_ASYNC_JOB_NONE);
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -14589,7 +14589,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
blockjobstats = qemuMonitorGetAllBlockJobInfo(qemuDomainGetMonitor(vm), true);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (!blockjobstats)
goto endjob;
@@ -14603,7 +14603,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
ret = 1;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -14662,10 +14662,10 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom,
ret = qemuMonitorBlockJobSetSpeed(qemuDomainGetMonitor(vm),
job->name,
speed);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -15061,7 +15061,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
if (data) {
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuBlockStorageSourceChainAttach(priv->mon, data);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
@@ -15096,7 +15096,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
}
virDomainAuditDisk(vm, NULL, mirror, "mirror", ret >= 0);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0) {
qemuDomainStorageSourceChainAccessRevoke(driver, vm, mirror);
goto endjob;
@@ -15118,7 +15118,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
qemuBlockStorageSourceChainDetach(priv->mon, data);
if (crdata)
qemuBlockStorageSourceAttachRollback(priv->mon, crdata->srcdata[0]);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (need_revoke)
qemuDomainStorageSourceChainAccessRevoke(driver, vm, mirror);
@@ -15126,7 +15126,7 @@ qemuDomainBlockCopyCommon(virDomainObj *vm,
if (need_unlink && virStorageSourceUnlink(mirror) < 0)
VIR_WARN("%s", _("unable to remove just-created copy target"));
virStorageSourceDeinit(mirror);
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
qemuBlockJobStartupFinalize(vm, job);
return ret;
@@ -15534,7 +15534,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
topPath, nodetop, basePath, nodebase,
backingPath, speed);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto endjob;
@@ -15559,7 +15559,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
virErrorRestore(&orig_err);
}
qemuBlockJobStartupFinalize(vm, job);
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -15627,10 +15627,10 @@ qemuDomainOpenGraphics(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorOpenGraphics(priv->mon, protocol, fd, "graphicsfd",
(flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) != 0);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -15703,8 +15703,8 @@ qemuDomainOpenGraphicsFD(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorOpenGraphics(priv->mon, protocol, pair[1], "graphicsfd",
(flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH));
- qemuDomainObjExitMonitor(driver, vm);
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjExitMonitor(vm);
+ qemuDomainObjEndJob(vm);
if (ret < 0)
goto cleanup;
@@ -16139,7 +16139,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSetBlockIoThrottle(priv->mon, drivealias, qdevid, &info);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
@@ -16189,7 +16189,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
VIR_FREE(info.group_name);
@@ -16271,7 +16271,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
}
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorGetBlockIoThrottle(priv->mon, drivealias, qdevid, &reply);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
@@ -16344,7 +16344,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
VIR_FREE(reply.group_name);
@@ -16391,7 +16391,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
table = qemuMonitorGetBlockInfo(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (!table)
goto endjob;
@@ -16418,7 +16418,7 @@ qemuDomainGetDiskErrors(virDomainPtr dom,
ret = n;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -16466,7 +16466,7 @@ qemuDomainSetMetadata(virDomainPtr dom,
virObjectEventStateQueue(driver->domainEventState, ev);
}
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -16555,7 +16555,7 @@ qemuDomainProbeQMPCurrentMachine(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
rv = qemuMonitorGetCurrentMachineInfo(priv->mon, &info);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rv < 0)
return -1;
@@ -16585,7 +16585,7 @@ qemuDomainQueryWakeupSuspendSupport(virQEMUDriver *driver,
ret = qemuDomainProbeQMPCurrentMachine(driver, vm, wakeupSupported);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -16720,10 +16720,10 @@ qemuDomainPMWakeup(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemWakeup(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -17106,7 +17106,7 @@ qemuDomainGetHostnameLease(virQEMUDriver *driver,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -17280,7 +17280,7 @@ qemuDomainSetTime(virDomainPtr dom,
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_RTC_RESET_REINJECTION)) {
qemuDomainObjEnterMonitor(driver, vm);
rv = qemuMonitorRTCResetReinjection(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rv < 0)
goto endjob;
@@ -17289,7 +17289,7 @@ qemuDomainSetTime(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -18412,7 +18412,7 @@ qemuDomainGetStatsBlock(virQEMUDriver *driver,
if (fetchnodedata)
nodedata = qemuMonitorQueryNamedBlockNodes(priv->mon);
- qemuDomainObjExitMonitor(driver, dom);
+ qemuDomainObjExitMonitor(dom);
/* failure to retrieve stats is fine at this point */
if (rc < 0 || (fetchnodedata && !nodedata))
@@ -18546,7 +18546,7 @@ qemuDomainGetStatsDirtyRateMon(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorQueryDirtyRate(priv->mon, info);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -18814,7 +18814,7 @@ qemuConnectGetAllDomainStats(virConnectPtr conn,
rc = qemuDomainGetStats(conn, vm, requestedStats, &tmp, domflags);
if (HAVE_JOB(domflags))
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
virObjectUnlock(vm);
@@ -18995,7 +18995,7 @@ qemuDomainGetFSInfo(virDomainPtr dom,
ret = virDomainFSInfoFormat(agentinfo, nfs, vm->def, info);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
if (agentinfo) {
@@ -19311,7 +19311,7 @@ static int qemuDomainRename(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -19571,7 +19571,7 @@ qemuDomainSetVcpu(virDomainPtr dom,
ret = qemuDomainSetVcpuInternal(driver, vm, def, persistentDef, map, !!state);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -19640,7 +19640,7 @@ qemuDomainSetBlockThreshold(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSetBlockThreshold(priv->mon, nodename, threshold);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
@@ -19651,7 +19651,7 @@ qemuDomainSetBlockThreshold(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -19756,7 +19756,7 @@ qemuDomainModifyLifecycleActionLive(virDomainObj *vm,
QEMU_MONITOR_ACTION_WATCHDOG_KEEP,
QEMU_MONITOR_ACTION_PANIC_KEEP);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -19834,7 +19834,7 @@ qemuDomainSetLifecycleAction(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -19954,13 +19954,13 @@ qemuDomainGetSEVInfo(virQEMUDriver *driver,
if (!tmp) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto endjob;
}
rv = qemuMonitorGetSEVInfo(QEMU_DOMAIN_PRIVATE(vm)->mon,
&apiMajor, &apiMinor, &buildID, &policy);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rv < 0)
goto endjob;
@@ -19989,7 +19989,7 @@ qemuDomainGetSEVInfo(virQEMUDriver *driver,
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
@@ -20109,14 +20109,14 @@ qemuDomainSetLaunchSecurityState(virDomainPtr domain,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSetLaunchSecurityState(QEMU_DOMAIN_PRIVATE(vm)->mon,
secrethdr, secret, setaddr, hasSetaddr);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -20509,7 +20509,7 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
qemuAgentDiskInfoFormatParams(agentdiskinfo, ndisks, vm->def, params, nparams, &maxparams);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
}
if (nifaces > 0) {
@@ -20772,10 +20772,10 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorStartDirtyRateCalc(priv->mon, seconds, mode);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index c70bc361fd..8ea95406c7 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -110,7 +110,7 @@ qemuDomainDeleteDevice(virDomainObj *vm,
rc = qemuMonitorDelDevice(priv->mon, alias);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0) {
/* Deleting device failed. Let's check if DEVICE_DELETED
@@ -313,7 +313,7 @@ qemuDomainChangeMediaLegacy(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorEjectMedia(priv->mon, driveAlias, force);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
/* If the tray is present wait for it to open. */
if (!force && diskPriv->tray) {
@@ -324,7 +324,7 @@ qemuDomainChangeMediaLegacy(virQEMUDriver *driver,
/* re-issue ejection command to pop out the media */
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorEjectMedia(priv->mon, driveAlias, false);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -346,7 +346,7 @@ qemuDomainChangeMediaLegacy(virQEMUDriver *driver,
driveAlias,
sourcestr,
format);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (rc < 0)
@@ -394,7 +394,7 @@ qemuHotplugAttachDBusVMState(virQEMUDriver *driver,
if (ret == 0)
priv->dbusVMState = true;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -430,7 +430,7 @@ qemuHotplugRemoveDBusVMState(virQEMUDriver *driver,
if (ret == 0)
priv->dbusVMState = false;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -477,7 +477,7 @@ qemuHotplugAttachManagedPR(virQEMUDriver *driver,
rc = qemuMonitorAddObject(priv->mon, &props, NULL);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -517,7 +517,7 @@ qemuHotplugRemoveManagedPR(virQEMUDriver *driver,
goto cleanup;
ignore_value(qemuMonitorDelObject(priv->mon, qemuDomainGetManagedPRAlias(),
false));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
qemuProcessKillManagedPRDaemon(vm);
@@ -574,7 +574,7 @@ qemuDomainChangeMediaBlockdev(virQEMUDriver *driver,
if (diskPriv->tray && disk->tray_status != VIR_DOMAIN_DISK_TRAY_OPEN) {
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorBlockdevTrayOpen(priv->mon, diskPriv->qomName, force);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -613,7 +613,7 @@ qemuDomainChangeMediaBlockdev(virQEMUDriver *driver,
if (rc < 0 && newbackend)
qemuBlockStorageSourceChainDetach(priv->mon, newbackend);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -782,7 +782,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver,
rc = qemuBlockStorageSourceChainAttach(priv->mon, data);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto rollback;
@@ -832,7 +832,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver,
VIR_WARN("failed to set blkdeviotune for '%s' of '%s'", disk->dst, vm->def->name);
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto rollback;
@@ -848,7 +848,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriver *driver,
qemuBlockStorageSourceChainDetach(priv->mon, data);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return -1;
}
@@ -912,7 +912,7 @@ int qemuDomainAttachControllerDevice(virQEMUDriver *driver,
ignore_value(qemuDomainDetachExtensionDevice(priv->mon, &controller->info));
exit_monitor:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret == 0)
virDomainControllerInsertPreAlloced(vm->def, controller);
@@ -1461,7 +1461,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
if (qemuMonitorAddFileHandleToSet(priv->mon, vdpafd, -1,
net->data.vdpa.devicepath,
&fdinfo) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto cleanup;
}
vdpafdName = g_strdup_printf("/dev/fdset/%d", fdinfo.fdset);
@@ -1471,13 +1471,13 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
tapfdName, tapfdSize,
vhostfdName, vhostfdSize,
slirpfdName, vdpafdName))) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto cleanup;
}
if (actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (qemuHotplugChardevAttach(priv->mon, charDevAlias, net->data.vhostuser) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto cleanup;
}
@@ -1488,13 +1488,13 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
tapfd, tapfdName, tapfdSize,
vhostfd, vhostfdName, vhostfdSize,
slirpfd, slirpfdName) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto try_remove;
}
netdevPlugged = true;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
for (i = 0; i < tapfdSize; i++)
VIR_FORCE_CLOSE(tapfd[i]);
@@ -1507,18 +1507,18 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
if (qemuDomainAttachExtensionDevice(priv->mon, &net->info) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto try_remove;
}
if (qemuMonitorAddDeviceProps(priv->mon, &nicprops) < 0) {
ignore_value(qemuDomainDetachExtensionDevice(priv->mon, &net->info));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto try_remove;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
/* set link state */
if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
@@ -1529,12 +1529,12 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorSetLink(priv->mon, net->info.alias, VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
goto try_remove;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
/* link set to down */
}
@@ -1628,7 +1628,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
qemuMonitorRemoveNetdev(priv->mon, netdev_name) < 0)
VIR_WARN("Failed to remove network backend for netdev %s",
netdev_name);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virErrorRestore(&originalError);
goto cleanup;
}
@@ -1739,7 +1739,7 @@ qemuDomainAttachHostPCIDevice(virQEMUDriver *driver,
ignore_value(qemuDomainDetachExtensionDevice(priv->mon, hostdev->info));
exit_monitor:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
done:
virDomainAuditHostdev(vm, hostdev, "attach", ret == 0);
@@ -1795,7 +1795,7 @@ qemuDomainDelTLSObjects(virQEMUDriver *driver,
if (secAlias)
ignore_value(qemuMonitorDelObject(priv->mon, secAlias, false));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
cleanup:
virErrorRestore(&orig_err);
@@ -1827,12 +1827,12 @@ qemuDomainAddTLSObjects(virQEMUDriver *driver,
qemuMonitorAddObject(priv->mon, tlsProps, NULL) < 0)
goto error;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return 0;
error:
virErrorPreserveLast(&orig_err);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virErrorRestore(&orig_err);
qemuDomainDelTLSObjects(driver, vm, asyncJob, secAlias, NULL);
@@ -1948,7 +1948,7 @@ qemuDomainDelChardevTLSObjects(virQEMUDriver *driver,
if (secAlias)
ignore_value(qemuMonitorDelObject(priv->mon, secAlias, false));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return 0;
}
@@ -1995,7 +1995,7 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriver *driver,
if (qemuMonitorAddDeviceProps(priv->mon, &devprops) < 0)
goto exit_monitor;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
def->redirdevs[def->nredirdevs++] = redirdev;
ret = 0;
@@ -2011,7 +2011,7 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriver *driver,
/* detach associated chardev on error */
if (chardevAdded)
ignore_value(qemuMonitorDetachCharDev(priv->mon, charAlias));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virErrorRestore(&orig_err);
qemuDomainDelTLSObjects(driver, vm, QEMU_ASYNC_JOB_NONE,
secAlias, tlsAlias);
@@ -2238,7 +2238,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver,
qemuFDPassTransferMonitor(charpriv->logfd, priv->mon) < 0)
goto exit_monitor;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (guestfwd) {
@@ -2277,7 +2277,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver,
goto exit_monitor;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
qemuDomainChrInsertPreAlloced(vmdef, chr);
ret = 0;
@@ -2305,7 +2305,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver,
qemuMonitorDetachCharDev(priv->mon, charAlias);
qemuFDPassTransferMonitorRollback(charpriv->sourcefd, priv->mon);
qemuFDPassTransferMonitorRollback(charpriv->logfd, priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virErrorRestore(&orig_err);
qemuDomainDelTLSObjects(driver, vm, QEMU_ASYNC_JOB_NONE,
@@ -2385,7 +2385,7 @@ qemuDomainAttachRNGDevice(virQEMUDriver *driver,
goto exit_monitor;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
VIR_APPEND_ELEMENT_INPLACE(vm->def->rngs, vm->def->nrngs, rng);
@@ -2411,7 +2411,7 @@ qemuDomainAttachRNGDevice(virQEMUDriver *driver,
ignore_value(qemuMonitorDelObject(priv->mon, objAlias, false));
if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD && chardevAdded)
ignore_value(qemuMonitorDetachCharDev(priv->mon, charAlias));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virErrorRestore(&orig_err);
qemuDomainDelTLSObjects(driver, vm, QEMU_ASYNC_JOB_NONE,
@@ -2504,7 +2504,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
if (qemuMonitorAddDeviceProps(priv->mon, &devprops) < 0)
goto exit_monitor;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
event = virDomainEventDeviceAddedNewFromObj(vm, objalias);
virObjectEventStateQueue(driver->domainEventState, event);
@@ -2543,7 +2543,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
virErrorPreserveLast(&orig_err);
if (objAdded)
ignore_value(qemuMonitorDelObject(priv->mon, objalias, false));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (objAdded && mem)
ignore_value(qemuProcessDestroyMemoryBackingPath(driver, vm, mem));
@@ -2608,7 +2608,7 @@ qemuDomainAttachHostUSBDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorAddDeviceProps(priv->mon, &devprops);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditHostdev(vm, hostdev, "attach", ret == 0);
if (ret < 0)
goto cleanup;
@@ -2701,7 +2701,7 @@ qemuDomainAttachHostSCSIDevice(virQEMUDriver *driver,
if (qemuMonitorAddDeviceProps(priv->mon, &devprops) < 0)
goto exit_monitor;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditHostdev(vm, hostdev, "attach", true);
@@ -2727,7 +2727,7 @@ qemuDomainAttachHostSCSIDevice(virQEMUDriver *driver,
exit_monitor:
virErrorPreserveLast(&orig_err);
qemuBlockStorageSourceAttachRollback(priv->mon, data);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virErrorRestore(&orig_err);
virDomainAuditHostdev(vm, hostdev, "attach", false);
@@ -2826,7 +2826,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriver *driver,
ignore_value(qemuMonitorCloseFileHandle(priv->mon, vhostfdName));
if (removeextension)
ignore_value(qemuDomainDetachExtensionDevice(priv->mon, hostdev->info));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto audit;
@@ -2920,7 +2920,7 @@ qemuDomainAttachMediatedDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorAddDeviceProps(priv->mon, &devprops);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditHostdev(vm, hostdev, "attach", ret == 0);
if (ret < 0)
@@ -3074,7 +3074,7 @@ qemuDomainAttachShmemDevice(virQEMUDriver *driver,
goto exit_monitor;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
/* Doing a copy here just so the pointer doesn't get nullified
* because we need it in the audit function */
@@ -3101,7 +3101,7 @@ qemuDomainAttachShmemDevice(virQEMUDriver *driver,
ignore_value(qemuMonitorDelObject(priv->mon, memAlias, false));
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virErrorRestore(&orig_err);
@@ -3200,7 +3200,7 @@ qemuDomainAttachWatchdog(virQEMUDriver *driver,
if (rv >= 0)
rv = qemuMonitorAddDeviceProps(priv->mon, &props);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rv < 0)
goto cleanup;
@@ -3287,7 +3287,7 @@ qemuDomainAttachInputDevice(virQEMUDriver *driver,
goto exit_monitor;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
VIR_APPEND_ELEMENT_COPY_INPLACE(vm->def->inputs, vm->def->ninputs, input);
@@ -3313,7 +3313,7 @@ qemuDomainAttachInputDevice(virQEMUDriver *driver,
return ret;
exit_monitor:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto audit;
}
@@ -3370,7 +3370,7 @@ qemuDomainAttachVsockDevice(virQEMUDriver *driver,
if ((ret = qemuMonitorAddDeviceProps(priv->mon, &devprops)) < 0)
goto exit_monitor;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
vm->def->vsock = g_steal_pointer(&vsock);
@@ -3391,7 +3391,7 @@ qemuDomainAttachVsockDevice(virQEMUDriver *driver,
ignore_value(qemuMonitorCloseFileHandle(priv->mon, fdname));
if (removeextension)
ignore_value(qemuDomainDetachExtensionDevice(priv->mon, &vsock->info));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto cleanup;
}
@@ -3459,7 +3459,7 @@ qemuDomainAttachFSDevice(virQEMUDriver *driver,
goto exit_monitor;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
VIR_APPEND_ELEMENT_COPY(vm->def->fss, vm->def->nfss, fs);
@@ -3483,7 +3483,7 @@ qemuDomainAttachFSDevice(virQEMUDriver *driver,
virErrorPreserveLast(&origErr);
if (chardevAdded)
ignore_value(qemuMonitorDetachCharDev(priv->mon, charAlias));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virErrorRestore(&origErr);
goto audit;
}
@@ -3652,7 +3652,7 @@ int qemuDomainChangeNetLinkState(virQEMUDriver *driver,
dev->linkstate = linkstate;
cleanup:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -4246,7 +4246,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriver *driver,
ret = qemuMonitorExpirePassword(priv->mon, type, expire);
end_job:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -4521,7 +4521,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriver *driver,
if (diskBackend)
qemuBlockStorageSourceChainDetach(priv->mon, diskBackend);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditDisk(vm, disk->src, NULL, "detach", true);
@@ -4593,7 +4593,7 @@ qemuDomainRemoveMemoryDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorDelObject(priv->mon, backendAlias, true);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditMemory(vm, oldmem, newmem, "update", rc == 0);
if (rc < 0)
@@ -4692,7 +4692,7 @@ qemuDomainRemoveHostDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
qemuBlockStorageSourceAttachRollback(priv->mon, detachscsi);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (hostdev->parentnet) {
@@ -4809,7 +4809,7 @@ qemuDomainRemoveNetDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
if (qemuMonitorRemoveNetdev(priv->mon, hostnet_name) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditNet(vm, net, NULL, "detach", false);
return -1;
}
@@ -4826,7 +4826,7 @@ qemuDomainRemoveNetDevice(virQEMUDriver *driver,
qemuHotplugRemoveFDSet(priv->mon, net->info.alias, net->data.vdpa.devicepath);
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp)
qemuSlirpStop(QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp, vm, driver, net);
@@ -4901,7 +4901,7 @@ qemuDomainRemoveChrDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorDetachCharDev(priv->mon, charAlias);
qemuHotplugRemoveFDSet(priv->mon, chr->info.alias, NULL);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (rc == 0 &&
@@ -4967,7 +4967,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriver *driver,
qemuMonitorDetachCharDev(priv->mon, charAlias) < 0)
rc = -1;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD &&
rc == 0 &&
@@ -5021,7 +5021,7 @@ qemuDomainRemoveShmemDevice(virQEMUDriver *driver,
else
rc = qemuMonitorDelObject(priv->mon, memAlias, true);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditShmem(vm, shmem, "detach", rc == 0);
@@ -5113,7 +5113,7 @@ qemuDomainRemoveRedirdevDevice(virQEMUDriver *driver,
*/
ignore_value(qemuMonitorDetachCharDev(priv->mon, charAlias));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (qemuDomainDelChardevTLSObjects(driver, vm, dev->source, charAlias) < 0)
return -1;
@@ -5150,7 +5150,7 @@ qemuDomainRemoveFSDevice(virQEMUDriver *driver,
if (qemuMonitorDetachCharDev(priv->mon, charAlias) < 0)
rc = -1;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
virDomainAuditFS(vm, fs, NULL, "detach", rc == 0);
@@ -5891,7 +5891,7 @@ qemuDomainDetachDeviceChr(virQEMUDriver *driver,
int rc;
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorRemoveNetdev(priv->mon, tmpChr->info.alias);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -6431,7 +6431,7 @@ qemuDomainHotplugAddVcpu(virQEMUDriver *driver,
rc = qemuMonitorAddDeviceProps(qemuDomainGetMonitor(vm), &vcpuprops);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virDomainAuditVcpu(vm, oldvcpus, oldvcpus + nvcpus, "update", rc == 0);
@@ -6913,7 +6913,7 @@ qemuDomainChangeMemoryRequestedSize(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorChangeMemoryRequestedSize(priv->mon, alias, requestedsize);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return rc;
}
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 69bcdafdf8..f109598fb4 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -89,16 +89,14 @@ qemuMigrationJobStart(virQEMUDriver *driver,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT;
static void
-qemuMigrationJobSetPhase(virQEMUDriver *driver,
- virDomainObj *vm,
+qemuMigrationJobSetPhase(virDomainObj *vm,
qemuMigrationJobPhase phase)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ ATTRIBUTE_NONNULL(1);
static void
-qemuMigrationJobStartPhase(virQEMUDriver *driver,
- virDomainObj *vm,
+qemuMigrationJobStartPhase(virDomainObj *vm,
qemuMigrationJobPhase phase)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+ ATTRIBUTE_NONNULL(1);
static void
qemuMigrationJobContinue(virDomainObj *obj)
@@ -110,9 +108,8 @@ qemuMigrationJobIsActive(virDomainObj *vm,
ATTRIBUTE_NONNULL(1);
static void
-qemuMigrationJobFinish(virQEMUDriver *driver,
- virDomainObj *obj)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+qemuMigrationJobFinish(virDomainObj *obj)
+ ATTRIBUTE_NONNULL(1);
static void
qemuMigrationSrcStoreDomainState(virDomainObj *vm)
@@ -515,7 +512,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
if (qemuBlockExportAddNBD(vm, diskAlias, disk->src, diskAlias, true, NULL) < 0)
goto exit_monitor;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (server.transport == VIR_STORAGE_NET_HOST_TRANS_TCP)
@@ -529,7 +526,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
return ret;
exit_monitor:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto cleanup;
}
@@ -550,7 +547,7 @@ qemuMigrationDstStopNBDServer(virQEMUDriver *driver,
if (qemuMonitorNBDServerStop(priv->mon) < 0)
VIR_WARN("Unable to stop NBD server");
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
virPortAllocatorRelease(priv->nbdPort);
priv->nbdPort = 0;
@@ -750,7 +747,7 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriver *driver,
* consistency on the destination so that we can force cancel the mirror */
rv = qemuMonitorBlockJobCancel(priv->mon, job->name, abortMigration);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rv < 0)
return -1;
@@ -871,7 +868,7 @@ qemuMigrationSrcCancelRemoveTempBitmaps(virDomainObj *vm,
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
return -1;
qemuMonitorBitmapRemove(priv->mon, t->nodename, t->bitmapname);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
return 0;
@@ -969,7 +966,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriver *driver,
if (mon_ret != 0)
qemuBlockStorageSourceAttachRollback(qemuDomainGetMonitor(vm), data);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (mon_ret < 0)
return -1;
@@ -1011,7 +1008,7 @@ qemuMigrationSrcNBDStorageCopyDriveMirror(virQEMUDriver *driver,
diskAlias, nbd_dest, "raw",
mirror_speed, 0, 0, mirror_shallow, true);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (mon_ret < 0)
return -1;
@@ -1690,7 +1687,7 @@ qemuMigrationAnyFetchStats(virQEMUDriver *driver,
rv = qemuMonitorGetMigrationStats(priv->mon, &stats, error);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rv < 0)
return -1;
@@ -2055,7 +2052,7 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriver *driver,
ret = qemuMonitorGraphicsRelocate(priv->mon, type, listenAddress,
port, tlsPort, tlsSubject);
jobPriv->spiceMigration = !ret;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
cleanup:
@@ -2159,7 +2156,7 @@ qemuMigrationDstRun(virQEMUDriver *driver,
rv = qemuMonitorMigrateIncoming(priv->mon, uri);
exit_monitor:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rv < 0)
return -1;
@@ -2206,7 +2203,7 @@ qemuMigrationSrcCleanup(virDomainObj *vm,
switch ((qemuMigrationJobPhase) priv->job.phase) {
case QEMU_MIGRATION_PHASE_BEGIN3:
/* just forget we were about to migrate */
- qemuMigrationJobFinish(driver, vm);
+ qemuMigrationJobFinish(vm);
break;
case QEMU_MIGRATION_PHASE_PERFORM3_DONE:
@@ -2216,7 +2213,7 @@ qemuMigrationSrcCleanup(virDomainObj *vm,
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
jobPriv->migParams, priv->job.apiFlags);
/* clear the job and let higher levels decide what to do */
- qemuMigrationJobFinish(driver, vm);
+ qemuMigrationJobFinish(vm);
break;
case QEMU_MIGRATION_PHASE_PERFORM3:
@@ -2352,7 +2349,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
* change protection.
*/
if (priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT)
- qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_BEGIN3);
+ qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_BEGIN3);
if (!qemuMigrationSrcIsAllowed(driver, vm, true, flags))
return NULL;
@@ -2567,9 +2564,9 @@ qemuMigrationSrcBegin(virConnectPtr conn,
endjob:
if (flags & VIR_MIGRATE_CHANGE_PROTECTION)
- qemuMigrationJobFinish(driver, vm);
+ qemuMigrationJobFinish(vm);
else
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
goto cleanup;
}
@@ -2594,7 +2591,7 @@ qemuMigrationDstPrepareCleanup(virQEMUDriver *driver,
if (!qemuMigrationJobIsActive(vm, QEMU_ASYNC_JOB_MIGRATION_IN))
return;
- qemuDomainObjDiscardAsyncJob(driver, vm);
+ qemuDomainObjDiscardAsyncJob(vm);
}
static qemuProcessIncomingDef *
@@ -2931,7 +2928,7 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
flags) < 0)
goto cleanup;
- qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PREPARE);
+ qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PREPARE);
/* Domain starts inactive, even if the domain XML had an id field. */
vm->def->id = -1;
@@ -3125,7 +3122,7 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
QEMU_ASYNC_JOB_MIGRATION_IN, stopFlags);
}
- qemuMigrationJobFinish(driver, vm);
+ qemuMigrationJobFinish(vm);
goto cleanup;
}
@@ -3401,7 +3398,7 @@ qemuMigrationSrcConfirmPhase(virQEMUDriver *driver,
virCheckFlags(QEMU_MIGRATION_FLAGS, -1);
- qemuMigrationJobSetPhase(driver, vm,
+ qemuMigrationJobSetPhase(vm,
retcode == 0
? QEMU_MIGRATION_PHASE_CONFIRM3
: QEMU_MIGRATION_PHASE_CONFIRM3_CANCELLED);
@@ -3507,7 +3504,7 @@ qemuMigrationSrcConfirm(virQEMUDriver *driver,
else
phase = QEMU_MIGRATION_PHASE_CONFIRM3;
- qemuMigrationJobStartPhase(driver, vm, phase);
+ qemuMigrationJobStartPhase(vm, phase);
virCloseCallbacksUnset(driver->closeCallbacks, vm,
qemuMigrationSrcCleanup);
@@ -3515,7 +3512,7 @@ qemuMigrationSrcConfirm(virQEMUDriver *driver,
cookiein, cookieinlen,
flags, cancelled);
- qemuMigrationJobFinish(driver, vm);
+ qemuMigrationJobFinish(vm);
if (!virDomainObjIsActive(vm)) {
if (!cancelled && ret == 0 && flags & VIR_MIGRATE_UNDEFINE_SOURCE) {
virDomainDeleteConfig(cfg->configDir, cfg->autostartDir, vm);
@@ -3829,7 +3826,7 @@ qemuMigrationSrcContinue(virQEMUDriver *driver,
ret = qemuMonitorMigrateContinue(priv->mon, status);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -3852,7 +3849,7 @@ qemuMigrationSetDBusVMState(virQEMUDriver *driver,
rv = qemuMonitorSetDBusVMStateIdList(priv->mon, priv->dbusVMStateIds);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return rv;
} else {
@@ -3952,7 +3949,7 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(virDomainObj *vm,
rc = qemuMonitorTransaction(priv->mon, &actions);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -4261,7 +4258,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
break;
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto error;
@@ -4383,7 +4380,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
qemuDomainObjEnterMonitorAsync(driver, vm,
QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
qemuMonitorMigrateCancel(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
/* cancel any outstanding NBD jobs */
@@ -4404,7 +4401,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
goto cleanup;
exit_monitor:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto error;
}
@@ -4657,7 +4654,7 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver,
* until the migration is complete.
*/
VIR_DEBUG("Perform %p", sconn);
- qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM2);
+ qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM2);
if (flags & VIR_MIGRATE_TUNNELLED)
ret = qemuMigrationSrcPerformTunnel(driver, vm, st, NULL,
NULL, 0, NULL, NULL,
@@ -4901,7 +4898,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
* confirm migration completion.
*/
VIR_DEBUG("Perform3 %p uri=%s", sconn, NULLSTR(uri));
- qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM3);
+ qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM3);
VIR_FREE(cookiein);
cookiein = g_steal_pointer(&cookieout);
cookieinlen = cookieoutlen;
@@ -4926,8 +4923,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
if (ret < 0) {
virErrorPreserveLast(&orig_err);
} else {
- qemuMigrationJobSetPhase(driver, vm,
- QEMU_MIGRATION_PHASE_PERFORM3_DONE);
+ qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM3_DONE);
}
/* If Perform returns < 0, then we need to cancel the VM
@@ -5303,7 +5299,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
migParams, flags, dname, resource,
&v3proto);
} else {
- qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM2);
+ qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM2);
ret = qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri, cookiein, cookieinlen,
cookieout, cookieoutlen,
flags, resource, NULL, NULL, 0, NULL,
@@ -5339,7 +5335,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
qemuMigrationSrcRestoreDomainState(driver, vm);
- qemuMigrationJobFinish(driver, vm);
+ qemuMigrationJobFinish(vm);
if (!virDomainObjIsActive(vm) && ret == 0) {
if (flags & VIR_MIGRATE_UNDEFINE_SOURCE) {
virDomainDeleteConfig(cfg->configDir, cfg->autostartDir, vm);
@@ -5389,7 +5385,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver,
return ret;
}
- qemuMigrationJobStartPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM3);
+ qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFORM3);
virCloseCallbacksUnset(driver->closeCallbacks, vm,
qemuMigrationSrcCleanup);
@@ -5403,7 +5399,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver,
goto endjob;
}
- qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM3_DONE);
+ qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM3_DONE);
if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn,
qemuMigrationSrcCleanup) < 0)
@@ -5413,7 +5409,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver,
if (ret < 0) {
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
jobPriv->migParams, priv->job.apiFlags);
- qemuMigrationJobFinish(driver, vm);
+ qemuMigrationJobFinish(vm);
} else {
qemuMigrationJobContinue(vm);
}
@@ -5648,7 +5644,7 @@ qemuMigrationDstFinish(virQEMUDriver *driver,
ignore_value(virTimeMillisNow(&timeReceived));
- qemuMigrationJobStartPhase(driver, vm,
+ qemuMigrationJobStartPhase(vm,
v3proto ? QEMU_MIGRATION_PHASE_FINISH3
: QEMU_MIGRATION_PHASE_FINISH2);
@@ -5878,7 +5874,7 @@ qemuMigrationDstFinish(virQEMUDriver *driver,
qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN,
jobPriv->migParams, priv->job.apiFlags);
- qemuMigrationJobFinish(driver, vm);
+ qemuMigrationJobFinish(vm);
if (!virDomainObjIsActive(vm))
qemuDomainRemoveInactiveJob(driver, vm);
@@ -5940,7 +5936,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDomainObj *vm,
qemuMonitorSetMigrationSpeed(priv->mon,
QEMU_DOMAIN_MIG_BANDWIDTH_MAX);
priv->migMaxBandwidth = QEMU_DOMAIN_MIG_BANDWIDTH_MAX;
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
}
@@ -5977,11 +5973,11 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDomainObj *vm,
if (virSetCloseExec(pipeFD[1]) < 0) {
virReportSystemError(errno, "%s",
_("Unable to set cloexec flag"));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto cleanup;
}
if (virCommandRunAsync(compressor, NULL) < 0) {
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
goto cleanup;
}
rc = qemuMonitorMigrateToFd(priv->mon,
@@ -5991,7 +5987,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDomainObj *vm,
VIR_CLOSE(pipeFD[1]) < 0)
VIR_WARN("failed to close intermediate pipe");
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -6004,7 +6000,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDomainObj *vm,
if (virDomainObjIsActive(vm) &&
qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
qemuMonitorMigrateCancel(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
}
goto cleanup;
@@ -6031,7 +6027,7 @@ qemuMigrationSrcToFile(virQEMUDriver *driver, virDomainObj *vm,
} else {
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
qemuMonitorSetMigrationSpeed(priv->mon, saveMigBandwidth);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
}
priv->migMaxBandwidth = saveMigBandwidth;
@@ -6063,7 +6059,7 @@ qemuMigrationSrcCancel(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
ignore_value(qemuMonitorMigrateCancel(priv->mon));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
for (i = 0; i < vm->def->ndisks; i++) {
virDomainDiskDef *disk = vm->def->disks[i];
@@ -6125,8 +6121,7 @@ qemuMigrationJobStart(virQEMUDriver *driver,
}
static void
-qemuMigrationJobSetPhase(virQEMUDriver *driver,
- virDomainObj *vm,
+qemuMigrationJobSetPhase(virDomainObj *vm,
qemuMigrationJobPhase phase)
{
qemuDomainObjPrivate *priv = vm->privateData;
@@ -6138,15 +6133,14 @@ qemuMigrationJobSetPhase(virQEMUDriver *driver,
return;
}
- qemuDomainObjSetJobPhase(driver, vm, phase);
+ qemuDomainObjSetJobPhase(vm, phase);
}
static void
-qemuMigrationJobStartPhase(virQEMUDriver *driver,
- virDomainObj *vm,
+qemuMigrationJobStartPhase(virDomainObj *vm,
qemuMigrationJobPhase phase)
{
- qemuMigrationJobSetPhase(driver, vm, phase);
+ qemuMigrationJobSetPhase(vm, phase);
}
static void
@@ -6176,9 +6170,9 @@ qemuMigrationJobIsActive(virDomainObj *vm,
}
static void
-qemuMigrationJobFinish(virQEMUDriver *driver, virDomainObj *vm)
+qemuMigrationJobFinish(virDomainObj *vm)
{
- qemuDomainObjEndAsyncJob(driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
}
@@ -6263,7 +6257,7 @@ qemuMigrationSrcFetchMirrorStats(virQEMUDriver *driver,
blockinfo = qemuMonitorGetAllBlockJobInfo(priv->mon, false);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (!blockinfo)
return -1;
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index 079f31eb90..52ed2c518b 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -504,7 +504,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig,
rc = qemuMonitorBlockStatsUpdateCapacityBlockdev(priv->mon, stats);
else
rc = qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c
index e30fd04ada..39f84983bc 100644
--- a/src/qemu/qemu_migration_params.c
+++ b/src/qemu/qemu_migration_params.c
@@ -889,7 +889,7 @@ qemuMigrationParamsApply(virQEMUDriver *driver,
ret = 0;
cleanup:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (xbzrleCacheSize_old)
migParams->params[xbzrle].set = true;
@@ -1098,7 +1098,7 @@ qemuMigrationParamsFetch(virQEMUDriver *driver,
rc = qemuMonitorGetMigrationParams(priv->mon, &jsonParams);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -1399,7 +1399,7 @@ qemuMigrationCapsCheck(virQEMUDriver *driver,
rc = qemuMonitorGetMigrationCapabilities(priv->mon, &caps);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -1432,7 +1432,7 @@ qemuMigrationCapsCheck(virQEMUDriver *driver,
rc = qemuMonitorSetMigrationCapabilities(priv->mon, &json);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0) {
virResetLastError();
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b19a6218d0..7931eeb23b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -474,7 +474,7 @@ qemuProcessFakeReboot(void *opaque)
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSystemReset(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto endjob;
@@ -495,7 +495,7 @@ qemuProcessFakeReboot(void *opaque)
ret = 0;
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
priv->pausedShutdown = false;
@@ -1906,7 +1906,7 @@ qemuProcessInitMonitor(virQEMUDriver *driver,
ret = qemuMonitorSetCapabilities(QEMU_DOMAIN_PRIVATE(vm)->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -2200,7 +2200,7 @@ qemuRefreshVirtioChannelState(virQEMUDriver *driver,
return -1;
rc = qemuMonitorGetChardevInfo(priv->mon, &info);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -2250,7 +2250,7 @@ qemuRefreshPRManagerState(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorGetPRManagerInfo(priv->mon, &info);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -2277,7 +2277,7 @@ qemuRefreshRTC(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
now = time(NULL);
rv = qemuMonitorGetRTCTime(priv->mon, &thenbits);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rv < 0)
return;
@@ -2316,7 +2316,7 @@ qemuProcessRefreshBalloonState(virQEMUDriver *driver,
return -1;
rc = qemuMonitorGetBalloonInfo(qemuDomainGetMonitor(vm), &balloon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -2367,7 +2367,7 @@ qemuProcessWaitForMonitor(virQEMUDriver *driver,
goto cleanup;
ret = qemuMonitorGetChardevInfo(priv->mon, &info);
VIR_DEBUG("qemuMonitorGetChardevInfo returned %i", ret);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret == 0) {
if ((ret = qemuProcessFindCharDevicePTYsMonitor(vm, info)) < 0)
@@ -2407,7 +2407,7 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriver *driver,
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup;
ret = qemuMonitorGetIOThreads(priv->mon, &iothreads, &niothreads);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto cleanup;
@@ -2582,7 +2582,7 @@ qemuProcessSetLinkStates(virQEMUDriver *driver,
ret = 0;
cleanup:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -3106,7 +3106,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriver *driver,
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
cfg = virQEMUDriverGetConfig(driver);
ret = virDomainObjSave(vm, driver->xmlopt, cfg->stateDir);
@@ -3114,7 +3114,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriver *driver,
return ret;
error:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return -1;
}
@@ -3237,7 +3237,7 @@ qemuProcessStartCPUs(virQEMUDriver *driver, virDomainObj *vm,
goto release;
ret = qemuMonitorStartCPUs(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto release;
@@ -3274,7 +3274,7 @@ int qemuProcessStopCPUs(virQEMUDriver *driver,
goto cleanup;
ret = qemuMonitorStopCPUs(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto cleanup;
@@ -3385,7 +3385,7 @@ qemuProcessUpdateState(virQEMUDriver *driver, virDomainObj *vm)
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorGetStatus(priv->mon, &running, &reason);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
return -1;
@@ -3621,7 +3621,7 @@ qemuProcessRecoverJob(virQEMUDriver *driver,
case QEMU_ASYNC_JOB_SNAPSHOT:
qemuDomainObjEnterMonitor(driver, vm);
ignore_value(qemuMonitorMigrateCancel(priv->mon));
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
/* resume the domain but only if it was paused as a result of
* running a migration-to-file operation. Although we are
* recovering an async job, this function is run at startup
@@ -4282,7 +4282,7 @@ qemuProcessFetchGuestCPU(virQEMUDriver *driver,
rc = qemuMonitorGetGuestCPUx86(priv->mon, cpuQOMPath, &dataEnabled, &dataDisabled);
}
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc == -1)
return -1;
@@ -4391,7 +4391,7 @@ qemuProcessFetchCPUDefinitions(virQEMUDriver *driver,
rc = virQEMUCapsFetchCPUModels(priv->mon, vm->def->os.arch, &models);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -4634,10 +4634,9 @@ qemuProcessBeginJob(virQEMUDriver *driver,
void
-qemuProcessEndJob(virQEMUDriver *driver,
- virDomainObj *vm)
+qemuProcessEndJob(virDomainObj *vm)
{
- qemuDomainObjEndAsyncJob(driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
}
@@ -5105,7 +5104,7 @@ qemuProcessSetupBalloon(virQEMUDriver *driver,
ret = 0;
cleanup:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -6000,7 +5999,7 @@ qemuProcessSetupHotpluggableVcpus(virQEMUDriver *driver,
rc = qemuMonitorAddDeviceProps(qemuDomainGetMonitor(vm), &vcpuprops);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
goto cleanup;
@@ -7162,7 +7161,7 @@ qemuProcessSetupDiskThrottlingBlockdev(virQEMUDriver *driver,
ret = 0;
cleanup:
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
return ret;
}
@@ -7282,7 +7281,7 @@ qemuProcessSetupDisksTransientHotplug(virDomainObj *vm,
rc = qemuMonitorSystemReset(priv->mon);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
}
@@ -7334,7 +7333,7 @@ qemuProcessSetupLifecycleActions(virDomainObj *vm,
QEMU_MONITOR_ACTION_WATCHDOG_KEEP,
QEMU_MONITOR_ACTION_PANIC_KEEP);
- qemuDomainObjExitMonitor(priv->driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -8370,7 +8369,7 @@ void qemuProcessStop(virQEMUDriver *driver,
endjob:
if (asyncJob != QEMU_ASYNC_JOB_NONE)
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
cleanup:
virErrorRestore(&orig_err);
@@ -8395,7 +8394,7 @@ qemuProcessAutoDestroy(virDomainObj *dom,
if (priv->job.asyncJob) {
VIR_DEBUG("vm=%s has long-term job active, cancelling",
dom->def->name);
- qemuDomainObjDiscardAsyncJob(driver, dom);
+ qemuDomainObjDiscardAsyncJob(dom);
}
VIR_DEBUG("Killing domain");
@@ -8413,7 +8412,7 @@ qemuProcessAutoDestroy(virDomainObj *dom,
qemuDomainRemoveInactive(driver, dom);
- qemuDomainObjEndJob(driver, dom);
+ qemuDomainObjEndJob(dom);
virObjectEventStateQueue(driver->domainEventState, event);
}
@@ -8457,7 +8456,7 @@ qemuProcessRefreshDisks(virQEMUDriver *driver,
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) == 0) {
table = qemuMonitorGetBlockInfo(priv->mon);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
if (!table)
@@ -8524,7 +8523,7 @@ qemuProcessRefreshCPUMigratability(virQEMUDriver *driver,
rc = qemuMonitorGetCPUMigratable(priv->mon, cpuQOMPath, &migratable);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
@@ -8681,7 +8680,7 @@ qemuProcessRefreshLegacyBlockjobs(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(driver, vm);
blockJobs = qemuMonitorGetAllBlockJobInfo(qemuDomainGetMonitor(vm), true);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (!blockJobs)
return -1;
@@ -8998,7 +8997,7 @@ qemuProcessReconnect(void *opaque)
if (jobStarted) {
if (!virDomainObjIsActive(obj))
qemuDomainRemoveInactive(driver, obj);
- qemuDomainObjEndJob(driver, obj);
+ qemuDomainObjEndJob(obj);
} else {
if (!virDomainObjIsActive(obj))
qemuDomainRemoveInactiveJob(driver, obj);
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 289cd74eb7..7e6f9f20e5 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -69,8 +69,7 @@ int qemuProcessBeginJob(virQEMUDriver *driver,
virDomainObj *vm,
virDomainJobOperation operation,
unsigned long apiFlags);
-void qemuProcessEndJob(virQEMUDriver *driver,
- virDomainObj *vm);
+void qemuProcessEndJob(virDomainObj *vm);
typedef enum {
VIR_QEMU_PROCESS_START_COLD = 1 << 0,
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index a7901779fc..6eebe69919 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -322,7 +322,7 @@ qemuSnapshotCreateActiveInternal(virQEMUDriver *driver,
}
ret = qemuMonitorCreateSnapshot(priv->mon, snap->def->name);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (ret < 0)
goto cleanup;
@@ -875,7 +875,7 @@ qemuSnapshotDiskCleanup(qemuSnapshotDiskData *data,
qemuBlockStorageSourceAttachRollback(qemuDomainGetMonitor(vm),
data[i].crdata->srcdata[0]);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
}
}
@@ -1024,7 +1024,7 @@ qemuSnapshotDiskPrepareOneBlockdev(virQEMUDriver *driver,
rc = qemuBlockStorageSourceAttachApply(qemuDomainGetMonitor(vm),
dd->crdata->srcdata[0]);
- qemuDomainObjExitMonitor(driver, vm);
+ qemuDomainObjExitMonitor(vm);
if (rc < 0)
return -1;
} else {
@@ -1281,7 +1281,7 @@ qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt)
rc = qemuMonitorTransaction(priv->mon, &snapctxt->actions);
- qemuDomainObjExitMonitor(driver, snapctxt->vm);
+ qemuDomainObjExitMonitor(snapctxt->vm);
for (i = 0; i < snapctxt->ndd; i++) {
qemuSnapshotDiskData *dd = snapctxt->dd + i;
@@ -1887,7 +1887,7 @@ qemuSnapshotCreateXML(virDomainPtr domain,
snapshot = qemuSnapshotCreate(vm, domain, def, driver, cfg, flags);
}
- qemuDomainObjEndAsyncJob(driver, vm);
+ qemuDomainObjEndAsyncJob(vm);
return snapshot;
}
@@ -2322,7 +2322,7 @@ qemuSnapshotRevert(virDomainObj *vm,
}
endjob:
- qemuProcessEndJob(driver, vm);
+ qemuProcessEndJob(vm);
return ret;
}
@@ -2454,7 +2454,7 @@ qemuSnapshotDelete(virDomainObj *vm,
}
endjob:
- qemuDomainObjEndJob(driver, vm);
+ qemuDomainObjEndJob(vm);
return ret;
}
--
2.35.1
2 years, 9 months
[libvirt PATCH] qemu: fix recording of CPU deprecations
by Daniel P. Berrangé
The code parsing thue query-cpu-definitions response will short-circuit
the for loop in the case where usable=yes, resulting in us failing to
parse the CPU deprecation flag.
IOW, we only reported deprecations in domain capabilities for CPU models
which were not runnable on the host.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_monitor_json.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 27c5e1c992..d5622bd6d9 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5309,10 +5309,9 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitor *mon,
if (g_strv_length(cpu->blockers) == 0) {
cpu->usable = VIR_DOMCAPS_CPU_USABLE_YES;
g_clear_pointer(&cpu->blockers, g_strfreev);
- continue;
+ } else {
+ cpu->usable = VIR_DOMCAPS_CPU_USABLE_NO;
}
-
- cpu->usable = VIR_DOMCAPS_CPU_USABLE_NO;
}
if (virJSONValueObjectHasKey(child, "deprecated") &&
--
2.34.1
2 years, 9 months
[libvirt PATCH v2] nwfilter: merge updateMutex and updateLock
by Daniel P. Berrangé
The updateLock is a R/W lock held by anything which needs to read or
modify the rules associated with an NWFilter.
APIs for defining/undefining NW filters rules hold a write lock on
updateLock.
APIs for creating/deleting NW filter bindings hold a read lock on
updateLock, which prevents define/undefine taking place concurrently.
The problems arise when we attempt to creating two NW filter bindings in
parallel.
Thread 1 can acquire the mutex for filter A
Thread 2 can acquire the mutex for filter B
Consider if filters A and B both reference filters C and D, but in
different orders:
Filter A
-> filter C
-> filter D
Filter B
-> filter D
-> filter C
Thread 1 will try to acquire locks in order A, C, D while thread 1 will
try to acquire in order A, D, C. Deadlock can still occur.
Think we can sort the list of filters before acquiring locks on all of
them ? Nope, we allow arbitrary recursion:
Filter A
-> filter C
-> filter E
-> filter F
-> filter H
-> filter K
-> filter D
-> filter G
-> filter I
So we can't tell from looking at 'A' which filters we're going to
need to lock. We can only see the first level of filters references
and we need to lock those before we can see the second level of
filters, etc.
We could probably come up with some cleverness to address this but
it isn't worth the time investment. It is simpler to just keep the
process of creating NW filter bindings totally serialized.
Using two separate locks for this serialization though is pointless.
Every code path which gets a read(updateLock) will go on to hold
updateMutex. It is simpler to just hold write(updateLock) and
get rid of updateMutex. At that point we don't need updateLock
to be a R/W lock, it can be a plain mutex.
Thus this patch gets rid of the current updateLock and updateMutex
and introduces a new top level updateMutex.
This has a secondary benefit of introducing fairness into the
locking. With a POSIX R/W lock, you get writer starvation if
you have lots of readers. IOW, if we call virNWFilterBIndingCreate
and virNWFilterBindingDelete in a tight loop from a couple of
threads, we can prevent virNWFilterDefine from ever acquiring
a write lock.
Getting rid of the R/W lock gives us FIFO lock acquisition
preventing starvation of any API call servicing.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/conf/nwfilter_conf.c | 33 +---------
src/conf/nwfilter_conf.h | 9 ---
src/conf/virnwfilterobj.h | 3 +
src/libvirt_private.syms | 3 -
src/nwfilter/nwfilter_driver.c | 77 ++++++++++++------------
src/nwfilter/nwfilter_gentech_driver.c | 83 +++-----------------------
6 files changed, 52 insertions(+), 156 deletions(-)
diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c
index 3e1d4f5927..5171145c75 100644
--- a/src/conf/nwfilter_conf.c
+++ b/src/conf/nwfilter_conf.c
@@ -151,33 +151,6 @@ static const struct int_map chain_priorities[] = {
};
-/*
- * only one filter update allowed
- */
-static virRWLock updateLock;
-static bool initialized;
-
-void
-virNWFilterReadLockFilterUpdates(void)
-{
- virRWLockRead(&updateLock);
-}
-
-
-void
-virNWFilterWriteLockFilterUpdates(void)
-{
- virRWLockWrite(&updateLock);
-}
-
-
-void
-virNWFilterUnlockFilterUpdates(void)
-{
- virRWLockUnlock(&updateLock);
-}
-
-
/*
* attribute names for the rules XML
*/
@@ -3059,6 +3032,7 @@ virNWFilterDefFormat(const virNWFilterDef *def)
return virBufferContentAndReset(&buf);
}
+static bool initialized;
static virNWFilterTriggerRebuildCallback rebuildCallback;
static void *rebuildOpaque;
@@ -3074,9 +3048,6 @@ virNWFilterConfLayerInit(virNWFilterTriggerRebuildCallback cb,
initialized = true;
- if (virRWLockInit(&updateLock) < 0)
- return -1;
-
return 0;
}
@@ -3087,8 +3058,6 @@ virNWFilterConfLayerShutdown(void)
if (!initialized)
return;
- virRWLockDestroy(&updateLock);
-
initialized = false;
rebuildCallback = NULL;
rebuildOpaque = NULL;
diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h
index bbe12284a5..46867afc8c 100644
--- a/src/conf/nwfilter_conf.h
+++ b/src/conf/nwfilter_conf.h
@@ -552,15 +552,6 @@ virNWFilterDefParseString(const char *xml,
virNWFilterDef *
virNWFilterDefParseFile(const char *filename);
-void
-virNWFilterWriteLockFilterUpdates(void);
-
-void
-virNWFilterReadLockFilterUpdates(void);
-
-void
-virNWFilterUnlockFilterUpdates(void);
-
typedef int (*virNWFilterTriggerRebuildCallback)(void *opaque);
int
diff --git a/src/conf/virnwfilterobj.h b/src/conf/virnwfilterobj.h
index 44ba31f732..30a9020097 100644
--- a/src/conf/virnwfilterobj.h
+++ b/src/conf/virnwfilterobj.h
@@ -43,6 +43,9 @@ struct _virNWFilterDriverState {
char *stateDir;
char *configDir;
char *bindingDir;
+
+ /* Recursive. Hold for filter changes, instantiation or deletion */
+ virMutex updateLock;
};
virNWFilterDef *
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 3a8e16525b..03697d81a8 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -949,7 +949,6 @@ virNWFilterDeleteDef;
virNWFilterJumpTargetTypeToString;
virNWFilterPrintStateMatchFlags;
virNWFilterPrintTCPFlags;
-virNWFilterReadLockFilterUpdates;
virNWFilterRuleActionTypeToString;
virNWFilterRuleDirectionTypeToString;
virNWFilterRuleIsProtocolEthernet;
@@ -958,8 +957,6 @@ virNWFilterRuleIsProtocolIPv6;
virNWFilterRuleProtocolTypeToString;
virNWFilterSaveConfig;
virNWFilterTriggerRebuild;
-virNWFilterUnlockFilterUpdates;
-virNWFilterWriteLockFilterUpdates;
# conf/nwfilter_ipaddrmap.h
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index a493205c80..732d83e563 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -176,6 +176,8 @@ nwfilterStateInitialize(bool privileged,
driver->lockFD = -1;
if (virMutexInit(&driver->lock) < 0)
goto err_free_driverstate;
+ if (virMutexInitRecursive(&driver->updateLock) < 0)
+ goto err_free_driverstate;
driver->privileged = privileged;
if (!(driver->nwfilters = virNWFilterObjListNew()))
@@ -293,13 +295,12 @@ nwfilterStateReload(void)
virNWFilterLearnThreadsTerminate(true);
nwfilterDriverLock();
- virNWFilterWriteLockFilterUpdates();
-
- virNWFilterObjListLoadAllConfigs(driver->nwfilters, driver->configDir);
- virNWFilterUnlockFilterUpdates();
+ VIR_WITH_MUTEX_LOCK_GUARD(&driver->updateLock) {
+ virNWFilterObjListLoadAllConfigs(driver->nwfilters, driver->configDir);
- virNWFilterBuildAll(driver, false);
+ virNWFilterBuildAll(driver, false);
+ }
nwfilterDriverUnlock();
@@ -343,6 +344,7 @@ nwfilterStateCleanup(void)
/* free inactive nwfilters */
virNWFilterObjListFree(driver->nwfilters);
+ virMutexDestroy(&driver->updateLock);
virMutexDestroy(&driver->lock);
g_clear_pointer(&driver, g_free);
@@ -550,7 +552,6 @@ nwfilterDefineXMLFlags(virConnectPtr conn,
}
nwfilterDriverLock();
- virNWFilterWriteLockFilterUpdates();
if (!(def = virNWFilterDefParseString(xml, flags)))
goto cleanup;
@@ -558,8 +559,10 @@ nwfilterDefineXMLFlags(virConnectPtr conn,
if (virNWFilterDefineXMLFlagsEnsureACL(conn, def) < 0)
goto cleanup;
- if (!(obj = virNWFilterObjListAssignDef(driver->nwfilters, def)))
- goto cleanup;
+ VIR_WITH_MUTEX_LOCK_GUARD(&driver->updateLock) {
+ if (!(obj = virNWFilterObjListAssignDef(driver->nwfilters, def)))
+ goto cleanup;
+ }
def = NULL;
objdef = virNWFilterObjGetDef(obj);
@@ -574,8 +577,6 @@ nwfilterDefineXMLFlags(virConnectPtr conn,
virNWFilterDefFree(def);
if (obj)
virNWFilterObjUnlock(obj);
-
- virNWFilterUnlockFilterUpdates();
nwfilterDriverUnlock();
return nwfilter;
}
@@ -592,39 +593,39 @@ nwfilterDefineXML(virConnectPtr conn,
static int
nwfilterUndefine(virNWFilterPtr nwfilter)
{
- virNWFilterObj *obj;
+ virNWFilterObj *obj = NULL;
virNWFilterDef *def;
int ret = -1;
nwfilterDriverLock();
- virNWFilterWriteLockFilterUpdates();
- if (!(obj = nwfilterObjFromNWFilter(nwfilter->uuid)))
- goto cleanup;
- def = virNWFilterObjGetDef(obj);
+ VIR_WITH_MUTEX_LOCK_GUARD(&driver->updateLock) {
+ if (!(obj = nwfilterObjFromNWFilter(nwfilter->uuid)))
+ goto cleanup;
+ def = virNWFilterObjGetDef(obj);
- if (virNWFilterUndefineEnsureACL(nwfilter->conn, def) < 0)
- goto cleanup;
+ if (virNWFilterUndefineEnsureACL(nwfilter->conn, def) < 0)
+ goto cleanup;
- if (virNWFilterObjTestUnassignDef(obj) < 0) {
- virReportError(VIR_ERR_OPERATION_INVALID,
- "%s",
- _("nwfilter is in use"));
- goto cleanup;
- }
+ if (virNWFilterObjTestUnassignDef(obj) < 0) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s",
+ _("nwfilter is in use"));
+ goto cleanup;
+ }
- if (virNWFilterDeleteDef(driver->configDir, def) < 0)
- goto cleanup;
+ if (virNWFilterDeleteDef(driver->configDir, def) < 0)
+ goto cleanup;
- virNWFilterObjListRemove(driver->nwfilters, obj);
- obj = NULL;
+ virNWFilterObjListRemove(driver->nwfilters, obj);
+ obj = NULL;
+ }
ret = 0;
cleanup:
if (obj)
virNWFilterObjUnlock(obj);
- virNWFilterUnlockFilterUpdates();
nwfilterDriverUnlock();
return ret;
}
@@ -764,14 +765,14 @@ nwfilterBindingCreateXML(virConnectPtr conn,
if (!(ret = virGetNWFilterBinding(conn, def->portdevname, def->filter)))
goto cleanup;
- virNWFilterReadLockFilterUpdates();
- if (virNWFilterInstantiateFilter(driver, def) < 0) {
- virNWFilterUnlockFilterUpdates();
- virNWFilterBindingObjListRemove(driver->bindings, obj);
- g_clear_pointer(&ret, virObjectUnref);
- goto cleanup;
+ VIR_WITH_MUTEX_LOCK_GUARD(&driver->updateLock) {
+ if (virNWFilterInstantiateFilter(driver, def) < 0) {
+ virNWFilterBindingObjListRemove(driver->bindings, obj);
+ g_clear_pointer(&ret, virObjectUnref);
+ goto cleanup;
+ }
}
- virNWFilterUnlockFilterUpdates();
+
virNWFilterBindingObjSave(obj, driver->bindingDir);
cleanup:
@@ -808,9 +809,9 @@ nwfilterBindingDelete(virNWFilterBindingPtr binding)
if (virNWFilterBindingDeleteEnsureACL(binding->conn, def) < 0)
goto cleanup;
- virNWFilterReadLockFilterUpdates();
- virNWFilterTeardownFilter(def);
- virNWFilterUnlockFilterUpdates();
+ VIR_WITH_MUTEX_LOCK_GUARD(&driver->updateLock) {
+ virNWFilterTeardownFilter(def);
+ }
virNWFilterBindingObjDelete(obj, driver->bindingDir);
virNWFilterBindingObjListRemove(driver->bindings, obj);
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index c609405ac0..7e323afb1a 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -55,56 +55,10 @@ static virNWFilterTechDriver *filter_tech_drivers[] = {
NULL
};
-/*
- * Serializes instantiation of filters.
- *
- * When instantiating a filter, we need to resolve references
- * to other filters and acquire locks on them.
- *
- * We retain a lock on the referenced filter once found.
- * The order in which the locks are acquired depends on
- * the order in which filters reference each other.
- *
- * Filter A:
- * Reference Filter C
- * Reference Filter D
- *
- * Filter B:
- * Reference Filter D
- * Reference Filter C
- *
- * In one example, we lock A, C, D, in the other example
- * we lock A, D, C.
- *
- * Because C & D are locked in differing orders we are
- * once again at risk of deadlocks.
- *
- * There can be multiple levels of recursion, so it is
- * not viable to determine the lock order upfront, it
- * has to be done as we traverse the tree.
- *
- * Thus we serialize any code that needs to traverse
- * the filter references.
- *
- * This covers the following APIs:
- *
- * virNWFilterDefineXML
- * virNWFilterUndefine
- * virNWFilterBindingCreate
- * virNWFilterBindingDelete
- *
- * In addition to the asynchronous filter instantiation
- * triggered by the IP address learning backends.
- */
-static virMutex updateMutex;
-
int virNWFilterTechDriversInit(bool privileged)
{
size_t i = 0;
VIR_DEBUG("Initializing NWFilter technology drivers");
- if (virMutexInitRecursive(&updateMutex) < 0)
- return -1;
-
while (filter_tech_drivers[i]) {
if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
filter_tech_drivers[i]->init(privileged);
@@ -122,7 +76,6 @@ void virNWFilterTechDriversShutdown(void)
filter_tech_drivers[i]->shutdown();
i++;
}
- virMutexDestroy(&updateMutex);
}
@@ -744,9 +697,6 @@ virNWFilterInstantiateFilterInternal(virNWFilterDriverState *driver,
bool *foundNewFilter)
{
int ifindex;
- int rc;
-
- virMutexLock(&updateMutex);
/* after grabbing the filter update lock check for the interface; if
it's not there anymore its filters will be or are being removed
@@ -756,20 +706,14 @@ virNWFilterInstantiateFilterInternal(virNWFilterDriverState *driver,
/* interfaces / VMs can disappear during filter instantiation;
don't mark it as an error */
virResetLastError();
- rc = 0;
- goto cleanup;
+ return 0;
}
- rc = virNWFilterInstantiateFilterUpdate(driver, teardownOld,
- binding,
- ifindex,
- useNewFilter,
- false, foundNewFilter);
-
- cleanup:
- virMutexUnlock(&updateMutex);
-
- return rc;
+ return virNWFilterInstantiateFilterUpdate(driver, teardownOld,
+ binding,
+ ifindex,
+ useNewFilter,
+ false, foundNewFilter);
}
@@ -778,11 +722,9 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverState *driver,
virNWFilterBindingDef *binding,
int ifindex)
{
- int rc;
+ int rc = 0;
bool foundNewFilter = false;
-
- virNWFilterReadLockFilterUpdates();
- virMutexLock(&updateMutex);
+ VIR_LOCK_GUARD lock = virLockGuardLock(&driver->updateLock);
rc = virNWFilterInstantiateFilterUpdate(driver, true,
binding, ifindex,
@@ -798,9 +740,6 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverState *driver,
}
}
- virNWFilterUnlockFilterUpdates();
- virMutexUnlock(&updateMutex);
-
return rc;
}
@@ -921,11 +860,7 @@ _virNWFilterTeardownFilter(const char *ifname)
int
virNWFilterTeardownFilter(virNWFilterBindingDef *binding)
{
- int ret;
- virMutexLock(&updateMutex);
- ret = _virNWFilterTeardownFilter(binding->portdevname);
- virMutexUnlock(&updateMutex);
- return ret;
+ return _virNWFilterTeardownFilter(binding->portdevname);
}
enum {
--
2.35.1
2 years, 9 months
[libvirt PATCH 0/2] ci: integration test tweaks
by Daniel P. Berrangé
Daniel P. Berrangé (2):
ci: rename integration test template
ci: only run integration tests if $LIBVIRT_CI_INTEGRATION=1 is set
ci/integration.yml | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--
2.34.1
2 years, 9 months
[PATCH 0/2] qemu_process: Start probing process more robustly
by Michal Privoznik
I've found these in an old branch where dnsmasq starting is reworked
too. But that part is not ready yet, so let's merge at least the first
two patches.
Michal Prívozník (2):
qemu_process: Be nicer to killing QEMU when probing caps
qemu_process: Start QEMU for caps probing more robustly
src/qemu/qemu_process.c | 64 +++++++++++++++++++++++++++--------------
src/qemu/qemu_process.h | 1 -
2 files changed, 43 insertions(+), 22 deletions(-)
--
2.34.1
2 years, 9 months
[libvirt PATCH] esx_stream: Fix NULL dereferences
by Tim Wiederhake
A wrong reordering caused "priv" to be derefenced before the NULL-check
in esxStreamSend and esxStreamRecvFlags.
Fixes: 12e19f172d2a908eec2a4557202ff764cdbb951e
Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/esx/esx_stream.c | 102 +++++++++++++++++++++++--------------------
1 file changed, 55 insertions(+), 47 deletions(-)
diff --git a/src/esx/esx_stream.c b/src/esx/esx_stream.c
index 2b49c8dd12..b356fbed70 100644
--- a/src/esx/esx_stream.c
+++ b/src/esx/esx_stream.c
@@ -198,8 +198,8 @@ esxStreamTransfer(esxStreamPrivate *priv, bool blocking)
static int
esxStreamSend(virStreamPtr stream, const char *data, size_t nbytes)
{
+ int result = -1;
esxStreamPrivate *priv = stream->privateData;
- VIR_LOCK_GUARD lock = virLockGuardLock(&priv->curl->lock);
if (nbytes == 0)
return 0;
@@ -214,29 +214,33 @@ esxStreamSend(virStreamPtr stream, const char *data, size_t nbytes)
return -1;
}
- priv->buffer = (char *)data;
- priv->buffer_size = nbytes;
- priv->buffer_used = nbytes;
+ VIR_WITH_MUTEX_LOCK_GUARD(&priv->curl->lock) {
+ priv->buffer = (char *)data;
+ priv->buffer_size = nbytes;
+ priv->buffer_used = nbytes;
- if (stream->flags & VIR_STREAM_NONBLOCK) {
- if (esxStreamTransfer(priv, false) < 0)
- return -1;
+ if (stream->flags & VIR_STREAM_NONBLOCK) {
+ if (esxStreamTransfer(priv, false) < 0)
+ return -1;
- if (priv->buffer_used >= priv->buffer_size)
- return -2;
- } else /* blocking */ {
- do {
- int status = esxStreamTransfer(priv, true);
+ if (priv->buffer_used >= priv->buffer_size)
+ return -2;
+ } else /* blocking */ {
+ do {
+ int status = esxStreamTransfer(priv, true);
- if (status < 0)
- return -1;
+ if (status < 0)
+ return -1;
+
+ if (status > 0)
+ break;
+ } while (priv->buffer_used > 0);
+ }
- if (status > 0)
- break;
- } while (priv->buffer_used > 0);
+ result = priv->buffer_size - priv->buffer_used;
}
- return priv->buffer_size - priv->buffer_used;
+ return result;
}
static int
@@ -245,8 +249,8 @@ esxStreamRecvFlags(virStreamPtr stream,
size_t nbytes,
unsigned int flags)
{
+ int result = -1;
esxStreamPrivate *priv = stream->privateData;
- VIR_LOCK_GUARD lock = virLockGuardLock(&priv->curl->lock);
virCheckFlags(0, -1);
@@ -263,40 +267,44 @@ esxStreamRecvFlags(virStreamPtr stream,
return -1;
}
- priv->buffer = data;
- priv->buffer_size = nbytes;
- priv->buffer_used = 0;
-
- if (priv->backlog_used > 0) {
- if (priv->buffer_size > priv->backlog_used)
- priv->buffer_used = priv->backlog_used;
- else
- priv->buffer_used = priv->buffer_size;
+ VIR_WITH_MUTEX_LOCK_GUARD(&priv->curl->lock) {
+ priv->buffer = data;
+ priv->buffer_size = nbytes;
+ priv->buffer_used = 0;
+
+ if (priv->backlog_used > 0) {
+ if (priv->buffer_size > priv->backlog_used)
+ priv->buffer_used = priv->backlog_used;
+ else
+ priv->buffer_used = priv->buffer_size;
+
+ memcpy(priv->buffer, priv->backlog, priv->buffer_used);
+ memmove(priv->backlog, priv->backlog + priv->buffer_used,
+ priv->backlog_used - priv->buffer_used);
+
+ priv->backlog_used -= priv->buffer_used;
+ } else if (stream->flags & VIR_STREAM_NONBLOCK) {
+ if (esxStreamTransfer(priv, false) < 0)
+ return -1;
- memcpy(priv->buffer, priv->backlog, priv->buffer_used);
- memmove(priv->backlog, priv->backlog + priv->buffer_used,
- priv->backlog_used - priv->buffer_used);
+ if (priv->buffer_used <= 0)
+ return -2;
+ } else /* blocking */ {
+ do {
+ int status = esxStreamTransfer(priv, true);
- priv->backlog_used -= priv->buffer_used;
- } else if (stream->flags & VIR_STREAM_NONBLOCK) {
- if (esxStreamTransfer(priv, false) < 0)
- return -1;
+ if (status < 0)
+ return -1;
- if (priv->buffer_used <= 0)
- return -2;
- } else /* blocking */ {
- do {
- int status = esxStreamTransfer(priv, true);
-
- if (status < 0)
- return -1;
+ if (status > 0)
+ break;
+ } while (priv->buffer_used < priv->buffer_size);
+ }
- if (status > 0)
- break;
- } while (priv->buffer_used < priv->buffer_size);
+ result = priv->buffer_used;
}
- return priv->buffer_used;
+ return result;
}
static int
--
2.31.1
2 years, 9 months
[PATCH] conf: fix inverted parameters in hash iterator callbacks
by Daniel P. Berrangé
virHashTableForEach unhelpfully has payload/key args in
its callback reversed compared to g_hash_table_foreach.
When converting from one to the other the semantics
change but you don't get a compile error
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
This fixes the virNWFilterObjList conversion to GHashTable
which I clearly forgot to re-test properly after replacing
virHashTableForEach with g_hash_table_foreach in my
patch.
src/conf/virnwfilterobj.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c
index a569a52002..309f8bddb4 100644
--- a/src/conf/virnwfilterobj.c
+++ b/src/conf/virnwfilterobj.c
@@ -380,8 +380,8 @@ struct virNWFilterObjListData {
static void
-virNWFilterObjListCount(void *payload,
- void *key G_GNUC_UNUSED,
+virNWFilterObjListCount(void *key G_GNUC_UNUSED,
+ void *payload,
void *opaque)
{
virNWFilterObj *obj = payload;
@@ -417,8 +417,8 @@ struct virNWFilterNameData {
static void
-virNWFilterObjListCopyNames(void *payload,
- void *key G_GNUC_UNUSED,
+virNWFilterObjListCopyNames(void *key G_GNUC_UNUSED,
+ void *payload,
void *opaque)
{
virNWFilterObj *obj = payload;
@@ -460,15 +460,15 @@ struct virNWFilterListData {
static void
-virNWFilterObjListCollectIterator(void *payload,
- void *key G_GNUC_UNUSED,
+virNWFilterObjListCollectIterator(void *key G_GNUC_UNUSED,
+ void *payload,
void *opaque)
{
struct virNWFilterListData *data = opaque;
virNWFilterObj *obj = payload;
virNWFilterObjLock(obj);
- data->filters[data->nfilters++] = payload;
+ data->filters[data->nfilters++] = obj;
}
--
2.35.1
2 years, 9 months