diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-07-04 12:39:18 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-07-04 12:39:18 +0100 |
commit | 52d9d32d02078742805861e7152c45b03209ebab (patch) | |
tree | 336ff7656ef06cbf4f2ce569093a010973e59bb6 /tools | |
parent | ddfd61bd7e71b4ad602da69473586d072017992b (diff) | |
download | xen-52d9d32d02078742805861e7152c45b03209ebab.tar.gz xen-52d9d32d02078742805861e7152c45b03209ebab.tar.bz2 xen-52d9d32d02078742805861e7152c45b03209ebab.zip |
Cleanups to suspend-event-channel patches.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxc/xc_domain.c | 3 | ||||
-rw-r--r-- | tools/libxc/xenctrl.h | 3 | ||||
-rw-r--r-- | tools/xcutils/xc_save.c | 21 |
3 files changed, 7 insertions, 20 deletions
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index b4d7895801..f46fe4a671 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -981,7 +981,8 @@ int xc_domain_set_target( return do_domctl(xc_handle, &domctl); } -int xc_dom_subscribe(int xc_handle, domid_t dom, evtchn_port_t port) +int xc_domain_subscribe_for_suspend( + int xc_handle, domid_t dom, evtchn_port_t port) { DECLARE_DOMCTL; diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h index cbe6bf8536..bb10ead825 100644 --- a/tools/libxc/xenctrl.h +++ b/tools/libxc/xenctrl.h @@ -814,7 +814,8 @@ int xc_flask_op(int xc_handle, flask_op_t *op); * Subscribe to state changes in a domain via evtchn. * Returns -1 on failure, in which case errno will be set appropriately. */ -int xc_dom_subscribe(int xc_handle, domid_t domid, evtchn_port_t port); +int xc_domain_subscribe_for_suspend( + int xc_handle, domid_t domid, evtchn_port_t port); /************************** * GRANT TABLE OPERATIONS * diff --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c index c72500a700..3826fbb125 100644 --- a/tools/xcutils/xc_save.c +++ b/tools/xcutils/xc_save.c @@ -25,9 +25,7 @@ static struct suspendinfo { int xce; /* event channel handle */ - int suspend_evtchn; - int suspended_evtchn; } si; /** @@ -47,11 +45,6 @@ static int compat_suspend(int domid) static int suspend_evtchn_release(int xc, int domid) { - if (si.suspended_evtchn >= 0) { - xc_dom_subscribe(xc, domid, 0); - xc_evtchn_unbind(si.xce, si.suspended_evtchn); - si.suspended_evtchn = -1; - } if (si.suspend_evtchn >= 0) { xc_evtchn_unbind(si.xce, si.suspend_evtchn); si.suspend_evtchn = -1; @@ -75,7 +68,6 @@ static int suspend_evtchn_init(int xc, int domid) si.xce = -1; si.suspend_evtchn = -1; - si.suspended_evtchn = -1; xs = xs_daemon_open(); if (!xs) { @@ -107,14 +99,7 @@ static int suspend_evtchn_init(int xc, int domid) goto cleanup; } - si.suspended_evtchn = xc_evtchn_bind_unbound_port(si.xce, domid); - if (si.suspended_evtchn < 0) { - errx(1, "failed to allocate suspend notification port: %d", - si.suspended_evtchn); - goto cleanup; - } - - rc = xc_dom_subscribe(xc, domid, si.suspended_evtchn); + rc = xc_domain_subscribe_for_suspend(xc, domid, port); if (rc < 0) { errx(1, "failed to subscribe to domain: %d", rc); goto cleanup; @@ -149,10 +134,10 @@ static int evtchn_suspend(int domid) errx(1, "error polling suspend notification channel: %d", rc); return 0; } - } while (rc != si.suspended_evtchn); + } while (rc != si.suspend_evtchn); /* harmless for one-off suspend */ - if (xc_evtchn_unmask(si.xce, si.suspended_evtchn) < 0) + if (xc_evtchn_unmask(si.xce, si.suspend_evtchn) < 0) errx(1, "failed to unmask suspend notification channel: %d", rc); /* notify xend that it can do device migration */ |