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

qemu: monitor cleanup delvm error handling

Drop redundant NULL checks, and add an error string prefix
Acked-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NCole Robinson <crobinso@redhat.com>
上级 a82c1821
...@@ -259,16 +259,17 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name) ...@@ -259,16 +259,17 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name)
if (qemuMonitorHMPCommand(mon, cmd, &reply)) if (qemuMonitorHMPCommand(mon, cmd, &reply))
goto cleanup; goto cleanup;
if (strstr(reply, "No block device supports snapshots") != NULL) { if (strstr(reply, "No block device supports snapshots")) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("this domain does not have a device to delete snapshots")); _("this domain does not have a device to delete snapshots"));
goto cleanup; goto cleanup;
} else if (strstr(reply, "Snapshots not supported on device") != NULL) { } else if (strstr(reply, "Snapshots not supported on device")) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply); virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply);
goto cleanup; goto cleanup;
} else if (strstr(reply, "Error") != NULL } else if (strstr(reply, "Error") &&
&& strstr(reply, "while deleting snapshot") != NULL) { strstr(reply, "while deleting snapshot")) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply); virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to delete snapshot: %s"), reply);
goto cleanup; goto cleanup;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册