[libvirt] [PATCH 02/13] virsh: cmdBlockJob: Switch to declarative flag interlocking

Eric Blake eblake at redhat.com
Mon Jul 20 21:23:15 UTC 2015


On 07/15/2015 10:33 AM, Peter Krempa wrote:
> Use the VSH_EXCLUSIVE_OPTIONS_VAR to interlock incompatible options
> ---
>  tools/virsh-domain.c | 33 +++++++++++++++++++--------------
>  1 file changed, 19 insertions(+), 14 deletions(-)
> 
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 7a18204..24f53ea 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -2542,26 +2542,31 @@ cmdBlockJob(vshControl *ctl, const vshCmd *cmd)
>      bool ret = false;
>      bool raw = vshCommandOptBool(cmd, "raw");
>      bool bytes = vshCommandOptBool(cmd, "bytes");
> -    bool abortMode = (vshCommandOptBool(cmd, "abort") ||
> -                      vshCommandOptBool(cmd, "async") ||
> -                      vshCommandOptBool(cmd, "pivot"));
> -    bool infoMode = vshCommandOptBool(cmd, "info") || raw;
> +    bool abort = vshCommandOptBool(cmd, "abort");

Will that get you in trouble with older compilers that complain about
local variables shadowing global function names?

Other than that, ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150720/5fe7c6b3/attachment-0001.sig>


More information about the libvir-list mailing list