From ef79fb5b5f56e1995874d0c609da36edfa5acf0d Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Thu, 7 Jul 2011 00:20:28 -0400 Subject: conf: add subelement to domain element Once it's plugged in, the element will be an optional replacement for the "listen" attribute that graphics elements already have. If the element is type='address', it will have an attribute called 'address' which will contain an IP address or dns name that the guest's display server should listen on. If, however, type='network', the element should have an attribute called 'network' that will be set to the name of a network configuration to get the IP address from. * docs/schemas/domain.rng: updated to allow the element * docs/formatdomain.html.in: document the element and its attributes. * src/conf/domain_conf.[hc]: 1) The domain parser, formatter, and data structure are modified to support 0 or more subelements to each element. The old style "legacy" listen attribute is also still accepted, and will be stored internally just as if it were a separate element. On output (i.e. format), the address attribute of the first element of type 'address' will be duplicated in the legacy "listen" attribute of the element. 2) The "listenAddr" attribute has been removed from the unions in virDomainGRaphicsDef for graphics types vnc, rdp, and spice. This attribute is now in the subelement (aka virDomainGraphicsListenDef) 3) Helper functions were written to provide simple access (both Get and Set) to the listen elements and their attributes. * src/libvirt_private.syms: export the listen helper functions * src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c, src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c, src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c Modify all these files to use the listen helper functions rather than directly referencing the (now missing) listenAddr attribute. There can be multiple elements to a single , but the drivers all currently only support one, so all replacements of direct access with a helper function indicate index "0". * tests/* - only 3 of these are new files added explicitly to test the new element. All the others have been modified to reflect the fact that any legacy "listen" attributes passed in to the domain parse will be saved in a element (i.e. one of the virDomainGraphicsListenDefs), and during the domain format function, both the element as well as the legacy attributes will be output. --- .../qemuxml2xmlout-graphics-listen-network2.xml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml (limited to 'tests/qemuxml2xmloutdata') diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml new file mode 100644 index 000000000..d369b890a --- /dev/null +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml @@ -0,0 +1,33 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu + + + +
+ + + + + + + + + + + -- cgit v1.2.3-65-gdbad