Index: src/xm_internal.c =================================================================== RCS file: /data/cvs/libxen/src/xm_internal.c,v retrieving revision 1.82 diff -u -p -u -p -r1.82 xm_internal.c --- src/xm_internal.c 10 Jun 2008 14:39:58 -0000 1.82 +++ src/xm_internal.c 19 Jun 2008 15:31:25 -0000 @@ -599,7 +599,7 @@ char *xenXMDomainFormatXML(virConnectPtr return (NULL); virBufferAddLit(&buf, "\n"); - virBufferVSprintf(&buf, " %s\n", name); + virBufferEscapeString(&buf, " %s\n", name); virUUIDFormat(uuid, uuidstr); virBufferVSprintf(&buf, " %s\n", uuidstr); @@ -612,7 +612,7 @@ char *xenXMDomainFormatXML(virConnectPtr virBufferAddLit(&buf, " \n"); virBufferAddLit(&buf, " hvm\n"); if (xenXMConfigGetString(conf, "kernel", &str) == 0) - virBufferVSprintf(&buf, " %s\n", str); + virBufferEscapeString(&buf, " %s\n", str); if (xenXMConfigGetString(conf, "boot", &boot) < 0) boot = "c"; @@ -639,15 +639,15 @@ char *xenXMDomainFormatXML(virConnectPtr } else { if (xenXMConfigGetString(conf, "bootloader", &str) == 0) - virBufferVSprintf(&buf, " %s\n", str); + virBufferEscapeString(&buf, " %s\n", str); if (xenXMConfigGetString(conf, "bootargs", &str) == 0) virBufferEscapeString(&buf, " %s\n", str); if (xenXMConfigGetString(conf, "kernel", &str) == 0) { virBufferAddLit(&buf, " \n"); virBufferAddLit(&buf, " linux\n"); - virBufferVSprintf(&buf, " %s\n", str); + virBufferEscapeString(&buf, " %s\n", str); if (xenXMConfigGetString(conf, "ramdisk", &str) == 0) - virBufferVSprintf(&buf, " %s\n", str); + virBufferEscapeString(&buf, " %s\n", str); if (xenXMConfigGetString(conf, "extra", &str) == 0) virBufferEscapeString(&buf, " %s\n", str); virBufferAddLit(&buf, " \n"); @@ -714,7 +714,7 @@ char *xenXMDomainFormatXML(virConnectPtr if (hvm) { if (xenXMConfigGetString(conf, "device_model", &str) == 0) - virBufferVSprintf(&buf, " %s\n", str); + virBufferEscapeString(&buf, " %s\n", str); } list = virConfGetValue(conf, "disk"); @@ -816,9 +816,12 @@ char *xenXMDomainFormatXML(virConnectPtr virBufferVSprintf(&buf, " \n", drvName, drvType); else virBufferVSprintf(&buf, " \n", drvName); - if (src[0]) - virBufferVSprintf(&buf, " \n", block ? "dev" : "file", src); - virBufferVSprintf(&buf, " \n", dev, bus); + if (src[0]) { + virBufferVSprintf(&buf, " \n", src); + } + virBufferEscapeString(&buf, " \n", bus); if (STREQ(head, "r") || STREQ(head, "ro")) virBufferAddLit(&buf, " \n"); @@ -836,7 +839,7 @@ char *xenXMDomainFormatXML(virConnectPtr if (xenXMConfigGetString(conf, "cdrom", &str) == 0) { virBufferAddLit(&buf, " \n"); virBufferAddLit(&buf, " \n"); - virBufferVSprintf(&buf, " \n", str); + virBufferEscapeString(&buf, " \n", str); virBufferAddLit(&buf, " \n"); virBufferAddLit(&buf, " \n"); virBufferAddLit(&buf, " \n"); @@ -924,7 +927,7 @@ char *xenXMDomainFormatXML(virConnectPtr if (type == 1 && bridge[0]) virBufferVSprintf(&buf, " \n", bridge); if (script[0]) - virBufferVSprintf(&buf, "