All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Cully <brendan@cs.ubc.ca>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Xen Developers <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 07 of 10] Add new shutdown mode for checkpoint
Date: Fri, 12 Jan 2007 15:58:35 -0800	[thread overview]
Message-ID: <20070112235835.GA31491@ventoux.cs.ubc.ca> (raw)
In-Reply-To: <C1B9A6A6.6598%Keir.Fraser@cl.cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

On Thursday, 28 December 2006 at 16:51, Keir Fraser wrote:
> On 15/12/06 6:38 am, "Brendan Cully" <brendan@cs.ubc.ca> wrote:
> 
> > Add new shutdown mode for checkpoint.
> > 
> > When control/shutdown = checkpoint, invoke an alternate suspend path
> > that doesn't disconnect from back ends, and only reconnects when the
> > image has been restored into a new domain.
> 
> I don't think a new type of 'checkpoint' handler is required in the guest
> OS. We are already most of the way there in terms of doing as little as
> possible on the suspend side of save/restore, so we should fix up what
> little else there is to be done. Looking at the differences versus your new
> checkpointing suspend:
>  1. Xenbus_suspend() needs to stay. Actually most drivers do not have a
> suspend handler anyway (only tpmfront does). We should provide a
> suspend_cancelled() hook callback so that drivers which *do* have a suspend
> handler can distinguish between proper resume and checkpoint return.

I guess this is what you had in mind? I don't have anything that uses
it at the moment though. It's just suspend_dev cut'n'pasted.

[-- Attachment #2: unsuspend.diff --]
[-- Type: text/plain, Size: 2091 bytes --]

# HG changeset patch
# User Brendan Cully <brendan@cs.ubc.ca>
# Date 1168646163 28800
# Node ID f6c3f5b0be95efeb0c47318bc6608310cd49c804
# Parent  4fc2fde1b3737554edd795e65701292d8320405d
Add unsuspend hook for resuming devices in the checkpoint parent.

Nothing uses it at the moment.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>

diff -r 4fc2fde1b373 -r f6c3f5b0be95 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Jan 12 15:02:24 2007 -0800
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Fri Jan 12 15:56:03 2007 -0800
@@ -672,6 +672,26 @@ static int suspend_dev(struct device *de
 	return 0;
 }
 
+static int unsuspend_dev(struct device *dev, void *data)
+{
+	int err = 0;
+	struct xenbus_driver *drv;
+	struct xenbus_device *xdev;
+
+	DPRINTK("");
+
+	if (dev->driver == NULL)
+		return 0;
+	drv = to_xenbus_driver(dev->driver);
+	xdev = container_of(dev, struct xenbus_device, dev);
+	if (drv->unsuspend)
+		err = drv->unsuspend(xdev);
+	if (err)
+		printk(KERN_WARNING
+		       "xenbus: unsuspend %s failed: %i\n", dev->bus_id, err);
+	return 0;
+}
+
 static int resume_dev(struct device *dev, void *data)
 {
 	int err;
@@ -735,6 +755,9 @@ void xenbus_resume(int reconnect)
 
 	if (reconnect) {
 		bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL, resume_dev);
+	} else {
+		bus_for_each_dev(&xenbus_frontend.bus, NULL, NULL,
+				 unsuspend_dev);
 	}
 	xenbus_backend_resume(resume_dev);
 }
diff -r 4fc2fde1b373 -r f6c3f5b0be95 linux-2.6-xen-sparse/include/xen/xenbus.h
--- a/linux-2.6-xen-sparse/include/xen/xenbus.h	Fri Jan 12 15:02:24 2007 -0800
+++ b/linux-2.6-xen-sparse/include/xen/xenbus.h	Fri Jan 12 15:56:03 2007 -0800
@@ -101,6 +101,7 @@ struct xenbus_driver {
 				 enum xenbus_state backend_state);
 	int (*remove)(struct xenbus_device *dev);
 	int (*suspend)(struct xenbus_device *dev);
+	int (*unsuspend)(struct xenbus_device *dev);
 	int (*resume)(struct xenbus_device *dev);
 	int (*uevent)(struct xenbus_device *, char **, int, char *, int);
 	struct device_driver driver;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2007-01-12 23:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-15  6:38 [PATCH 00 of 10] Teach xm save to checkpoint a running domain Brendan Cully
2006-12-15  6:38 ` [PATCH 01 of 10] Add resumedomain domctl to resume a domain after checkpoint Brendan Cully
2006-12-15  6:38 ` [PATCH 02 of 10] Export resumedomain domctl to libxc Brendan Cully
2006-12-15  6:38 ` [PATCH 03 of 10] Export xc_domain_resume to xend Brendan Cully
2006-12-15  6:38 ` [PATCH 04 of 10] Add XS_RESUME command Brendan Cully
2006-12-15  6:38 ` [PATCH 05 of 10] Export XS_RESUME to xend Brendan Cully
2006-12-15  6:38 ` [PATCH 06 of 10] Make suspend hypercall return 1 when the domain has been resumed Brendan Cully
2006-12-15  6:38 ` [PATCH 07 of 10] Add new shutdown mode for checkpoint Brendan Cully
2006-12-28 16:51   ` Keir Fraser
2007-01-12  1:25     ` Brendan Cully
2007-01-12 23:58     ` Brendan Cully [this message]
2006-12-15  6:38 ` [PATCH 08 of 10] Add xm save -c/--checkpoint option Brendan Cully
2006-12-15  6:38 ` [PATCH 09 of 10] Advertise address of grant table shared pages in suspend record Brendan Cully
2006-12-15  6:38 ` [PATCH 10 of 10] Ignore safe foreign maps in xc_linux_save Brendan Cully
2006-12-15  8:07 ` [PATCH 00 of 10] Teach xm save to checkpoint a running domain Steven Hand
2006-12-16  0:04   ` Brendan Cully
2006-12-20 10:01     ` [PATCH 00 of 10] Teach xm save to checkpoint a Yoshiaki Tamura
2007-01-09 21:33       ` Brendan Cully
2007-01-12  0:56         ` Yoshiaki Tamura

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=20070112235835.GA31491@ventoux.cs.ubc.ca \
    --to=brendan@cs.ubc.ca \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /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.