Correcting the error reporting method by using VSH_REQUIRE_OPTION
instead of virReportError
Signed-off-by: Kothapally Madhu Pavan
---
tools/virsh-domain.c |7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 050e7fb..e1cb2ac 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10443,6 +10443,7 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
VSH_EXCLUSIVE_OPTIONS("live", "offline");
VSH_EXCLUSIVE_OPTIONS("timeout-suspend", "timeout-postcopy");
+VSH_REQUIRE_OPTION("postcopy-after-precopy", "postcopy");
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
@@ -10474,12 +10475,6 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd)
}
if (vshCommandOptBool(cmd, "postcopy-after-precopy")) {
-if (!vshCommandOptBool(cmd, "postcopy")) {
-virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("--postcopy-after-precopy can only be used with "
-"--postcopy"));
-goto cleanup;
-}
iterEvent = virConnectDomainEventRegisterAny(
priv->conn, dom,
VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION,
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list