[libvirt] [PATCH 02/13] virsh: cmdBlockJob: Switch to declarative flag interlocking
Peter Krempa
pkrempa at redhat.com
Tue Jul 21 12:08:31 UTC 2015
On Mon, Jul 20, 2015 at 15:23:15 -0600, Eric Blake wrote:
> 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?
It probably will. We should seriously stop supporting that, but for now
I'll leave it as abortMode and tweak the VSH_EXCLUSIVE_OPTIONS_VAR to
VSH_EXCLUSIVE_OPTIONS in cases where 'abort' would be mentioned.
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150721/cd4c22ae/attachment-0001.sig>
More information about the libvir-list
mailing list