
I have an old HVM guest defined in 3.0.4, and now I'm running 3.1.2 and libvirt 0.4.0. The config looks like this: (domain (image (hvm (vnc 1) (vncdisplay 0) (device (vfb (location localhost:5900) (vncdisplay 0) (uuid ...) The libvirt code looks like this: 1757 /* Graphics device (HVM <= 3.0.4, or PV <= 3.0.3) vnc config */ 1758 if ((hvm && xendConfigVersion < 4) || 1759 (!hvm && xendConfigVersion < 3)) { 1760 tmp = sexpr_fmt_node(root, "domain/image/%s/vnc", hvm ? "hvm" : "linux"); So we don't see the 'vnc 1' at the top. But the code to parse device/vfb doesn't expect this config either: 1685 tmp = sexpr_node(node, "device/vfb/type"); The patch below replaces the later version check with something that copes correctly with the "upgrade" case. regards john 2008-01-15 John Levon <levon@movementarian.org> * src/xend_internal.c: fix VNC parsing of old Xen domains on newer Xen versions. diff -prauN libvirt-0.4.0/src/xend_internal.c libvirt-new/src/xend_internal.c --- libvirt-0.4.0/src/xend_internal.c 2007-12-17 15:05:27.000000000 -0800 +++ libvirt-new/src/xend_internal.c 2008-01-14 18:42:08.895060570 -0800 @@ -1371,6 +1371,7 @@ xend_parse_sexp_desc(virConnectPtr conn, unsigned char uuid[VIR_UUID_BUFLEN]; char uuidstr[VIR_UUID_STRING_BUFLEN]; int vif_index = 0; + int found_graphics = 0; if (root == NULL) { /* ERROR */ @@ -1683,6 +1684,7 @@ xend_parse_sexp_desc(virConnectPtr conn, if (tmp && !strcmp(tmp, "sdl")) { virBufferVSprintf(&buf, " <input type='mouse' bus='%s'/>\n", hvm ? "ps2": "xen"); virBufferAdd(&buf, " <graphics type='sdl'/>\n", 27); + found_graphics = 1; } else if (tmp && !strcmp(tmp, "vnc")) { int port = xenStoreDomainGetVNCPort(conn, domid); const char *listenAddr = sexpr_node(node, "device/vfb/vnclisten"); @@ -1700,6 +1702,7 @@ xend_parse_sexp_desc(virConnectPtr conn, if (keymap) virBufferVSprintf(&buf, " keymap='%s'", keymap); virBufferAdd(&buf, "/>\n", 3); + found_graphics = 1; } } } @@ -1751,8 +1754,7 @@ xend_parse_sexp_desc(virConnectPtr conn, } /* Graphics device (HVM <= 3.0.4, or PV <= 3.0.3) vnc config */ - if ((hvm && xendConfigVersion < 4) || - (!hvm && xendConfigVersion < 3)) { + if (!found_graphics) { tmp = sexpr_fmt_node(root, "domain/image/%s/vnc", hvm ? "hvm" : "linux"); if (tmp != NULL) { if (tmp[0] == '1') { @@ -1780,6 +1782,7 @@ xend_parse_sexp_desc(virConnectPtr conn, if (keymap) virBufferVSprintf(&buf, " keymap='%s'", keymap); virBufferAdd(&buf, "/>\n", 3); + found_graphics = 1; } } @@ -1789,6 +1792,7 @@ xend_parse_sexp_desc(virConnectPtr conn, if (tmp[0] == '1') { virBufferVSprintf(&buf, " <input type='mouse' bus='%s'/>\n", hvm ? "ps2" : "xen"); virBufferAdd(&buf, " <graphics type='sdl'/>\n", 27 ); + found_graphics = 1; } } }

On Tue, Jan 15, 2008 at 03:47:58AM +0000, John Levon wrote:
I have an old HVM guest defined in 3.0.4, and now I'm running 3.1.2 and libvirt 0.4.0. The config looks like this:
Dan (Berrange) has looked at this somewhat. He feels (probably rightly) that it's xend's bug. However these versions are out there and need to be worked with. Can someone please look and either apply this patch or suggest a variant? thanks john

On Tue, Jan 29, 2008 at 01:09:40PM +0000, John Levon wrote:
On Tue, Jan 15, 2008 at 03:47:58AM +0000, John Levon wrote:
I have an old HVM guest defined in 3.0.4, and now I'm running 3.1.2 and libvirt 0.4.0. The config looks like this:
Dan (Berrange) has looked at this somewhat. He feels (probably rightly) that it's xend's bug. However these versions are out there and need to be worked with. Can someone please look and either apply this patch or suggest a variant?
Yep, sorry for the delay. This patch looks reasonable - I just wanted to write a test case for it before applying it. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Tue, Jan 29, 2008 at 01:09:40PM +0000, John Levon wrote:
On Tue, Jan 15, 2008 at 03:47:58AM +0000, John Levon wrote:
I have an old HVM guest defined in 3.0.4, and now I'm running 3.1.2 and libvirt 0.4.0. The config looks like this:
Dan (Berrange) has looked at this somewhat. He feels (probably rightly) that it's xend's bug. However these versions are out there and need to be worked with. Can someone please look and either apply this patch or suggest a variant?
I've just looked at the behaviour on Xen 3.2.0 and it doesn't match what you describe - there's always a type=vnc added even for legacy config syntax. So I think this must be a 3.0.4 specific XenD bug. I don't have any 3.0.4 installs available, so if you can send the full output of 'xm list --long {GUEST-NAME}' for the VM question I'll add the fix & a test case for the 3.0.4 style config. Regards, Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Thu, Jan 31, 2008 at 07:48:55PM +0000, Daniel P. Berrange wrote:
I've just looked at the behaviour on Xen 3.2.0 and it doesn't match what you describe - there's always a type=vnc added even for legacy config syntax. So I think this must be a 3.0.4 specific XenD bug. I don't have any 3.0.4 installs available, so if you can send the full output of 'xm list --long {GUEST-NAME}' for the VM question I'll add the fix & a test case for the 3.0.4 style config.
Attached is the output in 3.0.4 (.xm) and in 3.1.2 (.xm2) thanks john

On Fri, Feb 01, 2008 at 07:41:06PM +0000, John Levon wrote:
On Thu, Jan 31, 2008 at 07:48:55PM +0000, Daniel P. Berrange wrote:
I've just looked at the behaviour on Xen 3.2.0 and it doesn't match what you describe - there's always a type=vnc added even for legacy config syntax. So I think this must be a 3.0.4 specific XenD bug. I don't have any 3.0.4 installs available, so if you can send the full output of 'xm list --long {GUEST-NAME}' for the VM question I'll add the fix & a test case for the 3.0.4 style config.
Attached is the output in 3.0.4 (.xm) and in 3.1.2 (.xm2)
Thanks, John - I've included this fix in the big Xen HVM kernel+initrd boot refactoring patch I just posted as a separate thread. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
participants (2)
-
Daniel P. Berrange
-
John Levon