[libvirt] [PATCH v3 0/5] Active commit

Adam Litke alitke at redhat.com
Wed Jun 11 19:53:54 UTC 2014


On 11/06/14 10:27 -0600, Eric Blake wrote:
>I still don't have qemu capability detection working reliably,
>but want to post this series right now so that it can be built
>into a scratch build containing Peter's and my changes.  (Or
>put another way, I was testing what conflict resolutions are
>required - patch 2/5 (virsh) and 5/5 (qemu_driver) has some
>conflicts with Peter's addition of relative backing name; and
>I think the resolutions were fairly simple).
>
>These patches are tested on top of:
>https://www.redhat.com/archives/libvir-list/2014-June/msg00492.html
>
>I may still end up posting a v4 and/or pushing my series before
>Peter's, once I get capability detection working the way I want.
>
>Eric Blake (5):
>  virsh: improve blockcopy UI
>  virsh: expose new active commit controls
>  blockcommit: update error messages related to block jobs
>  blockcommit: track job type in xml
>  blockcommit: turn on active commit

I've tested this with the following script and it seems that
specifying base and top explicitly does not work.  Using --shallow
does work for me though.  Running the included script yields the
following output:

$ sudo bash /home/alitke/test/test.sh 
Formatting 'base.img', fmt=raw size=1073741824 
Formatting 'snap1.img', fmt=qcow2 size=1073741824
backing_file='base.img' backing_fmt='raw' encryption=off
cluster_size=65536 lazy_refcounts=off 
Formatting 'snap2.img', fmt=qcow2 size=1073741824
backing_file='snap1.img' backing_fmt='qcow2' encryption=off
cluster_size=65536 lazy_refcounts=off 
image: /tmp/snap2.img
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: snap1.img (actual path: /tmp/snap1.img)
backing file format: qcow2
Format specific information:
    compat: 1.1
    lazy refcounts: false
Domain testvm1 created from /dev/stdin

error: invalid argument: could not find image '/tmp/snap2.img' in
chain for '/tmp/snap2.img'

Domain testvm1 destroyed

--

#!/bin/sh

rm -f base.img snap1.img snap2.img

# base.img <- snap1.img <- snap2.img
qemu-img create -f raw base.img 1G
qemu-img create -f qcow2 -b base.img -o backing_fmt=raw snap1.img
qemu-img create -f qcow2 -b snap1.img -o backing_fmt=qcow2 snap2.img

chcon -t svirt_image_t base.img snap1.img snap2.img
chmod 666  base.img snap1.img snap2.img

qemu-img info $PWD/snap2.img

virsh create /dev/stdin <<EOF
<domain type='kvm'>
  <name>testvm1</name>
  <memory unit='MiB'>256</memory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64'>hvm</type>
  </os>
  <devices>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='$PWD/snap2.img'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <graphics type='vnc'/>
  </devices>
</domain>
EOF

base=$PWD/snap1.img
top=$PWD/snap2.img
virsh blockcommit testvm1 vda 0 $base $top --wait --verbose --pivot
virsh destroy testvm1

-- 
Adam Litke




More information about the libvir-list mailing list