From: Fam Zheng <famz@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: Re: [Qemu-devel] [PATCH v2] docker: Don't enable networking as a side-effect of DEBUG=1
Date: Fri, 14 Jul 2017 20:12:23 +0800 [thread overview]
Message-ID: <20170714121223.GH18687@lemon> (raw)
In-Reply-To: <20170714115200.GE28095@redhat.com>
On Fri, 07/14 12:52, Daniel P. Berrange wrote:
> > > > > @@ -132,7 +134,8 @@ docker-run: docker-qemu-src
> > > > > $(SRC_PATH)/tests/docker/docker.py run \
> > > > > $(if $(NOUSER),,-u $(shell id -u)) -t \
> > > > > $(if $V,,--rm) \
> > > > > - $(if $(DEBUG),-i,--net=none) \
> > > > > + $(if $(DEBUG),-i,) \
> > > > > + $(if $(NETWORK),$(if $(subst $(NETWORK),,1)$(subst 1,,$(NETWORK)),--net=$(NETWORK),),--net=none) \
> > > >
> > > > Isn't the first subst enough? We already know $(NETWORK) is non-empty. If it is
> > > > "1", $(subst 1,,1) is empty; otherwise, $(subst foo,,1) is non-empty:
> > > >
> > > > $(if $(NETWORK),$(if $(subst $(NETWORK),,1),,--net=$(NETWORK)),--net=none) \
> > >
> > > This looks inverted to me - NETWORK=1, will generate --net=1 and
> > > NETWORK=foo generates empty string.
> >
> > You are right, I was confused (subst succeed is FALSE branch of if). I think
> > s/,,/,/ and it will work?
>
> Yep
OK, so dropping the second "$(subst ...)" and the comma we have:
$(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \
With that, queued for 2.10:
https://github.com/famz/qemu/tree/staging
Fam
prev parent reply other threads:[~2017-07-14 12:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-13 14:43 [Qemu-devel] [PATCH v2] docker: Don't enable networking as a side-effect of DEBUG=1 Daniel P. Berrange
2017-07-14 2:29 ` Fam Zheng
2017-07-14 11:41 ` Daniel P. Berrange
2017-07-14 11:50 ` Fam Zheng
2017-07-14 11:52 ` Daniel P. Berrange
2017-07-14 12:12 ` Fam Zheng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170714121223.GH18687@lemon \
--to=famz@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=f4bug@amsat.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).