diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-09-08 10:55:09 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-09-08 10:55:09 +0100 |
commit | a2567b2631fa9659ebb95b7ae6d08f09f96b65ec (patch) | |
tree | ec30ae034f4bce0133dccc59595e1195aea73fa7 /tools/xcutils/xc_save.c | |
parent | 406b8494bb6b72abd13da118da1f4c82433e4de8 (diff) | |
download | xen-a2567b2631fa9659ebb95b7ae6d08f09f96b65ec.tar.gz xen-a2567b2631fa9659ebb95b7ae6d08f09f96b65ec.tar.bz2 xen-a2567b2631fa9659ebb95b7ae6d08f09f96b65ec.zip |
xc_save: Janitorial work.
Remove an unused variable.
Replace errx by warnx when cleanup code follows.
From: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/xcutils/xc_save.c')
-rw-r--r-- | tools/xcutils/xc_save.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c index 3826fbb125..d965e0220f 100644 --- a/tools/xcutils/xc_save.c +++ b/tools/xcutils/xc_save.c @@ -71,7 +71,7 @@ static int suspend_evtchn_init(int xc, int domid) xs = xs_daemon_open(); if (!xs) { - errx(1, "failed to get xenstore handle"); + warnx("failed to get xenstore handle"); return -1; } sprintf(path, "/local/domain/%d/device/suspend/event-channel", domid); @@ -88,20 +88,19 @@ static int suspend_evtchn_init(int xc, int domid) si.xce = xc_evtchn_open(); if (si.xce < 0) { - errx(1, "failed to open event channel handle"); + warnx("failed to open event channel handle"); goto cleanup; } si.suspend_evtchn = xc_evtchn_bind_interdomain(si.xce, domid, port); if (si.suspend_evtchn < 0) { - errx(1, "failed to bind suspend event channel: %d", - si.suspend_evtchn); + warnx("failed to bind suspend event channel: %d", si.suspend_evtchn); goto cleanup; } rc = xc_domain_subscribe_for_suspend(xc, domid, port); if (rc < 0) { - errx(1, "failed to subscribe to domain: %d", rc); + warnx("failed to subscribe to domain: %d", rc); goto cleanup; } @@ -118,27 +117,25 @@ static int suspend_evtchn_init(int xc, int domid) * receive the acknowledgement from the subscribe event channel. */ static int evtchn_suspend(int domid) { - int xcefd; int rc; rc = xc_evtchn_notify(si.xce, si.suspend_evtchn); if (rc < 0) { - errx(1, "failed to notify suspend request channel: %d", rc); + warnx("failed to notify suspend request channel: %d", rc); return 0; } - xcefd = xc_evtchn_fd(si.xce); do { rc = xc_evtchn_pending(si.xce); if (rc < 0) { - errx(1, "error polling suspend notification channel: %d", rc); + warnx("error polling suspend notification channel: %d", rc); return 0; } } while (rc != si.suspend_evtchn); /* harmless for one-off suspend */ if (xc_evtchn_unmask(si.xce, si.suspend_evtchn) < 0) - errx(1, "failed to unmask suspend notification channel: %d", rc); + warnx("failed to unmask suspend notification channel: %d", rc); /* notify xend that it can do device migration */ printf("suspended\n"); @@ -195,11 +192,9 @@ static void qemu_flip_buffer(int domid, int next_active) /* Tell qemu that we want it to start writing log-dirty bits to the * other buffer */ - if (!xs_write(xs, XBT_NULL, qemu_next_active_path, &digit, 1)) { + if (!xs_write(xs, XBT_NULL, qemu_next_active_path, &digit, 1)) errx(1, "can't write next-active to store path (%s)\n", - qemu_next_active_path); - exit(1); - } + qemu_next_active_path); /* Wait a while for qemu to signal that it has switched to the new * active buffer */ @@ -208,10 +203,8 @@ static void qemu_flip_buffer(int domid, int next_active) tv.tv_usec = 0; FD_ZERO(&fdset); FD_SET(xs_fileno(xs), &fdset); - if ((select(xs_fileno(xs) + 1, &fdset, NULL, NULL, &tv)) != 1) { + if ((select(xs_fileno(xs) + 1, &fdset, NULL, NULL, &tv)) != 1) errx(1, "timed out waiting for qemu to switch buffers\n"); - exit(1); - } watch = xs_read_watch(xs, &len); free(watch); |