All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Berrange <1721788@bugs.launchpad.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'
Date: Fri, 06 Oct 2017 14:28:37 -0000	[thread overview]
Message-ID: <150730011794.1539.12869692950017908242.malone@chaenomeles.canonical.com> (raw)
In-Reply-To: 150729895903.22243.5921581973131047310.malonedeb@gac.canonical.com

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

  reply	other threads:[~2017-10-06 14:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-10-06 14:28 ` 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150730011794.1539.12869692950017908242.malone@chaenomeles.canonical.com \
    --to=1721788@bugs.launchpad.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.