All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info'
@ 2017-10-06 14:09 Jan Heidbrink
  2017-10-06 14:28 ` [Qemu-devel] [Bug 1721788] " Daniel Berrange
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Jan Heidbrink @ 2017-10-06 14:09 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

When running 'qemu-img info test.qcow2' while test.qcow2 is currently
used by a Qemu process, I get the error

qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
lock.


Why does displaying information about a disk image need a write lock for the file?

Steps to reproduce:

qemu-img create -f qcow2 test.qcow2 10M
qemu-system-x86_64 -nographic -drive file=test.qcow2
qemu-img info test.qcow2

The above was tested with Qemu version 2.10.0

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1721788

Title:
  Failed to get shared "write" lock with 'qemu-img info'

Status in QEMU:
  New

Bug description:
  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error

  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.

  
  Why does displaying information about a disk image need a write lock for the file?

  Steps to reproduce:

  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2

  The above was tested with Qemu version 2.10.0

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1721788/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
@ 2017-10-06 14:28 ` Daniel Berrange
  2017-10-06 14:28 ` [Qemu-devel] [Bug 1721788] [NEW] " Eric Blake
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Daniel Berrange @ 2017-10-06 14:28 UTC (permalink / raw)
  To: qemu-devel

The QEMU process that has the disk image open may be doing I/O that
causes qcow2 metadata to be changed. Such changes could confuse the
'qemu-img' process it is was reading the metadata at the same time it
was being changed, causing bad data to be printed or worse. So requiring
a write lock is the 'safe' thing to do for reliability in the worst
case. You can override this by passing '--force-share' arg though.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1721788

Title:
  Failed to get shared "write" lock with 'qemu-img info'

Status in QEMU:
  New

Bug description:
  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error

  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.

  
  Why does displaying information about a disk image need a write lock for the file?

  Steps to reproduce:

  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2

  The above was tested with Qemu version 2.10.0

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1721788/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
  2017-10-06 14:28 ` [Qemu-devel] [Bug 1721788] " Daniel Berrange
@ 2017-10-06 14:28 ` Eric Blake
  2017-10-06 14:30 ` [Qemu-devel] [Bug 1721788] " Daniel Berrange
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Eric Blake @ 2017-10-06 14:28 UTC (permalink / raw)
  To: Bug 1721788, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]

On 10/06/2017 09:09 AM, Jan Heidbrink wrote:
> Public bug reported:
> 
> When running 'qemu-img info test.qcow2' while test.qcow2 is currently
> used by a Qemu process, I get the error
> 
> qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
> lock.
> 
> 
> Why does displaying information about a disk image need a write lock for the file?

Because there is a risk (albeit rather slight) that what you read from
the disk is inconsistent due to being an intermediate state in-between
separate non-atomic write actions by the other process that has it open
for write.

If you are willing to ignore the risk, then use:

qemu-img info -U test.qcow2

which says that you are okay reading the image while it is shared with a
concurrent writer, even if the read fails spectacularly in the unlikely
case that it sees inconsistent information.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
  2017-10-06 14:28 ` [Qemu-devel] [Bug 1721788] " Daniel Berrange
  2017-10-06 14:28 ` [Qemu-devel] [Bug 1721788] [NEW] " Eric Blake
@ 2017-10-06 14:30 ` Daniel Berrange
  2017-10-11 20:46   ` Liang Yan
  2021-04-22  5:29 ` Thomas Huth
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Daniel Berrange @ 2017-10-06 14:30 UTC (permalink / raw)
  To: qemu-devel

I've just noticed, however, that '--force-share' appears totally
undocumented in both CLI help output and the man page. So that's
certainly something that should be fixed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1721788

Title:
  Failed to get shared "write" lock with 'qemu-img info'

Status in QEMU:
  New

Bug description:
  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error

  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.

  
  Why does displaying information about a disk image need a write lock for the file?

  Steps to reproduce:

  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2

  The above was tested with Qemu version 2.10.0

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1721788/+subscriptions

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:30 ` [Qemu-devel] [Bug 1721788] " Daniel Berrange
@ 2017-10-11 20:46   ` Liang Yan
  0 siblings, 0 replies; 10+ messages in thread
From: Liang Yan @ 2017-10-11 20:46 UTC (permalink / raw)
  To: Bug 1721788, qemu-devel

This does  not only affect qemu-img only, it could not make libvirt
"<shareable>" work either when two vms were running with share disk
image.  Is there a workaround for this situation?

Best,
Liang

On 10/6/17 10:30 AM, Daniel Berrange wrote:
> I've just noticed, however, that '--force-share' appears totally
> undocumented in both CLI help output and the man page. So that's
> certainly something that should be fixed
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
                   ` (2 preceding siblings ...)
  2017-10-06 14:30 ` [Qemu-devel] [Bug 1721788] " Daniel Berrange
@ 2021-04-22  5:29 ` Thomas Huth
  2021-04-22  8:14 ` Jan Heidbrink
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Thomas Huth @ 2021-04-22  5:29 UTC (permalink / raw)
  To: qemu-devel

The QEMU project is currently considering to move its bug tracking to
another system. For this we need to know which bugs are still valid
and which could be closed already. Thus we are setting older bugs to
"Incomplete" now.

If you still think this bug report here is valid, then please switch
the state back to "New" within the next 60 days, otherwise this report
will be marked as "Expired". Or please mark it as "Fix Released" if
the problem has been solved with a newer version of QEMU already.

Thank you and sorry for the inconvenience.

** Changed in: qemu
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1721788

Title:
  Failed to get shared "write" lock with 'qemu-img info'

Status in QEMU:
  Incomplete

Bug description:
  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error

  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.

  
  Why does displaying information about a disk image need a write lock for the file?

  Steps to reproduce:

  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2

  The above was tested with Qemu version 2.10.0

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1721788/+subscriptions


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
                   ` (3 preceding siblings ...)
  2021-04-22  5:29 ` Thomas Huth
@ 2021-04-22  8:14 ` Jan Heidbrink
  2021-04-22 11:05 ` Max Reitz
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Jan Heidbrink @ 2021-04-22  8:14 UTC (permalink / raw)
  To: qemu-devel

** Description changed:

  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error
  
  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.
  
- 
- Why does displaying information about a disk image need a write lock for the file?
+ Why does displaying information about a disk image need a write lock for
+ the file?
  
  Steps to reproduce:
  
  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2
  
- The above was tested with Qemu version 2.10.0
+ The above was tested with Qemu version 2.10.0. Edit: Same behaviour with
+ version 5.2.0.

** Changed in: qemu
       Status: Incomplete => New

** Description changed:

  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error
  
  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.
  
  Why does displaying information about a disk image need a write lock for
  the file?
  
  Steps to reproduce:
  
  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2
  
- The above was tested with Qemu version 2.10.0. Edit: Same behaviour with
- version 5.2.0.
+ The above was tested with Qemu version 2.10.0.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1721788

Title:
  Failed to get shared "write" lock with 'qemu-img info'

Status in QEMU:
  New

Bug description:
  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error

  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.

  Why does displaying information about a disk image need a write lock
  for the file?

  Steps to reproduce:

  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2

  The above was tested with Qemu version 2.10.0.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1721788/+subscriptions


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
                   ` (4 preceding siblings ...)
  2021-04-22  8:14 ` Jan Heidbrink
@ 2021-04-22 11:05 ` Max Reitz
  2021-04-23 13:43 ` Jan Heidbrink
  2022-04-19 14:35 ` Kaitlyn Lew
  7 siblings, 0 replies; 10+ messages in thread
From: Max Reitz @ 2021-04-22 11:05 UTC (permalink / raw)
  To: qemu-devel

Hi,

What exactly is the problem now?  As Eric explained in comment 3, "qemu-
img info -U" is what needs to be used here.  Daniel raised the problem
of --force-share/-U being undocumented, but that’s no longer the case as
of commit a7e326df1c116e99e, which was first included in the 2.12.0
release.

Max

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1721788

Title:
  Failed to get shared "write" lock with 'qemu-img info'

Status in QEMU:
  New

Bug description:
  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error

  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.

  Why does displaying information about a disk image need a write lock
  for the file?

  Steps to reproduce:

  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2

  The above was tested with Qemu version 2.10.0.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1721788/+subscriptions


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
                   ` (5 preceding siblings ...)
  2021-04-22 11:05 ` Max Reitz
@ 2021-04-23 13:43 ` Jan Heidbrink
  2022-04-19 14:35 ` Kaitlyn Lew
  7 siblings, 0 replies; 10+ messages in thread
From: Jan Heidbrink @ 2021-04-23 13:43 UTC (permalink / raw)
  To: qemu-devel

Ah ok, I think this bug can be closed then.

** Changed in: qemu
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1721788

Title:
  Failed to get shared "write" lock with 'qemu-img info'

Status in QEMU:
  Fix Released

Bug description:
  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error

  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.

  Why does displaying information about a disk image need a write lock
  for the file?

  Steps to reproduce:

  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2

  The above was tested with Qemu version 2.10.0.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1721788/+subscriptions


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
  2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
                   ` (6 preceding siblings ...)
  2021-04-23 13:43 ` Jan Heidbrink
@ 2022-04-19 14:35 ` Kaitlyn Lew
  7 siblings, 0 replies; 10+ messages in thread
From: Kaitlyn Lew @ 2022-04-19 14:35 UTC (permalink / raw)
  To: qemu-devel

I have the same problem

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1721788

Title:
  Failed to get shared "write" lock with 'qemu-img info'

Status in QEMU:
  Fix Released

Bug description:
  When running 'qemu-img info test.qcow2' while test.qcow2 is currently
  used by a Qemu process, I get the error

  qemu-img: Could not open 'test.qcow2': Failed to get shared "write"
  lock.

  Why does displaying information about a disk image need a write lock
  for the file?

  Steps to reproduce:

  qemu-img create -f qcow2 test.qcow2 10M
  qemu-system-x86_64 -nographic -drive file=test.qcow2
  qemu-img info test.qcow2

  The above was tested with Qemu version 2.10.0.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1721788/+subscriptions



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-04-19 14:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06 14:09 [Qemu-devel] [Bug 1721788] [NEW] Failed to get shared "write" lock with 'qemu-img info' Jan Heidbrink
2017-10-06 14:28 ` [Qemu-devel] [Bug 1721788] " Daniel Berrange
2017-10-06 14:28 ` [Qemu-devel] [Bug 1721788] [NEW] " Eric Blake
2017-10-06 14:30 ` [Qemu-devel] [Bug 1721788] " Daniel Berrange
2017-10-11 20:46   ` Liang Yan
2021-04-22  5:29 ` Thomas Huth
2021-04-22  8:14 ` Jan Heidbrink
2021-04-22 11:05 ` Max Reitz
2021-04-23 13:43 ` Jan Heidbrink
2022-04-19 14:35 ` Kaitlyn Lew

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.