]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix vncdisplay command in virsh
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 2 Mar 2007 14:22:33 +0000 (14:22 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 2 Mar 2007 14:22:33 +0000 (14:22 +0000)
ChangeLog
src/virsh.c

index aa597fce111dd3c58462b49a3c88642d08fdbf61..a7685ac65aba90262d02dc84735b0006ae4fb5c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-Thu Mar 01 18;22:23 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+Fri Mar 02 09:21:23 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+       * src/virsh.c: Fix output of VNC display in the case where
+       there is no explicit listen attribute in the XML
+
+Thu Mar 01 18:22:23 EST 2007 Daniel P. Berrange <berrange@redhat.com>
 
        * src/xend_internal.c: Instead of looking for string 'Cannot'
        in POST response, look for 'xend.err' which is likely to catch
index 14b402e579bc831b75ed3ed7112ca3760c2adb18..f64dee51fdc4dee64be676b449e4599ffe30e7ff 100644 (file)
@@ -2313,10 +2313,8 @@ cmdVNCDisplay(vshControl * ctl, vshCmd * cmd)
 
     obj = xmlXPathEval(BAD_CAST "string(/domain/devices/graphics[@type='vnc']/@listen)", ctxt);
     if ((obj == NULL) || (obj->type != XPATH_STRING) ||
-        (obj->stringval == NULL) || (obj->stringval[0] == 0)) {
-        goto cleanup;
-    }
-    if (!strcmp((const char*)obj->stringval, "0.0.0.0")) {
+        (obj->stringval == NULL) || (obj->stringval[0] == 0) ||
+        !strcmp((const char*)obj->stringval, "0.0.0.0")) {
         vshPrint(ctl, ":%d\n", port-5900);
     } else {
         vshPrint(ctl, "%s:%d\n", (const char *)obj->stringval, port-5900);