* [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
@ 2017-10-25 8:15 Changlimin
2017-10-25 13:31 ` Fam Zheng
0 siblings, 1 reply; 8+ messages in thread
From: Changlimin @ 2017-10-25 8:15 UTC (permalink / raw)
To: qemu-devel@nongnu.org
Hi,
When running Oracle RAC, one image is shared between multiple vms, so I want to disable locking with option locking=off, But Block format 'raw' does not support the option 'locking'.
How to disable locking?
The version is git e822e81e350825dd94f41ee2538ff1432b812eb9
The command line is
-drive file=/var/lib/libvirt/images/r0605-share.img,format=raw,if=none,id=drive-virtio-disk1,cache=directsync,aio=native,locking=off \
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0xa,drive=drive-virtio-disk1,id=virtio-disk1 \
The error message is
-drive file=/var/lib/libvirt/images/r0605-share.img,format=raw,if=none,id=drive-virtio-disk1,cache=directsync,aio=native,locking=off: Block format 'raw' does not support the option 'locking'
BR
Chang Limin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
2017-10-25 8:15 [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off Changlimin
@ 2017-10-25 13:31 ` Fam Zheng
2017-10-26 1:06 ` Changlimin
0 siblings, 1 reply; 8+ messages in thread
From: Fam Zheng @ 2017-10-25 13:31 UTC (permalink / raw)
To: Changlimin; +Cc: qemu-devel@nongnu.org
On Wed, 10/25 08:15, Changlimin wrote:
> Hi,
> When running Oracle RAC, one image is shared between multiple vms, so I want to disable locking with option locking=off, But Block format 'raw' does not support the option 'locking'.
> How to disable locking?
>
> The version is git e822e81e350825dd94f41ee2538ff1432b812eb9
>
> The command line is
> -drive file=/var/lib/libvirt/images/r0605-share.img,format=raw,if=none,id=drive-virtio-disk1,cache=directsync,aio=native,locking=off \
> -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0xa,drive=drive-virtio-disk1,id=virtio-disk1 \
Hi, in this case you probably want to use share-rw=on:
-device virtio-blk-pci,share-rw=on,scsi=off,...
The -drive option is the same. This is more semantically correct than
locking=off as it means "the device can share the image with other QEMUs".
But for really disabling locking with "locking=off", the right syntax is:
-drive file.filename=/var/lib/...,file.locking=off \
or alternatively:
-drive driver=file,filename=/var/lib/...,locking=off \
Fam
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
2017-10-25 13:31 ` Fam Zheng
@ 2017-10-26 1:06 ` Changlimin
2017-10-26 7:11 ` Max Reitz
0 siblings, 1 reply; 8+ messages in thread
From: Changlimin @ 2017-10-26 1:06 UTC (permalink / raw)
To: Fam Zheng; +Cc: qemu-devel@nongnu.org
share-rw=on is good for raw format file, but bad for qcow2 format file:
Failed to get "write" lock
Is another process using the image?
Is this intented?
BR
Chang Limin
-----Original Message-----
From: Fam Zheng [mailto:famz@redhat.com]
Sent: Wednesday, October 25, 2017 9:31 PM
To: changlimin 00148 (Cloud)
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
On Wed, 10/25 08:15, Changlimin wrote:
> Hi,
> When running Oracle RAC, one image is shared between multiple vms, so I want to disable locking with option locking=off, But Block format 'raw' does not support the option 'locking'.
> How to disable locking?
>
> The version is git e822e81e350825dd94f41ee2538ff1432b812eb9
>
> The command line is
> -drive
> file=/var/lib/libvirt/images/r0605-share.img,format=raw,if=none,id=dri
> ve-virtio-disk1,cache=directsync,aio=native,locking=off \ -device
> virtio-blk-pci,scsi=off,bus=pci.0,addr=0xa,drive=drive-virtio-disk1,id
> =virtio-disk1 \
Hi, in this case you probably want to use share-rw=on:
-device virtio-blk-pci,share-rw=on,scsi=off,...
The -drive option is the same. This is more semantically correct than locking=off as it means "the device can share the image with other QEMUs".
But for really disabling locking with "locking=off", the right syntax is:
-drive file.filename=/var/lib/...,file.locking=off \
or alternatively:
-drive driver=file,filename=/var/lib/...,locking=off \
Fam
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
2017-10-26 1:06 ` Changlimin
@ 2017-10-26 7:11 ` Max Reitz
2017-10-26 7:18 ` Changlimin
0 siblings, 1 reply; 8+ messages in thread
From: Max Reitz @ 2017-10-26 7:11 UTC (permalink / raw)
To: Changlimin, Fam Zheng; +Cc: qemu-devel@nongnu.org
[-- Attachment #1: Type: text/plain, Size: 378 bytes --]
On 2017-10-26 03:06, Changlimin wrote:
> share-rw=on is good for raw format file, but bad for qcow2 format file:
>
> Failed to get "write" lock
> Is another process using the image?
>
> Is this intented?
Yes, because you can never share qcow2 image files between VMs. The
qcow2 format itself does not support this, as it may lead to metadata
corruption.
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
2017-10-26 7:11 ` Max Reitz
@ 2017-10-26 7:18 ` Changlimin
2017-10-26 7:32 ` Max Reitz
2017-10-31 20:00 ` John Snow
0 siblings, 2 replies; 8+ messages in thread
From: Changlimin @ 2017-10-26 7:18 UTC (permalink / raw)
To: Max Reitz, Fam Zheng; +Cc: qemu-devel@nongnu.org
If the qcow2 file is created with preallocation=full, I think metadata will not corrupt when it is shared between two vms? Snapshot is not required.
Is this right?
BR
Chang limin
-----Original Message-----
From: Max Reitz [mailto:mreitz@redhat.com]
Sent: Thursday, October 26, 2017 3:12 PM
To: changlimin 00148 (Cloud); Fam Zheng
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
On 2017-10-26 03:06, Changlimin wrote:
> share-rw=on is good for raw format file, but bad for qcow2 format file:
>
> Failed to get "write" lock
> Is another process using the image?
>
> Is this intented?
Yes, because you can never share qcow2 image files between VMs. The
qcow2 format itself does not support this, as it may lead to metadata corruption.
Max
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
2017-10-26 7:18 ` Changlimin
@ 2017-10-26 7:32 ` Max Reitz
2017-10-27 1:28 ` Changlimin
2017-10-31 20:00 ` John Snow
1 sibling, 1 reply; 8+ messages in thread
From: Max Reitz @ 2017-10-26 7:32 UTC (permalink / raw)
To: Changlimin, Fam Zheng; +Cc: qemu-devel@nongnu.org, Qemu-block
[-- Attachment #1: Type: text/plain, Size: 348 bytes --]
On 2017-10-26 09:18, Changlimin wrote:
> If the qcow2 file is created with preallocation=full, I think metadata will not corrupt when it is shared between two vms? Snapshot is not required.
>
> Is this right?
I wouldn't count on it.
If you really want to take the risk, you can probably use the
file.locking=off option again.
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
2017-10-26 7:32 ` Max Reitz
@ 2017-10-27 1:28 ` Changlimin
0 siblings, 0 replies; 8+ messages in thread
From: Changlimin @ 2017-10-27 1:28 UTC (permalink / raw)
To: Max Reitz, Fam Zheng; +Cc: qemu-devel@nongnu.org, Qemu-block
I tried locking=off, it supports qcow2
-drive file.filename=r 0605-share.img,format=qcow2,if=none,id=drive-virtio-disk1,cache=directsync,aio=native,file.locking=off
Thank you very much.
BR
Chang Limin
-----Original Message-----
From: Max Reitz [mailto:mreitz@redhat.com]
Sent: Thursday, October 26, 2017 3:33 PM
To: changlimin 00148 (Cloud); Fam Zheng
Cc: qemu-devel@nongnu.org; Qemu-block
Subject: Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
On 2017-10-26 09:18, Changlimin wrote:
> If the qcow2 file is created with preallocation=full, I think metadata will not corrupt when it is shared between two vms? Snapshot is not required.
>
> Is this right?
I wouldn't count on it.
If you really want to take the risk, you can probably use the file.locking=off option again.
Max
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off
2017-10-26 7:18 ` Changlimin
2017-10-26 7:32 ` Max Reitz
@ 2017-10-31 20:00 ` John Snow
1 sibling, 0 replies; 8+ messages in thread
From: John Snow @ 2017-10-31 20:00 UTC (permalink / raw)
To: Changlimin, Max Reitz, Fam Zheng; +Cc: qemu-devel@nongnu.org
On 10/26/2017 03:18 AM, Changlimin wrote:
> If the qcow2 file is created with preallocation=full, I think metadata will not corrupt when it is shared between two vms? Snapshot is not required.
>
> Is this right?
>
You can only share images read-only in this way. If you are asking to
share one qcow2 as r/w across two VMs, that's not going to work
regardless of how you allocate them, or the image format you are using.
--js
> BR
> Chang limin
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-10-31 20:00 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-25 8:15 [Qemu-devel] Block format 'raw' does not support the option 'locking' when disable image locking with option locking=off Changlimin
2017-10-25 13:31 ` Fam Zheng
2017-10-26 1:06 ` Changlimin
2017-10-26 7:11 ` Max Reitz
2017-10-26 7:18 ` Changlimin
2017-10-26 7:32 ` Max Reitz
2017-10-27 1:28 ` Changlimin
2017-10-31 20:00 ` John Snow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).