All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, Jeff Cody <jcody@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Max Reitz <mreitz@redhat.com>,
	stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com,
	John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd
Date: Wed, 4 May 2016 14:46:32 +0100	[thread overview]
Message-ID: <20160504134632.GA28935@redhat.com> (raw)
In-Reply-To: <1461848266-32119-9-git-send-email-famz@redhat.com>

On Thu, Apr 28, 2016 at 08:57:27PM +0800, Fam Zheng wrote:
> They are wrappers of POSIX fcntl file locking, with the additional
> interception of open/close (through qemu_open and qemu_close) to offer a
> better semantics that preserves the locks across multiple life cycles of
> different fds on the same file.  The reason to make this semantics
> change over the fcntl locks is to make the API cleaner for QEMU
> subsystems.
> 
> More precisely, we remove this "feature" of fcntl lock:
> 
>     If a process closes any file descriptor referring to a file, then
>     all of the process's locks on that file are released, regardless of
>     the file descriptor(s) on which the locks were obtained.
> 
> as long as the fd is always open/closed through qemu_open and
> qemu_close.

> +    ret = qemu_lock_do(fd, start, len, readonly ? F_RDLCK : F_WRLCK);
> +    if (ret == -1) {
> +        return -errno;
> +    }

It still appears this patch would break libguestfs's valid use case.

How about addressing what Dan wrote here:

  https://lists.gnu.org/archive/html/qemu-devel/2016-04/msg02927.html

?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

  reply	other threads:[~2016-05-04 13:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-28 12:57 [Qemu-devel] [PATCH v3 00/27] block: Lock images when opening Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 01/27] block: Add BDRV_O_NO_LOCK Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 02/27] qapi: Add lock-image in blockdev-add options Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 03/27] blockdev: Add and parse "lock-image" option for block devices Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 04/27] block: Introduce image file locking Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 05/27] block: Add bdrv_image_locked Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 06/27] block: Make bdrv_reopen_{commit, abort} private functions Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 07/27] block: Handle image locking during reopen Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd Fam Zheng
2016-05-04 13:46   ` Richard W.M. Jones [this message]
2016-05-10  2:43     ` Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 09/27] osdep: Introduce qemu_dup Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 10/27] raw-posix: Use qemu_dup Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 11/27] raw-posix: Implement .bdrv_lockf Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 12/27] gluster: " Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 13/27] qemu-io: Add "-L" option for BDRV_O_NO_LOCK Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 14/27] qemu-img: Add "-L" option to sub commands Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 15/27] qemu-img: Update documentation of "-L" option Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 16/27] qemu-nbd: Add "--no-lock/-L" option Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 17/27] block: Don't lock drive-backup target image in none mode Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 18/27] mirror: Disable image locking on target backing chain Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 19/27] qemu-iotests: 140: Disable image lock for qemu-io access Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 20/27] qemu-iotests: 046: Move version detection out from verify_io Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 21/27] qemu-iotests: Wait for QEMU processes before checking image in 091 Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 22/27] qemu-iotests: 030: Disable image lock when checking test image Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 23/27] iotests: 087: Disable image lock in cases where file is shared Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 24/27] iotests: Disable image locking in 085 Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 25/27] tests: Use null-co:// instead of /dev/null Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 26/27] block: Turn on image locking by default Fam Zheng
2016-04-28 12:57 ` [Qemu-devel] [PATCH v3 27/27] qemu-iotests: Add test case 153 for image locking Fam Zheng

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=20160504134632.GA28935@redhat.com \
    --to=rjones@redhat.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.