From 6e760fb6d77ac117d9ba82498d19ceaafcec98eb Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 2 Mar 2007 14:22:33 +0000 Subject: [PATCH] Fix vncdisplay command in virsh --- ChangeLog | 7 ++++++- src/virsh.c | 6 ++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa597fce11..a7685ac65a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -Thu Mar 01 18;22:23 EST 2007 Daniel P. Berrange +Fri Mar 02 09:21:23 EST 2007 Daniel P. Berrange + + * 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 * src/xend_internal.c: Instead of looking for string 'Cannot' in POST response, look for 'xend.err' which is likely to catch diff --git a/src/virsh.c b/src/virsh.c index 14b402e579..f64dee51fd 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -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); -- GitLab