Re: [PATCH] virsh: fix regression in 'virsh event' by domain

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

 



On Tue, Apr 14, 2015 at 04:24:13PM -0600, Eric Blake wrote:
> Commit a0670ae caused a regression in 'virsh event' and
> 'virsh qemu-monitor-event' - if a user tries to filter the
> command to a specific domain, an error message is printed:
> 
> $ virsh event dom --loop
> error: internal error: virsh qemu-monitor-event: no domain VSH_OT_DATA option
> 
> and then the command continues as though no domain had been
> supplied (giving events for ALL domains, instead of the
> requested one).  This is because the code was incorrectly
> assuming that all "domain" options would be supplied via a
> mandatory VSH_OT_DATA, even though "domain" is optional for
> these two commands, so we had changed them to VSH_OT_STRING
> to quit failing for other reasons (ever since it was decided
> that VSH_OT_DATA and VSH_OT_STRING should no longer be
> synonyms).
> 
> In looking at the situation, though, the code for looking up
> a domain was making a pointless check for whether the option
> exists prior to finding the option's string value, as
> vshCommandOptStringReq does just fine at reporting any errors
> when looking up a string whether or not the option was present.
> 
> So this is a case of regression fixing by pure code deletion :)
> 
> * tools/virsh-domain.c (vshCommandOptDomainBy): Drop useless filter.
> * tools/virsh-interface.c (vshCommandOptInterfaceBy): Likewise.
> * tools/virsh-network.c (vshCommandOptNetworkBy): Likewise.
> * tools/virsh-nwfilter.c (vshCommandOptNWFilterBy): Likewise.
> * tools/virsh-secret.c (vshCommandOptSecret): Likewise.
> * tools/virsh.h (vshCmdHasOption): Drop unused function.
> * tools/virsh.c (vshCmdHasOption): Likewise.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
>  tools/virsh-domain.c    |  3 ---
>  tools/virsh-interface.c |  2 --
>  tools/virsh-network.c   |  3 ---
>  tools/virsh-nwfilter.c  |  5 +----
>  tools/virsh-secret.c    |  5 +----
>  tools/virsh.c           | 23 -----------------------
>  tools/virsh.h           |  2 --
>  7 files changed, 2 insertions(+), 41 deletions(-)
> 

ACK

Jan

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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]