Re: [libvirt PATCH] virsh: domsetlaunchsecstate: mark options as mandatory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/26/22 16:43, Ján Tomko wrote:
> We exit if they are not present.
> 
> Let the virsh option parser do the checking instead of checking
> it manually. Change the type to OT_DATA (i.e. a mandatory string),
> mark them as required and remove VSH_OFLAG_REQ_OPT so that the
> header file and the secret file can be specified without the option
> names.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=2046024
> 
> Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
> ---
>  tools/virsh-domain.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 


> @@ -9627,9 +9627,6 @@ cmdDomSetLaunchSecState(vshControl * ctl, const vshCmd * cmd)
>      if (vshCommandOptStringReq(ctl, cmd, "secret", &secfile) < 0)
>          return false;
>  
> -    if (sechdrfile == NULL || secfile == NULL)
> -        return false;
> -
>      if (virFileReadAll(sechdrfile, 1024*64, &sechdr) < 0) {
>          vshSaveLibvirtError();
>          return false;

In a follow up patch this check should be reintroduced to qemu driver
impl because there's no way it can work if neither is passed to the API.

But for this patch as is:

Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux