提交 b0a2ba24 编写于 作者: C Cole Robinson

qemu: Remove redundant DomainObjIsActive calls

The common idiom in the driver API implementations is roughly:

- ACL check
- BeginJob (if needed)
- AgentAvailable (if needed)
- !IsActive

A few calls had an extra !IsActive before BeginJob, which doesn't
seem to serve much use. Drop them
上级 27f2b747
......@@ -1884,12 +1884,6 @@ static int qemuDomainSuspend(virDomainPtr dom)
if (virDomainSuspendEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
cfg = virQEMUDriverGetConfig(driver);
priv = vm->privateData;
......@@ -2566,12 +2560,6 @@ static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags)
if (virDomainInjectNMIEnsureACL(domain->conn, vm->def) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
priv = vm->privateData;
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
......@@ -15903,12 +15891,6 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
if (virDomainQemuMonitorCommandEnsureACL(domain->conn, vm->def) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
......@@ -18512,12 +18494,6 @@ qemuDomainFSTrim(virDomainPtr dom,
if (virDomainFSTrimEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto cleanup;
}
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册