* [PATCH] Skip down interfaces
@ 2010-03-31 15:01 Dan Smith
[not found] ` <1270047686-28404-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Dan Smith @ 2010-03-31 15:01 UTC (permalink / raw)
To: containers-qjLDD68F18O7TbgM5vRIOg
This makes the netns checkpoint code skip interfaces that are not up.
Later, we want to make it possible to checkpoint down interfaces with
a flag, but for now this helps prevent people from getting stuck on
stock kernels with various unsupported and persistent virtual interfaces,
such as tunnel devices.
Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
---
net/checkpoint_dev.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/net/checkpoint_dev.c b/net/checkpoint_dev.c
index bc0415d..1e053f9 100644
--- a/net/checkpoint_dev.c
+++ b/net/checkpoint_dev.c
@@ -268,7 +268,13 @@ int checkpoint_netns(struct ckpt_ctx *ctx, void *ptr)
goto out;
for_each_netdev(net, dev) {
- ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
+ if (dev->flags & IFF_UP)
+ ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
+ else
+ /* TODO: There should be a flag to enable checkpoint
+ * of downed interfaces
+ */
+ ret = 0;
if (ret < 0)
break;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1270047686-28404-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] Skip down interfaces [not found] ` <1270047686-28404-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2010-03-31 16:13 ` Serge E. Hallyn [not found] ` <20100331161353.GA15339-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Serge E. Hallyn @ 2010-03-31 16:13 UTC (permalink / raw) To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg Quoting Dan Smith (danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org): > This makes the netns checkpoint code skip interfaces that are not up. > Later, we want to make it possible to checkpoint down interfaces with > a flag, but for now this helps prevent people from getting stuck on > stock kernels with various unsupported and persistent virtual interfaces, > such as tunnel devices. > > Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> Tested-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> Now this really is only a problem for devices which use register_pernet_device() right? Could/should we add a flag to such devices, and only skip those when they're down? Or, can we detect whether the device has a checkpoint operation, checkpoint it if so regardless, and, if not, if it is down, skip it? Mind you if noone minds this patch (for now) then it works for me. thanks, -serge > Cc: serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org > --- > net/checkpoint_dev.c | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) > > diff --git a/net/checkpoint_dev.c b/net/checkpoint_dev.c > index bc0415d..1e053f9 100644 > --- a/net/checkpoint_dev.c > +++ b/net/checkpoint_dev.c > @@ -268,7 +268,13 @@ int checkpoint_netns(struct ckpt_ctx *ctx, void *ptr) > goto out; > > for_each_netdev(net, dev) { > - ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV); > + if (dev->flags & IFF_UP) > + ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV); > + else > + /* TODO: There should be a flag to enable checkpoint > + * of downed interfaces > + */ > + ret = 0; > if (ret < 0) > break; > } > -- > 1.6.2.5 ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20100331161353.GA15339-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] Skip down interfaces [not found] ` <20100331161353.GA15339-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2010-03-31 16:17 ` Dan Smith 0 siblings, 0 replies; 3+ messages in thread From: Dan Smith @ 2010-03-31 16:17 UTC (permalink / raw) To: Serge E. Hallyn; +Cc: containers-qjLDD68F18O7TbgM5vRIOg SH> Or, can we detect whether the device has a checkpoint operation, SH> checkpoint it if so regardless, and, if not, if it is down, skip SH> it? Oh, you know what... I originally had it so that it only skips interfaces that are down *and* unsupported. However, I swizzled it after that and didn't preserve that logic. Let me re-swizzle and I'll post again. -- Dan Smith IBM Linux Technology Center email: danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-31 16:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-31 15:01 [PATCH] Skip down interfaces Dan Smith
[not found] ` <1270047686-28404-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 16:13 ` Serge E. Hallyn
[not found] ` <20100331161353.GA15339-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 16:17 ` Dan Smith
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.