]> git.proxmox.com Git - mirror_qemu.git/commit - block/file-posix.c
block: raw-posix image file reopen
authorJeff Cody <jcody@redhat.com>
Thu, 20 Sep 2012 19:13:25 +0000 (15:13 -0400)
committerKevin Wolf <kwolf@redhat.com>
Mon, 24 Sep 2012 13:15:12 +0000 (15:15 +0200)
commiteeb6b45d48800e96f67ef2a5c80332557fd45ddb
tree6923fc62d70bd600c12d9b3dd564cabcb524f738
parent3d1807ac6707773526b193f296e72c6c86969bf7
block: raw-posix image file reopen

This is derived from the Supriya Kannery's reopen patches.

This contains the raw-posix driver changes for the bdrv_reopen_*
functions.  All changes are staged into a temporary scratch buffer
during the prepare() stage, and copied over to the live structure
during commit().  Upon abort(), all changes are abandoned, and the
live structures are unmodified.

The _prepare() will create an extra fd - either by means of a dup,
if possible, or opening a new fd if not (for instance, access
control changes).  Upon _commit(), the original fd is closed and
the new fd is used.  Upon _abort(), the duplicate/new fd is closed.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/raw-posix.c