From: Ian Jackson <ian.jackson@citrix.com>
To: Paul Durrant <paul@xen.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Paul Durrant <pdurrant@amazon.com>, Wei Liu <wl@xen.org>,
Ian Jackson <Ian.Jackson@citrix.com>
Subject: Re: [PATCH v2 1/4] tools/hotplug: add remove_from_bridge() and improve debug output
Date: Tue, 4 Aug 2020 12:06:41 +0100 [thread overview]
Message-ID: <24361.16705.741010.285482@mariner.uk.xensource.com> (raw)
In-Reply-To: <20200803124931.2678-2-paul@xen.org>
Paul Durrant writes ("[PATCH v2 1/4] tools/hotplug: add remove_from_bridge() and improve debug output"):
> From: Paul Durrant <pdurrant@amazon.com>
>
> This patch adds a remove_from_bridge() function into xen-network-common.sh
> to partner with the existing add_to_bridge() function. The code in
> add_to_bridge() is also slightly re-arranged to avoid duplication calls of
> 'ip link'.
>
> Both add_to_bridge() and remove_from_bridge() will check if their bridge
> manipulation operations are necessary and emit a log message if they are not.
>
> NOTE: A call to remove_from_bridge() will be added by a subsequent patch.
I think there is another semantic change here which is that now it
executes the "ip link set up" even if the device is already on the
bridge.
I think this is correct, but it probably ought to be mentioned in the
commit message.
I hesitate to suggest this, but: my personal preference would have
been to split that refactoring (in particular, the inversion of the
early exit if approach) into yet another commit. I find tiny commits
easier to review. But this commit is already quite small so if you
prefer to keep it this way I think that is fine.
> +remove_from_bridge () {
> + local bridge=$1
> + local dev=$2
> +
> + ip link set dev ${dev} down || :
> +
> + # Don't remove $dev from $bridge if it's not on the bridge.
> + if [ -e "/sys/class/net/${bridge}/brif/${dev}" ]; then
> + log debug "removing $dev from bridge $bridge"
> + if which brctl >&/dev/null; then
> + brctl delif ${bridge} ${dev}
> + else
> + ip link set ${dev} nomaster
> + fi
> + else
> + log debug "$dev not on bridge $bridge"
> + fi
> +}
I think this is code motion split into two patches - here the added
code and in 2/, the other copy is removed. Could you please shuffle
this addition into patch 2 ?
Thanks,
Ian.
next prev parent reply other threads:[~2020-08-04 11:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-03 12:49 [PATCH v2 0/4] tools: propagate bridge MTU to vif frontends Paul Durrant
2020-08-03 12:49 ` [PATCH v2 1/4] tools/hotplug: add remove_from_bridge() and improve debug output Paul Durrant
2020-08-04 11:06 ` Ian Jackson [this message]
2020-08-03 12:49 ` [PATCH v2 2/4] tools/hotplug: combine add/online and remove/offline in vif-bridge Paul Durrant
2020-08-04 11:08 ` Ian Jackson
2020-08-03 12:49 ` [PATCH v2 3/4] public/io/netif: specify MTU override node Paul Durrant
2020-08-04 11:10 ` Ian Jackson
2020-08-03 12:49 ` [PATCH v2 4/4] tools/hotplug: modify set_mtu() to inform the frontend via xenstore Paul Durrant
2020-08-04 11:13 ` Ian Jackson
2020-08-04 11:20 ` Paul Durrant
2020-08-04 11:35 ` Ian Jackson
2020-08-04 13:31 ` Paul Durrant
2020-08-05 9:30 ` Ian Jackson
2020-08-05 9:44 ` Durrant, Paul
2020-08-05 10:13 ` Ian Jackson
2020-08-05 10:42 ` Durrant, Paul
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=24361.16705.741010.285482@mariner.uk.xensource.com \
--to=ian.jackson@citrix.com \
--cc=paul@xen.org \
--cc=pdurrant@amazon.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.