mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +00:00
qemu: domain: Repurpose and export helper for saving domain status XML
Rename qemuDomainObjSaveJob and create a wrapper for it which does not require 'driver' to be passed and export it so that other palces can easily save the status XML without having to invoke virDomainSaveStatus which has unpleasing parameters. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c1a1975e49
commit
997746b2df
@ -7238,7 +7238,8 @@ virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = {
|
||||
|
||||
|
||||
static void
|
||||
qemuDomainObjSaveJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
|
||||
qemuDomainObjSaveStatus(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr obj)
|
||||
{
|
||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
|
||||
|
||||
@ -7250,6 +7251,14 @@ qemuDomainObjSaveJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
|
||||
virObjectUnref(cfg);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
qemuDomainSaveStatus(virDomainObjPtr obj)
|
||||
{
|
||||
qemuDomainObjSaveStatus(QEMU_DOMAIN_PRIVATE(obj)->driver, obj);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
qemuDomainObjSetJobPhase(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr obj,
|
||||
@ -7273,7 +7282,7 @@ qemuDomainObjSetJobPhase(virQEMUDriverPtr driver,
|
||||
|
||||
priv->job.phase = phase;
|
||||
priv->job.asyncOwner = me;
|
||||
qemuDomainObjSaveJob(driver, obj);
|
||||
qemuDomainObjSaveStatus(driver, obj);
|
||||
}
|
||||
|
||||
void
|
||||
@ -7296,7 +7305,7 @@ qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
|
||||
if (priv->job.active == QEMU_JOB_ASYNC_NESTED)
|
||||
qemuDomainObjResetJob(priv);
|
||||
qemuDomainObjResetAsyncJob(priv);
|
||||
qemuDomainObjSaveJob(driver, obj);
|
||||
qemuDomainObjSaveStatus(driver, obj);
|
||||
}
|
||||
|
||||
void
|
||||
@ -7479,7 +7488,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
|
||||
}
|
||||
|
||||
if (qemuDomainTrackJob(job))
|
||||
qemuDomainObjSaveJob(driver, obj);
|
||||
qemuDomainObjSaveStatus(driver, obj);
|
||||
|
||||
virObjectUnref(cfg);
|
||||
return 0;
|
||||
@ -7723,7 +7732,7 @@ qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
|
||||
|
||||
qemuDomainObjResetJob(priv);
|
||||
if (qemuDomainTrackJob(job))
|
||||
qemuDomainObjSaveJob(driver, obj);
|
||||
qemuDomainObjSaveStatus(driver, obj);
|
||||
/* We indeed need to wake up ALL threads waiting because
|
||||
* grabbing a job requires checking more variables. */
|
||||
virCondBroadcast(&priv->job.cond);
|
||||
@ -7767,7 +7776,7 @@ qemuDomainObjEndJobWithAgent(virQEMUDriverPtr driver,
|
||||
qemuDomainObjResetJob(priv);
|
||||
qemuDomainObjResetAgentJob(priv);
|
||||
if (qemuDomainTrackJob(job))
|
||||
qemuDomainObjSaveJob(driver, obj);
|
||||
qemuDomainObjSaveStatus(driver, obj);
|
||||
/* We indeed need to wake up ALL threads waiting because
|
||||
* grabbing a job requires checking more variables. */
|
||||
virCondBroadcast(&priv->job.cond);
|
||||
@ -7785,7 +7794,7 @@ qemuDomainObjEndAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj)
|
||||
obj, obj->def->name);
|
||||
|
||||
qemuDomainObjResetAsyncJob(priv);
|
||||
qemuDomainObjSaveJob(driver, obj);
|
||||
qemuDomainObjSaveStatus(driver, obj);
|
||||
virCondBroadcast(&priv->job.asyncCond);
|
||||
}
|
||||
|
||||
|
@ -206,6 +206,8 @@ typedef void (*qemuDomainCleanupCallback)(virQEMUDriverPtr driver,
|
||||
|
||||
#define QEMU_DOMAIN_MASTER_KEY_LEN 32 /* 32 bytes for 256 bit random key */
|
||||
|
||||
void qemuDomainSaveStatus(virDomainObjPtr obj);
|
||||
|
||||
|
||||
/* helper data types for async device unplug */
|
||||
typedef enum {
|
||||
|
Loading…
Reference in New Issue
Block a user