提交 faa8bf10 编写于 作者: C Charles Duffy 提交者: Chris Lalancette

prevent attempt to call cat -c during virDomainSave to raw

This was prevent virDomainSave from working properly by default,
which is a bad thing.
Signed-off-by: NChris Lalancette <clalance@redhat.com>
上级 58df0daa
......@@ -3906,17 +3906,26 @@ static int qemudDomainSave(virDomainPtr dom,
goto cleanup;
}
const char *prog = qemudSaveCompressionTypeToString(header.compressed);
if (prog == NULL) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
_("Invalid compress format %d"), header.compressed);
goto cleanup;
}
{
const char *prog = qemudSaveCompressionTypeToString(header.compressed);
const char *args;
if (STREQ (prog, "raw"))
prog = "cat";
internalret = virAsprintf(&command, "migrate \"exec:"
"%s -c >> '%s' 2>/dev/null\"", prog, safe_path);
if (prog == NULL) {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
_("Invalid compress format %d"), header.compressed);
goto cleanup;
}
if (STREQ (prog, "raw")) {
prog = "cat";
args = "";
} else {
args = "-c";
}
internalret = virAsprintf(&command, "migrate \"exec:"
"%s %s >> '%s' 2>/dev/null\"", prog, args,
safe_path);
}
if (internalret < 0) {
virReportOOMError(dom->conn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册