]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: domsetlaunchsecstate: report error if no options are passed
authorJán Tomko <jtomko@redhat.com>
Wed, 26 Jan 2022 12:25:44 +0000 (13:25 +0100)
committerJán Tomko <jtomko@redhat.com>
Mon, 31 Jan 2022 12:38:11 +0000 (13:38 +0100)
We already exit if they are not present.

Report an error, but do not mark them as required in case a future
version of this command will want to accept a different set of
parameters.

https://bugzilla.redhat.com/show_bug.cgi?id=2046024

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain.c

index b56f6a90f5fa5e98c796a97041a72c9031327885..43d310f2afbe3d76a3fd8d09e5f67ab3e50e5fb9 100644 (file)
@@ -9627,8 +9627,10 @@ cmdDomSetLaunchSecState(vshControl * ctl, const vshCmd * cmd)
     if (vshCommandOptStringReq(ctl, cmd, "secret", &secfile) < 0)
         return false;
 
-    if (sechdrfile == NULL || secfile == NULL)
+    if (sechdrfile == NULL || secfile == NULL) {
+        vshError(ctl, "%s", _("Both secret and the secret header are required"));
         return false;
+    }
 
     if (virFileReadAll(sechdrfile, 1024*64, &sechdr) < 0) {
         vshSaveLibvirtError();