From 3708258fadcc94c103f06574263a84c6c206d797 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 12 Sep 2006 01:16:22 +0000 Subject: [PATCH] Added support for XenD 3.0.3 style HVM cdrom config --- .cvsignore | 1 + ChangeLog | 10 ++ configure.in | 2 + src/xend_internal.c | 130 ++++++++++++++----- src/xend_internal.h | 2 +- src/xml.c | 104 +++++++++------ src/xml.h | 2 +- tests/Makefile.am | 2 +- tests/sexpr2xmldata/.cvsignore | 2 + tests/sexpr2xmldata/Makefile.am | 2 + tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr | 1 + tests/sexpr2xmldata/sexpr2xml-fv-v2.xml | 35 +++++ tests/{ => sexpr2xmldata}/sexpr2xml-fv.sexpr | 0 tests/{ => sexpr2xmldata}/sexpr2xml-fv.xml | 0 tests/{ => sexpr2xmldata}/sexpr2xml-pv.sexpr | 0 tests/{ => sexpr2xmldata}/sexpr2xml-pv.xml | 0 tests/sexpr2xmltest.c | 46 +++++-- tests/xml2sexprdata/.cvsignore | 2 + tests/xml2sexprdata/Makefile.am | 2 + tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr | 1 + tests/{ => xml2sexprdata}/xml2sexpr-fv.sexpr | 0 tests/{ => xml2sexprdata}/xml2sexpr-fv.xml | 0 tests/{ => xml2sexprdata}/xml2sexpr-pv.sexpr | 0 tests/{ => xml2sexprdata}/xml2sexpr-pv.xml | 0 tests/xml2sexprtest.c | 52 ++++++-- 25 files changed, 295 insertions(+), 101 deletions(-) create mode 100644 tests/sexpr2xmldata/.cvsignore create mode 100644 tests/sexpr2xmldata/Makefile.am create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr create mode 100644 tests/sexpr2xmldata/sexpr2xml-fv-v2.xml rename tests/{ => sexpr2xmldata}/sexpr2xml-fv.sexpr (100%) rename tests/{ => sexpr2xmldata}/sexpr2xml-fv.xml (100%) rename tests/{ => sexpr2xmldata}/sexpr2xml-pv.sexpr (100%) rename tests/{ => sexpr2xmldata}/sexpr2xml-pv.xml (100%) create mode 100644 tests/xml2sexprdata/.cvsignore create mode 100644 tests/xml2sexprdata/Makefile.am create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr rename tests/{ => xml2sexprdata}/xml2sexpr-fv.sexpr (100%) rename tests/{ => xml2sexprdata}/xml2sexpr-fv.xml (100%) rename tests/{ => xml2sexprdata}/xml2sexpr-pv.sexpr (100%) rename tests/{ => xml2sexprdata}/xml2sexpr-pv.xml (100%) diff --git a/.cvsignore b/.cvsignore index dc4aaa6f7a..3603807043 100644 --- a/.cvsignore +++ b/.cvsignore @@ -19,3 +19,4 @@ ltmain.sh update.log libvirt.pc libvirt.spec +COPYING \ No newline at end of file diff --git a/ChangeLog b/ChangeLog index 21a94a7935..32a06bd0ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Tue Sep 11 20:11:05 EDT 2006 Daniel Berrange + + * src/xend_internal.c, src/xml.c: Added support for new 3.0.3 + style XenD cdrom configuration for HVM guests. + * configure.in, tests/Makefile.am: Added new test directories + * tests/xml2sexprdata*, tests/sexpr2xmldata*: Removed config files + for test suite. + * tests/xml2sexprdata/*, tests/sexpr2xmldata/*: New home for test + suite config files + Tue Sep 5 13:50:05 MYT 2006 Daniel Veillard * NEWS configure.in docs//* include/libvirt/libvirt.h libvirt.specx.*: diff --git a/configure.in b/configure.in index 1bcec8d628..217cd88c4d 100644 --- a/configure.in +++ b/configure.in @@ -257,4 +257,6 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \ include/libvirt/Makefile include/libvirt/libvirt.h \ python/Makefile python/tests/Makefile \ tests/Makefile proxy/Makefile \ + tests/xml2sexprdata/Makefile \ + tests/sexpr2xmldata/Makefile \ tests/virshdata/Makefile tests/confdata/Makefile) diff --git a/src/xend_internal.c b/src/xend_internal.c index ce3580b8cd..463da1a192 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -1258,6 +1258,36 @@ xend_get_node(virConnectPtr xend) return node; } +static int +xend_get_config_version(virConnectPtr conn) { + int ret = -1; + struct sexpr *root; + const char *value; + + if (!VIR_IS_CONNECT(conn)) { + virXendError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__); + return (-1); + } + + root = sexpr_get(conn, "/xend/node/"); + if (root == NULL) + return (-1); + + value = sexpr_node(root, "node/xend_config_format"); + + if (value) { + return strtol(value, NULL, 10); + } else { + /* Xen prior to 3.0.3 did not have the xend_config_format + field, and is implicitly version 1. */ + return 1; + } + + sexpr_free(root); + return (ret); +} + + #ifndef PROXY /** * xend_node_shutdown: @@ -1431,7 +1461,7 @@ xend_parse_sexp_desc_os(struct sexpr *node, virBufferPtr buf, int hvm) * the caller must free() the returned value. */ static char * -xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root) +xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, int xendConfigVersion) { char *ret; struct sexpr *cur, *node; @@ -1525,37 +1555,62 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root) if (tmp == NULL) continue; if (!memcmp(tmp, "file:", 5)) { - tmp += 5; - virBufferVSprintf(&buf, " \n"); - virBufferVSprintf(&buf, " \n", - tmp); - tmp = sexpr_node(node, "device/vbd/dev"); - if (tmp == NULL) { + int cdrom = 0; + const char *src = tmp+5; + const char *dst = sexpr_node(node, "device/vbd/dev"); + + if (dst == NULL) { virXendError(NULL, VIR_ERR_INTERNAL_ERROR, "domain information incomplete, vbd has no dev"); goto error; } - if (!strncmp(tmp, "ioemu:", 6)) - tmp += 6; - virBufferVSprintf(&buf, " \n", tmp); + if (!strncmp(dst, "ioemu:", 6)) + dst += 6; + /* New style cdrom config from Xen >= 3.0.3 */ + if (xendConfigVersion > 1) { + char *offset = rindex(dst, ':'); + if (offset && !strcmp(offset, ":cdrom")) { + offset[0] = '\0'; + cdrom = 1; + } + } + + virBufferVSprintf(&buf, " \n", cdrom ? "cdrom" : "disk"); + virBufferVSprintf(&buf, " \n", src); + virBufferVSprintf(&buf, " \n", dst); tmp = sexpr_node(node, "device/vbd/mode"); + /* XXX should we force mode == r, if cdrom==1, or assume + xend has already done this ? */ if ((tmp != NULL) && (!strcmp(tmp, "r"))) virBufferVSprintf(&buf, " \n"); virBufferAdd(&buf, " \n", 12); } else if (!memcmp(tmp, "phy:", 4)) { - tmp += 4; - virBufferVSprintf(&buf, " \n"); - virBufferVSprintf(&buf, " \n", tmp); - tmp = sexpr_node(node, "device/vbd/dev"); - if (tmp == NULL) { + int cdrom = 0; + const char *src = tmp+4; + const char *dst = sexpr_node(node, "device/vbd/dev"); + + if (dst == NULL) { virXendError(NULL, VIR_ERR_INTERNAL_ERROR, "domain information incomplete, vbd has no dev"); goto error; } - if (!strncmp(tmp, "ioemu:", 6)) - tmp += 6; - virBufferVSprintf(&buf, " \n", tmp); + if (!strncmp(dst, "ioemu:", 6)) + dst += 6; + /* New style cdrom config from Xen >= 3.0.3 */ + if (xendConfigVersion > 1) { + char *offset = rindex(dst, ':'); + if (offset && !strcmp(offset, ":cdrom")) { + offset[0] = '\0'; + cdrom = 1; + } + } + + virBufferVSprintf(&buf, " \n", cdrom ? "cdrom" : "disk"); + virBufferVSprintf(&buf, " \n", src); + virBufferVSprintf(&buf, " \n", dst); tmp = sexpr_node(node, "device/vbd/mode"); + /* XXX should we force mode == r, if cdrom==1, or assume + xend has already done this ? */ if ((tmp != NULL) && (!strcmp(tmp, "r"))) virBufferVSprintf(&buf, " \n"); virBufferAdd(&buf, " \n", 12); @@ -1617,14 +1672,17 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root) virBufferAdd(&buf, " \n", 26); virBufferAdd(&buf, " \n", 12); } - /* XXX new (3.0.3) Xend puts cdrom devs in usual (devices) block */ - tmp = sexpr_node(root, "domain/image/hvm/cdrom"); - if ((tmp != NULL) && (tmp[0] != 0)) { - virBufferAdd(&buf, " \n", 38); - virBufferVSprintf(&buf, " \n", tmp); - virBufferAdd(&buf, " \n", 26); - virBufferAdd(&buf, " \n", 18); - virBufferAdd(&buf, " \n", 12); + + /* Old style cdrom config from Xen <= 3.0.2 */ + if (xendConfigVersion == 1) { + tmp = sexpr_node(root, "domain/image/hvm/cdrom"); + if ((tmp != NULL) && (tmp[0] != 0)) { + virBufferAdd(&buf, " \n", 38); + virBufferVSprintf(&buf, " \n", tmp); + virBufferAdd(&buf, " \n", 26); + virBufferAdd(&buf, " \n", 18); + virBufferAdd(&buf, " \n", 12); + } } } @@ -1664,14 +1722,14 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root) } char * -xend_parse_domain_sexp(virConnectPtr conn, char *sexpr) { +xend_parse_domain_sexp(virConnectPtr conn, char *sexpr, int xendConfigVersion) { struct sexpr *root = string2sexpr(sexpr); char *data; if (!root) return NULL; - data = xend_parse_sexp_desc(conn, root); + data = xend_parse_sexp_desc(conn, root, xendConfigVersion); sexpr_free(root); @@ -2175,12 +2233,18 @@ xenDaemonDomainDumpXMLByID(virConnectPtr conn, int domid) { char *ret = NULL; struct sexpr *root; + int xendConfigVersion; root = sexpr_get(conn, "/xend/domain/%d?detail=1", domid); if (root == NULL) return (NULL); - ret = xend_parse_sexp_desc(conn, root); + if ((xendConfigVersion = xend_get_config_version(conn)) < 0) { + virXendError(conn, VIR_ERR_INTERNAL_ERROR, "cannot determine xend config version"); + return (NULL); + } + + ret = xend_parse_sexp_desc(conn, root, xendConfigVersion); sexpr_free(root); return (ret); @@ -2724,6 +2788,7 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc, char *sexpr; char *name = NULL; virDomainPtr dom; + int xendConfigVersion; if (!VIR_IS_CONNECT(conn)) { virXendError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__); @@ -2734,7 +2799,12 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc, return (NULL); } - sexpr = virDomainParseXMLDesc(xmlDesc, &name); + if ((xendConfigVersion = xend_get_config_version(conn)) < 0) { + virXendError(conn, VIR_ERR_INTERNAL_ERROR, "cannot determine xend config version"); + return (NULL); + } + + sexpr = virDomainParseXMLDesc(xmlDesc, &name, xendConfigVersion); if ((sexpr == NULL) || (name == NULL)) { if (sexpr != NULL) free(sexpr); diff --git a/src/xend_internal.h b/src/xend_internal.h index eff24628b2..11c54136da 100644 --- a/src/xend_internal.h +++ b/src/xend_internal.h @@ -613,7 +613,7 @@ char *xenDaemonDomainDumpXMLByID(virConnectPtr xend, */ int xend_log(virConnectPtr xend, char *buffer, size_t n_buffer); - char *xend_parse_domain_sexp(virConnectPtr conn, char *root); + char *xend_parse_domain_sexp(virConnectPtr conn, char *root, int xendConfigVersion); /* refactored ones */ void xenDaemonRegister(void); diff --git a/src/xml.c b/src/xml.c index cc6d9dd887..8623a5fce0 100644 --- a/src/xml.c +++ b/src/xml.c @@ -609,6 +609,7 @@ static int virDomainParseXMLGraphicsDesc(xmlNodePtr node, virBufferPtr buf) * @node: node containing HVM OS description * @buf: a buffer for the result S-Expr * @ctxt: a path context representing the XML description + * @xendConfigVersion: xend configuration file format * * Parse the OS part of the XML description for an HVM domain and add it to * the S-Expr in buf. This is a temporary interface as the S-Expr interface @@ -618,7 +619,7 @@ static int virDomainParseXMLGraphicsDesc(xmlNodePtr node, virBufferPtr buf) * Returns 0 in case of success, -1 in case of error. */ static int -virDomainParseXMLOSDescHVM(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr ctxt) +virDomainParseXMLOSDescHVM(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr ctxt, int xendConfigVersion) { xmlXPathObjectPtr obj = NULL; xmlNodePtr cur, txt; @@ -690,44 +691,46 @@ virDomainParseXMLOSDescHVM(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr obj = xmlXPathEval(BAD_CAST "/domain/devices/disk[@device='floppy' and target/@dev='fda']/source", ctxt); if ((obj != NULL) && (obj->type == XPATH_NODESET) && (obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) { - cur = obj->nodesetval->nodeTab[0]; - virBufferVSprintf(buf, "(fda '%s')", - (const char *) xmlGetProp(cur, BAD_CAST "file")); - cur = NULL; + cur = obj->nodesetval->nodeTab[0]; + virBufferVSprintf(buf, "(fda '%s')", + (const char *) xmlGetProp(cur, BAD_CAST "file")); + cur = NULL; } if (obj) { - xmlXPathFreeObject(obj); - obj = NULL; - } + xmlXPathFreeObject(obj); + obj = NULL; + } /* get the 2nd floppy device file */ obj = xmlXPathEval(BAD_CAST "/domain/devices/disk[@device='floppy' and target/@dev='fdb']/source", ctxt); if ((obj != NULL) && (obj->type == XPATH_NODESET) && (obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) { - cur = obj->nodesetval->nodeTab[0]; - virBufferVSprintf(buf, "(fdb '%s')", - (const char *) xmlGetProp(cur, BAD_CAST "file")); - cur = NULL; + cur = obj->nodesetval->nodeTab[0]; + virBufferVSprintf(buf, "(fdb '%s')", + (const char *) xmlGetProp(cur, BAD_CAST "file")); + cur = NULL; } if (obj) { - xmlXPathFreeObject(obj); - obj = NULL; + xmlXPathFreeObject(obj); + obj = NULL; } /* get the cdrom device file */ - /* XXX new (3.0.3) Xend puts cdrom devs in usual (devices) block */ - obj = xmlXPathEval(BAD_CAST "/domain/devices/disk[@device='cdrom' and target/@dev='hdc']/source", ctxt); - if ((obj != NULL) && (obj->type == XPATH_NODESET) && - (obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) { - cur = obj->nodesetval->nodeTab[0]; - virBufferVSprintf(buf, "(cdrom '%s')", - (const char *) xmlGetProp(cur, BAD_CAST "file")); - cur = NULL; - } - if (obj) { - xmlXPathFreeObject(obj); - obj = NULL; + /* Only XenD <= 3.0.2 wants cdrom config here */ + if (xendConfigVersion == 1) { + obj = xmlXPathEval(BAD_CAST "/domain/devices/disk[@device='cdrom' and target/@dev='hdc']/source", ctxt); + if ((obj != NULL) && (obj->type == XPATH_NODESET) && + (obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) { + cur = obj->nodesetval->nodeTab[0]; + virBufferVSprintf(buf, "(cdrom '%s')", + (const char *) xmlGetProp(cur, BAD_CAST "file")); + cur = NULL; + } + if (obj) { + xmlXPathFreeObject(obj); + obj = NULL; + } } obj = xmlXPathEval(BAD_CAST "/domain/features/acpi", ctxt); @@ -885,6 +888,7 @@ virDomainParseXMLOSDescPV(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr * virDomainParseXMLDiskDesc: * @node: node containing disk description * @buf: a buffer for the result S-Expr + * @xendConfigVersion: xend configuration file format * * Parse the one disk in the XML description and add it to the S-Expr in buf * This is a temporary interface as the S-Expr interface @@ -894,7 +898,7 @@ virDomainParseXMLOSDescPV(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr * Returns 0 in case of success, -1 in case of error. */ static int -virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm) +virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm, int xendConfigVersion) { xmlNodePtr cur; xmlChar *type = NULL; @@ -903,6 +907,7 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm) xmlChar *target = NULL; int ro = 0; int typ = 0; + int cdrom = 0; type = xmlGetProp(node, BAD_CAST "type"); if (type != NULL) { @@ -948,29 +953,43 @@ virDomainParseXMLDiskDesc(xmlNodePtr node, virBufferPtr buf, int hvm) return (-1); } - /* Skip floppy/cdrom disk used as the boot device - * since that's incorporated into the HVM kernel - * (image (hvm..)) part of the sexpr, rather than - * the (devices...) bit. Odd Xend HVM config :-( - * XXX This will have to change in Xen 3.0.3 + /* Xend (all versions) put the floppy device config + * under the hvm (image (os)) block */ - if (hvm && device && - (!strcmp((const char *)device, "floppy") || - !strcmp((const char *)device, "cdrom"))) { - return 0; + if (hvm && + device && + !strcmp((const char *)device, "floppy")) { + return 0; + } + + /* Xend <= 3.0.2 doesn't include cdrom config here */ + if (hvm && + device && + !strcmp((const char *)device, "cdrom")) { + if (xendConfigVersion == 1) + return 0; + else + cdrom = 1; } virBufferAdd(buf, "(device ", 8); virBufferAdd(buf, "(vbd ", 5); - /* XXX ioemu prefix is going away in Xen 3.0.3 */ + if (hvm) { char *tmp = (char *)target; + /* Just in case user mistakenly still puts ioemu: in their XML */ if (!strncmp((const char *) tmp, "ioemu:", 6)) tmp += 6; - virBufferVSprintf(buf, "(dev 'ioemu:%s')", (const char *) tmp); + + /* Xend <= 3.0.2 wants a ioemu: prefix on devices for HVM */ + if (xendConfigVersion == 1) + virBufferVSprintf(buf, "(dev 'ioemu:%s')", (const char *) tmp); + else /* But newer does not */ + virBufferVSprintf(buf, "(dev '%s%s')", (const char *) tmp, cdrom ? ":cdrom" : ""); } else - virBufferVSprintf(buf, "(dev '%s')", (const char *) target); + virBufferVSprintf(buf, "(dev '%s')", (const char *) target); + if (typ == 0) virBufferVSprintf(buf, "(uname 'file:%s')", source); else if (typ == 1) { @@ -1069,6 +1088,7 @@ virDomainParseXMLIfDesc(xmlNodePtr node, virBufferPtr buf, int hvm) /** * virDomainParseXMLDesc: * @xmldesc: string with the XML description + * @xendConfigVersion: xend configuration file format * * Parse the XML description and turn it into the xend sexp needed to * create the comain. This is a temporary interface as the S-Expr interface @@ -1079,7 +1099,7 @@ virDomainParseXMLIfDesc(xmlNodePtr node, virBufferPtr buf, int hvm) * the caller must free() the returned value. */ char * -virDomainParseXMLDesc(const char *xmldesc, char **name) +virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion) { xmlDocPtr xml = NULL; xmlNodePtr node; @@ -1217,7 +1237,7 @@ virDomainParseXMLDesc(const char *xmldesc, char **name) res = virDomainParseXMLOSDescPV(obj->nodesetval->nodeTab[0], &buf, ctxt); } else { hvm = 1; - res = virDomainParseXMLOSDescHVM(obj->nodesetval->nodeTab[0], &buf, ctxt); + res = virDomainParseXMLOSDescHVM(obj->nodesetval->nodeTab[0], &buf, ctxt, xendConfigVersion); } xmlXPathFreeObject(tmpobj); @@ -1235,7 +1255,7 @@ virDomainParseXMLDesc(const char *xmldesc, char **name) if ((obj != NULL) && (obj->type == XPATH_NODESET) && (obj->nodesetval != NULL) && (obj->nodesetval->nodeNr >= 0)) { for (i = 0; i < obj->nodesetval->nodeNr; i++) { - res = virDomainParseXMLDiskDesc(obj->nodesetval->nodeTab[i], &buf, hvm); + res = virDomainParseXMLDiskDesc(obj->nodesetval->nodeTab[i], &buf, hvm, xendConfigVersion); if (res != 0) { goto error; } diff --git a/src/xml.h b/src/xml.h index 78e086c014..5e91abec1b 100644 --- a/src/xml.h +++ b/src/xml.h @@ -29,7 +29,7 @@ void virBufferFree(virBufferPtr buf); int virBufferAdd(virBufferPtr buf, const char *str, int len); int virBufferVSprintf(virBufferPtr buf, const char *format, ...); int virBufferStrcat(virBufferPtr buf, ...); -char *virDomainParseXMLDesc(const char *xmldesc, char **name); +char *virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion); unsigned char *virParseUUID(char **ptr, const char *uuid); #ifdef __cplusplus diff --git a/tests/Makefile.am b/tests/Makefile.am index 3a71a9b45f..98e7d4402a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = virshdata confdata +SUBDIRS = virshdata confdata sexpr2xmldata xml2sexprdata LIBVIRT = $(top_builddir)/src/.libs/libvirt.a diff --git a/tests/sexpr2xmldata/.cvsignore b/tests/sexpr2xmldata/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/tests/sexpr2xmldata/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/tests/sexpr2xmldata/Makefile.am b/tests/sexpr2xmldata/Makefile.am new file mode 100644 index 0000000000..43117d5cb9 --- /dev/null +++ b/tests/sexpr2xmldata/Makefile.am @@ -0,0 +1,2 @@ + +EXTRA_DIST = $(wildcard *.xml) $(wildcard *.sexpr) diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr b/tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr new file mode 100644 index 0000000000..398ebca72d --- /dev/null +++ b/tests/sexpr2xmldata/sexpr2xml-fv-v2.sexpr @@ -0,0 +1 @@ +(domain (domid 3)(name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd275cdaca517769660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'restart')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(device_model '/usr/lib64/xen/bin/qemu-dm')(boot c)(acpi 1)(vnc 1)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu)))) diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml new file mode 100644 index 0000000000..6ea089611c --- /dev/null +++ b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml @@ -0,0 +1,35 @@ + + fvtest + b5d70dd275cdaca517769660b059d8bc + + hvm + /usr/lib/xen/boot/hvmloader + + + 409600 + 1 + destroy + restart + restart + + + + + /usr/lib64/xen/bin/qemu-dm + + + + + + + + + + + + +