WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xc_save: Janitorial work.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xc_save: Janitorial work.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 08 Sep 2008 12:40:08 -0700
Delivery-date: Mon, 08 Sep 2008 12:39:54 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1220867709 -3600
# Node ID b146f0cf3b8bcb5e2c5c8c0276c4829baf3e3192
# Parent  be573a356c90c0344a1986e760e54f6017f1fada
xc_save: Janitorial work.

Remove an unused variable.
Replace errx by warnx when cleanup code follows.

From: Brendan Cully <brendan@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/xcutils/xc_save.c |   27 ++++++++++-----------------
 1 files changed, 10 insertions(+), 17 deletions(-)

diff -r be573a356c90 -r b146f0cf3b8b tools/xcutils/xc_save.c
--- a/tools/xcutils/xc_save.c   Fri Sep 05 11:56:35 2008 +0100
+++ b/tools/xcutils/xc_save.c   Mon Sep 08 10:55:09 2008 +0100
@@ -71,7 +71,7 @@ static int suspend_evtchn_init(int xc, i
 
     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, i
 
     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, i
  * 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, 
 
     /* 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, 
     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);
     

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xc_save: Janitorial work., Xen patchbot-unstable <=