dumpxml define not idempotent due to <bootlader/> tag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
when using "virsh dumpxml <domain> > xmlfile" on a running paravirt xen
domain that has no bootloader entry whatsoever I get:

...
  <bootloader/>
  <os>
    <type>linux</type>
    <kernel>/boot/vmlinuz-vm</kernel>
    <initrd>/boot/initrd.img-vm</initrd>
    <cmdline>root=/dev/sda1 ro </cmdline>
  </os>
...

reimporting this via "virsh define xmlfile" and then dumping again gives
something like:
...
  <bootloader/>
  <os>
    <type>linux</type>
  </os>
...
since a bootloader tag is found the kernel and initrd entries are being
dropped. My hack is to ignore empty bootloader statements for the
moment:

diff --git a/src/xend_internal.c b/src/xend_internal.c
index fd38a61..5428cd7 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -1438,9 +1438,6 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root,
         if (tmp != NULL) {
             bootloader = 1;
             virBufferVSprintf(&buf, "  <bootloader>%s</bootloader>\n", tmp);
-        } else if (sexpr_has(root, "domain/bootloader")) {
-            bootloader = 1;
-            virBufferVSprintf(&buf, "  <bootloader/>\n");
         }
         tmp = sexpr_node(root, "domain/bootloader_args");
         if (tmp != NULL && bootloader) {

Would that be the right place to fix this?
Cheers,
 -- Guido

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]