Pass virDomainObjPtr to qemuDomainAgentAvailable

Not just the DomainObj's private data.
This commit is contained in:
Ján Tomko 2015-02-27 14:06:47 +01:00
parent c8b80b49f6
commit fbb94044ea
3 changed files with 16 additions and 14 deletions

View File

@ -2804,9 +2804,11 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
} }
bool bool
qemuDomainAgentAvailable(qemuDomainObjPrivatePtr priv, qemuDomainAgentAvailable(virDomainObjPtr vm,
bool reportError) bool reportError)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData;
if (priv->agentError) { if (priv->agentError) {
if (reportError) { if (reportError) {
virReportError(VIR_ERR_AGENT_UNRESPONSIVE, "%s", virReportError(VIR_ERR_AGENT_UNRESPONSIVE, "%s",

View File

@ -395,7 +395,7 @@ bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
virDomainDefPtr src, virDomainDefPtr src,
virDomainDefPtr dst); virDomainDefPtr dst);
bool qemuDomainAgentAvailable(qemuDomainObjPrivatePtr priv, bool qemuDomainAgentAvailable(virDomainObjPtr vm,
bool reportError); bool reportError);
int qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo) int qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo)

View File

@ -1943,7 +1943,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
goto cleanup; goto cleanup;
agentForced = agentRequested && !acpiRequested; agentForced = agentRequested && !acpiRequested;
if (!qemuDomainAgentAvailable(priv, agentForced)) { if (!qemuDomainAgentAvailable(vm, agentForced)) {
if (agentForced) if (agentForced)
goto endjob; goto endjob;
useAgent = false; useAgent = false;
@ -2058,7 +2058,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup; goto cleanup;
if (useAgent && !qemuDomainAgentAvailable(priv, true)) if (useAgent && !qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
if (!virDomainObjIsActive(vm)) { if (!virDomainObjIsActive(vm)) {
@ -4766,7 +4766,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
goto endjob; goto endjob;
} }
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
if (nvcpus > vm->def->vcpus) { if (nvcpus > vm->def->vcpus) {
@ -5490,7 +5490,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0) if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
goto cleanup; goto cleanup;
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
if (!virDomainObjIsActive(vm)) { if (!virDomainObjIsActive(vm)) {
@ -12893,7 +12893,7 @@ qemuDomainSnapshotFSFreeze(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
int frozen; int frozen;
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
return -1; return -1;
qemuDomainObjEnterAgent(vm); qemuDomainObjEnterAgent(vm);
@ -12913,7 +12913,7 @@ qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
int thawed; int thawed;
virErrorPtr err = NULL; virErrorPtr err = NULL;
if (!qemuDomainAgentAvailable(priv, report)) if (!qemuDomainAgentAvailable(vm, report))
return -1; return -1;
qemuDomainObjEnterAgent(vm); qemuDomainObjEnterAgent(vm);
@ -17615,7 +17615,7 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom,
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup; goto cleanup;
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
if (!virDomainObjIsActive(vm)) { if (!virDomainObjIsActive(vm)) {
@ -17735,7 +17735,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain,
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup; goto cleanup;
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
if (!virDomainObjIsActive(vm)) { if (!virDomainObjIsActive(vm)) {
@ -17844,7 +17844,7 @@ qemuDomainFSTrim(virDomainPtr dom,
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup; goto cleanup;
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
if (!virDomainObjIsActive(vm)) { if (!virDomainObjIsActive(vm)) {
@ -18028,7 +18028,7 @@ qemuDomainGetTime(virDomainPtr dom,
goto endjob; goto endjob;
} }
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
qemuDomainObjEnterAgent(vm); qemuDomainObjEnterAgent(vm);
@ -18087,7 +18087,7 @@ qemuDomainSetTime(virDomainPtr dom,
goto endjob; goto endjob;
} }
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
qemuDomainObjEnterAgent(vm); qemuDomainObjEnterAgent(vm);
@ -19064,7 +19064,7 @@ qemuDomainGetFSInfo(virDomainPtr dom,
goto endjob; goto endjob;
} }
if (!qemuDomainAgentAvailable(priv, true)) if (!qemuDomainAgentAvailable(vm, true))
goto endjob; goto endjob;
qemuDomainObjEnterAgent(vm); qemuDomainObjEnterAgent(vm);