From: Evan Broder Date: Wed, 22 Oct 2008 04:48:44 +0000 (-0400) Subject: There's a race condition for if the VM gets powered off between the X-Git-Tag: sipb-xen-remote-server/0.10.2^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/commitdiff_plain/refs/tags/sipb-xen-remote-server/0.10.2?hp=2fabd07be29a666c3e4e21d35950713802901c93 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 --- 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