<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Deepak Shetty" <dpkshetty@gmail.com><br><b>To: </b>libvir-list@redhat.com<br><b>Sent: </b>Wednesday, March 18, 2015 7:19:05 PM<br><b>Subject: </b>[libvirt] Domain XML isn't dumping full backing chain<br><div><br></div><div dir="ltr"><div><div><div><div><span style="font-family:times new roman,serif">Hi,<br></span></div><span style="font-family:times new roman,serif">I am using libvirt version 1.2.9.2 on F21 and i am unable to get the complete backing chain info in the virsh dumpxml output. Details below :<br><div><br></div></span></div><span style="font-family:times new roman,serif"><b>My backing chain per qemu-img :</b><br></span></div><span style="font-family:times new roman,serif"><br>[stack@devstack-f21 test]$ qemu-img info --backing-chain snap4.qcow2 <br>image: snap4.qcow2<br>file format: qcow2<br>virtual size: 1.0G (1073741824 bytes)<br>disk size: 196K<br>cluster_size: 65536<br>backing file: ./snap3.qcow2<br>Format specific information:<br>    compat: 1.1<br>    lazy refcounts: false<br><div><br></div>image: ./snap3.qcow2<br>file format: qcow2<br>virtual size: 1.0G (1073741824 bytes)<br>disk size: 196K<br>cluster_size: 65536<br>backing file: ./snap2.qcow2 (actual path: ././snap2.qcow2)<br>Format specific information:<br>    compat: 1.1<br>    lazy refcounts: false<br><div><br></div>image: ././snap2.qcow2<br>file format: qcow2<br>virtual size: 1.0G (1073741824 bytes)<br>disk size: 196K<br>cluster_size: 65536<br>backing file: ./snap1.qcow2 (actual path: ./././snap1.qcow2)<br>Format specific information:<br>    compat: 1.1<br>    lazy refcounts: false<br><div><br></div>image: ./././snap1.qcow2<br>file format: qcow2<br>virtual size: 1.0G (1073741824 bytes)<br>disk size: 196K<br>cluster_size: 65536<br>backing file: ./base.qcow2 (actual path: ././././base.qcow2)<br>Format specific information:<br>    compat: 1.1<br>    lazy refcounts: false<br><div><br></div>image: ././././base.qcow2<br>file format: qcow2<br>virtual size: 1.0G (1073741824 bytes)<br>disk size: 196K<br>cluster_size: 65536<br>Format specific information:<br>    compat: 1.1<br>    lazy refcounts: false<br></span></div></div></blockquote><div>If you want prepare the backing chain yourself, you should  add "-o backing_fmt=$farmat" options, <br></div><div>like "qemu-img create -f qcow2 base.s1 -b base.qcow2 -o backing_fmt=qcow2" <br></div><div><br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><span style="font-family:times new roman,serif">I created 4 snapshots using commands (similar to the below, just dumping the last one here ):<br><div><br></div></span><div><span style="font-family:times new roman,serif">[stack@devstack-f21 test]$ virsh snapshot-create-as test-domain on-test-snap4  --disk-only --reuse-external --diskspec hda,snapshot=external,file=/home/stack/test/snap4.qcow2 <br>Domain snapshot on-test-snap4 created<br><div><br></div>[stack@devstack-f21 test]$ virsh domblklist test-domain<br>Target     Source<br>------------------------------------------------<br>hda        /home/stack/test/snap4.qcow2<br><div><br></div><br><div><br></div>virsh dumpxml test-domain|more<br>....<br><div><br></div>    <disk type='file' device='disk'><br>      <driver name='qemu' type='qcow2' cache='none'/><br>      <source file='/home/stack/test/snap4.qcow2'/><br>      <backingStore type='file' index='1'><br>        <format type='raw'/></span></div></div></blockquote><div>If you don't add "-o backing_fmt=qcow2", it will treat backing file format as raw format.<br></div><div>Since a raw format file doesn't have a backing file, so you only see snap4.qcow2 and <br></div><div>snap3.qcow2<br></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><div><span style="font-family:times new roman,serif"><br>        <source file='/home/stack/test/./snap3.qcow2'/><br>        <backingStore/><br>      </backingStore><br>      <target dev='hda' bus='ide'/><br>      <alias name='ide0-0-0'/><br>      <address type='drive' controller='0' bus='0' target='0' unit='0'/><br>    </disk><br><div><br></div><br>.....<br><div><br></div></span></div><div><span style="font-family:times new roman,serif">I think thats happening beccause the backingStore format is coming as 'raw'<br></span></div><div><span style="font-family:times new roman,serif">What am i missing ?<br><div><br></div></span></div><div><span style="font-family:times new roman,serif">thanx,<br></span></div><div><span style="font-family:times new roman,serif">deepak<br><div><br></div></span></div></div><br>--<br>libvir-list mailing list<br>libvir-list@redhat.com<br>https://www.redhat.com/mailman/listinfo/libvir-list</blockquote><div><br><br></div><div><br></div><div>-- <br></div><div><span name="x"></span>Regards<br>shyu<span name="x"></span><br></div></div></body></html>