+Thu Sep 14 10:33:23 EDT 2006 Daniel Berrange <berrange@redhat.com>
+
+ * src/xml.c: Append :disk for normal disk devices being created
+ when Xen >= 3.0.3, even though its technically optional
+ * src/xend_internal.c: Strip the :disk trailing component when
+ generating XML when Xen >= 3.0.3. We don't want to expose
+ that postfix in the <target> element, since its already set in
+ the device attribute on <disk> element.
+ * tests/sexpr2xmldata/*, tests/xml2sexprdata/*: Update to test
+ for handling of :disk postfix in sexpr/XML
+ * tests/virshtest.c, tests/sexpr2xmltest.c, tests/xml2sexprtest.c:
+ Cast size_t arg to an int to avoid format warnings from printf
+
Tue Sep 11 20:37:28 EDT 2006 Daniel Berrange <berrange@redhat.com>
* src/xml.c: Added support for setting VNC port when creating
}
if (!strncmp(dst, "ioemu:", 6))
dst += 6;
- /* New style cdrom config from Xen >= 3.0.3 */
+ /* New style disk config from Xen >= 3.0.3 */
if (xendConfigVersion > 1) {
char *offset = rindex(dst, ':');
- if (offset && !strcmp(offset, ":cdrom")) {
- offset[0] = '\0';
- cdrom = 1;
+ if (offset) {
+ if (!strcmp(offset, ":cdrom")) {
+ cdrom = 1;
+ } else if (!strcmp(offset, ":disk")) {
+ /* defualt anyway */
+ } else {
+ /* Unknown, lets pretend its a disk */
+ }
+ offset[0] = '\0';
}
}
/* 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;
+ if (offset) {
+ if (!strcmp(offset, ":cdrom")) {
+ cdrom = 1;
+ } else if (!strcmp(offset, ":disk")) {
+ /* defualt anyway */
+ } else {
+ /* Unknown, lets pretend its a disk */
+ }
+ offset[0] = '\0';
}
}
}
#endif /* ! PROXY */
+/*
+ * Local variables:
+ * indent-tabs-mode: nil
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
* under the hvm (image (os)) block
*/
if (hvm &&
- device &&
+ 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")) {
+ device &&
+ !strcmp((const char *)device, "cdrom")) {
if (xendConfigVersion == 1)
return 0;
else
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" : "");
+ virBufferVSprintf(buf, "(dev '%s%s')", (const char *) tmp, cdrom ? ":cdrom" : ":disk");
} else
virBufferVSprintf(buf, "(dev '%s')", (const char *) target);
-(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))))
+(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:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
return -1;
if (getenv("DEBUG_TESTS")) {
- printf("In %d '%s'\n", strlen(xmlData), xmlData);
- printf("Out %d '%s'\n", strlen(gotxml), gotxml);
+ printf("Expect %d '%s'\n", (int)strlen(xmlData), xmlData);
+ printf("Actual %d '%s'\n", (int)strlen(gotxml), gotxml);
}
if (strcmp(xmlData, gotxml))
return -1;
return -1;
if (getenv("DEBUG_TESTS")) {
- printf("Expect %d '%s'\n", strlen(expectData), expectData);
- printf("Actual %d '%s'\n", strlen(actualData), actualData);
+ printf("Expect %d '%s'\n", (int)strlen(expectData), expectData);
+ printf("Actual %d '%s'\n", (int)strlen(actualData), actualData);
}
if (strcmp(expectData, actualData))
return -1;
-(vm (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)(vncdisplay 17)))(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))))
\ No newline at end of file
+(vm (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)(vncdisplay 17)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
-(vm (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)(vncunused 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))))
\ No newline at end of file
+(vm (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)(vncunused 1)))(device (vbd (dev 'hdc:cdrom')(uname 'file:/root/boot.iso')(mode 'r')))(device (vbd (dev 'hda:disk')(uname 'file:/root/foo.img')(mode 'w')))(device (vif (mac '00:16:3e:1b:b1:47')(bridge 'xenbr0')(script 'vif-bridge')(type ioemu))))
\ No newline at end of file
return -1;
if (getenv("DEBUG_TESTS")) {
- printf("In %d '%s'\n", strlen(sexprData), sexprData);
- printf("Out %d '%s'\n", strlen(gotsexpr), gotsexpr);
+ printf("Expect %d '%s'\n", (int)strlen(sexprData), sexprData);
+ printf("Actual %d '%s'\n", (int)strlen(gotsexpr), gotsexpr);
}
if (strcmp(sexprData, gotsexpr))
return -1;