block: gluster - add reopen support.
authorJeff Cody <jcody@redhat.com>
Mon, 17 Feb 2014 16:11:12 +0000 (11:11 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 28 Feb 2014 17:59:06 +0000 (18:59 +0100)
commitadccfbcd6020e928db93b2b4faf0dbd05ffbe016
treed4968752e491599386f3d43cadc2c8a2b8b48e4c
parent1b37b3442f78a77844fdaf7f53e5f04e4ce8f1d6
block: gluster - add reopen support.

Gluster does parse open flags in its .bdrv_open() implementation,
and the .bdrv_reopen_* implementations need to do the same.

A new gluster connection to the image file to be created is established
in the .bdrv_reopen_prepare(), and the image file opened with the new
flags.

If this is successful, then the old image file is closed, and the
old connection torn down. The relevant structure pointers in the gluster
state structure are updated to the new connection.

If it is not successful, then the new file handle and connection is
abandoned (if it exists), while the old connection is not modified at
all.

With reopen supported, block-commit (and offline commit) is now also
supported for image files whose base image uses the native gluster
protocol driver.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/gluster.c