From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2zUe-0006k3-3i for qemu-devel@nongnu.org; Mon, 22 Dec 2014 04:41:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y2zUc-0005Q1-Uq for qemu-devel@nongnu.org; Mon, 22 Dec 2014 04:41:35 -0500 Received: from mail-ie0-x22f.google.com ([2607:f8b0:4001:c03::22f]:37014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y2zUc-0005Pv-Nj for qemu-devel@nongnu.org; Mon, 22 Dec 2014 04:41:34 -0500 Received: by mail-ie0-f175.google.com with SMTP id x19so4031812ier.20 for ; Mon, 22 Dec 2014 01:41:33 -0800 (PST) MIME-Version: 1.0 Date: Mon, 22 Dec 2014 17:41:33 +0800 Message-ID: From: =?UTF-8?B?5b6Q5bCP6b6Z?= Content-Type: multipart/alternative; boundary=001a1141c534259e2a050acaddac Subject: [Qemu-devel] qemu-img:the sheepdog snapshot vdi's lock will not be released when use qemu-img to create a snapshot vdi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Hitoshi Mitake , morita.kazutaka@gmail.com, namei.unix@gmail.com --001a1141c534259e2a050acaddac Content-Type: text/plain; charset=UTF-8 hi,all, when i use `qemu-img snapshot -c test-s sheepdog:test` to create a snapshot of sheepdog vdi,the snapshot's lock not be released. root@hty-compute1:~/qemu# ./qemu-img create sheepdog:test 1G Formatting 'sheepdog:test', fmt=raw size=1073741824 root@hty-compute1:~/qemu# dog vdi list Name Id Size Used Shared Creation time VDI id Copies Tag test 0 1.0 GB 0.0 MB 0.0 MB 2014-12-22 17:10 7c2b25 3 root@hty-compute1:~/qemu# ./qemu-img snapshot -c test-s sheepdog:test WARNING: Image format was not specified for 'sheepdog:test' and probing guessed raw. Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted. Specify the 'raw' format explicitly to remove the restrictions. root@hty-compute1:~/qemu# dog vdi lock list VDI | Owner node | Tag s test | IPv4 ip:172.16.17.200 port:7000 test-s when i create a snapshot ,the src vdi will be open and locked,in the function `sd_open` read the vdi inode info saved in the struct BDRVSheepdogState ,and in the function `sd_snapshot_create` the vdi inode information in the struct BDRVSheepdogState will point to an new vdi ,so when the function `sd_close` be called,the `sd_close` will try to released the lock of new vdi.In conclusion,the snapshot vdi will lock forever , so it's will be failed when i try to create a new vdi base on the snapshot. root@hty-compute1:~/qemu# ./qemu-img create -b sheepdog:test:test-s sheepdog:new-vdi qemu-img: sheepdog:new-vdi: cannot get vdi info, VDI is already locked, test 0 test-s There may be some wrong in the function`sd_snapshot_create`.but I'm not sure the root cause. Thanks, Xiaolong Xu --001a1141c534259e2a050acaddac Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
hi,all,
=C2=A0 =C2=A0 =C2=A0when i use `qemu-img snaps= hot -c test-s sheepdog:test` to create a snapshot of sheepdog vdi,the snaps= hot's lock not be released.

root@hty-comp= ute1:~/qemu# ./qemu-img create sheepdog:test 1G
Formatting 's= heepdog:test', fmt=3Draw size=3D1073741824

root@hty-compute1:~/qemu# dog vdi list
=C2=A0 Name =C2=A0 = =C2=A0 =C2=A0 =C2=A0Id =C2=A0 =C2=A0Size =C2=A0 =C2=A0Used =C2=A0Shared =C2= =A0 =C2=A0Creation time =C2=A0 VDI id =C2=A0Copies =C2=A0Tag
=C2= =A0 test =C2=A0 =C2=A0 =C2=A0 =C2=A0 0 =C2=A01.0 GB =C2=A00.0 MB =C2=A00.0 = MB 2014-12-22 17:10 =C2=A0 7c2b25 =C2=A0 =C2=A0 =C2=A03 =C2=A0
<= div>
root@hty-compute1:~/qemu# ./qemu-img snapshot -c test-s = sheepdog:test
WARNING: Image format was not specified for 'sh= eepdog:test' and probing guessed raw.
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0Automatically detecting the format is dangerous for raw images= , write operations on block 0 will be restricted.
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0Specify the 'raw' format explicitly to remove t= he restrictions.

root@hty-compute1:~/qemu# dog vdi= lock list
VDI | Owner node | Tag
s test | IPv4 ip:172.= 16.17.200 port:7000 test-s

when i create a snapsho= t ,the src vdi will be open and locked,in the function `sd_open` read the v= di inode info saved in the struct BDRVSheepdogState ,and in the function `s= d_snapshot_create` the vdi inode information in the struct BDRVSheepdogStat= e will point to an new vdi ,so when the function `sd_close` be called,the `= sd_close` will try to released the lock of new vdi.In conclusion,the snapsh= ot vdi will lock forever , so it's will be failed when i try to create = a new vdi base on the snapshot.

root@hty-comp= ute1:~/qemu# ./qemu-img create -b sheepdog:test:test-s sheepdog:new-vdi
qemu-img: sheepdog:new-vdi: cannot get vdi info, VDI is already lock= ed, test 0 test-s

There may be some wrong in= the function`sd_snapshot_create`.but I'm not sure the root cause.

Thanks,
Xiaolong Xu

--001a1141c534259e2a050acaddac--