提交 0ace4d98 编写于 作者: M Michal Privoznik

qemuDomainRename: Explicitly check if domain is renaming to itself

It may happen that user (mistakenly) wants to rename a domain to
itself. Which is no renaming at all. We should reject that with
some meaningful error message.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 1dc25872
......@@ -19937,6 +19937,12 @@ static int qemuDomainRename(virDomainPtr dom,
goto endjob;
}
if (STREQ(vm->def->name, new_name)) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Can't rename domain to itself"));
goto cleanup;
}
if (VIR_STRDUP(new_dom_name, new_name) < 0)
goto endjob;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册