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

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



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 redhat com>
> ---
>  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


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