mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemu: Reuse qemuDomainAgentAvailable in qemuDomainInterfaceAddresses
This commit is contained in:
parent
c6351cc689
commit
dcbb243bbc
@ -19799,27 +19799,11 @@ qemuDomainInterfaceAddresses(virDomainPtr dom,
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT:
|
||||
if (priv->agentError) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("QEMU guest agent is not "
|
||||
"available due to an error"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!virDomainObjIsActive(vm)) {
|
||||
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||
_("domain is not running"));
|
||||
if (qemuDomainAgentAvailable(vm, true) < 0)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
if (!priv->agent) {
|
||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
||||
_("QEMU guest agent is not configured"));
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
qemuDomainObjEnterAgent(vm);
|
||||
ret = qemuAgentGetInterfaces(priv->agent, ifaces);
|
||||
|
Loading…
x
Reference in New Issue
Block a user