From d7f33e5a8eba8e45cb5ad588a644a5482e82f7d4 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Wed, 22 Oct 2008 00:48:44 -0400 Subject: [PATCH] There's a race condition for if the VM gets powered off between the listvms and the actual request. Solve the problem correctly by using a non-conflicting error code to indicate an invalid command svn path=/trunk/packages/sipb-xen-remote-server/; revision=1163 --- debian/changelog | 8 ++++++++ files/usr/sbin/sipb-xen-remote-control | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8d0fb11..fad2818 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +sipb-xen-remote-server (0.10.2) unstable; urgency=low + + * There's a race condition for if the VM gets powered off between the + listvms and the actual request. Solve the problem correctly by using a + non-conflicting error code to indicate an invalid command + + -- Evan Broder Wed, 22 Oct 2008 00:46:38 -0400 + sipb-xen-remote-server (0.10.1) unstable; urgency=low * Make both list-host and listhost valid commands, and for parity with diff --git a/files/usr/sbin/sipb-xen-remote-control b/files/usr/sbin/sipb-xen-remote-control index 3ee3e70..6d30d71 100755 --- a/files/usr/sbin/sipb-xen-remote-control +++ b/files/usr/sbin/sipb-xen-remote-control @@ -30,8 +30,11 @@ def main(argv): stdout=PIPE, stderr=PIPE) (out, err) = p.communicate() if p.returncode == 1: - print >>sys.stderr, "ERROR: invalid command" + print >>sys.stderr, "machine '%s' is not on" % machine_name return 1 + elif p.returncode == 34: + print >>sys.stderr, "ERROR: invalid command" + return 34 sys.stderr.write(err) sys.stdout.write(out) return p.returncode -- 1.7.9.5