Linux Container Development
 help / color / mirror / Atom feed
From: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: [PATCH] Skip down interfaces
Date: Wed, 31 Mar 2010 08:01:26 -0700	[thread overview]
Message-ID: <1270047686-28404-1-git-send-email-danms@us.ibm.com> (raw)

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

             reply	other threads:[~2010-03-31 15:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31 15:01 Dan Smith [this message]
     [not found] ` <1270047686-28404-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 16:13   ` [PATCH] Skip down interfaces Serge E. Hallyn
     [not found]     ` <20100331161353.GA15339-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 16:17       ` Dan Smith

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=1270047686-28404-1-git-send-email-danms@us.ibm.com \
    --to=danms-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.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