* [Qemu-devel] [PATCH] gluster: Add image resize support
@ 2013-07-19 14:21 Bharata B Rao
2013-07-23 12:23 ` Stefan Hajnoczi
2013-07-29 11:42 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Bharata B Rao @ 2013-07-19 14:21 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha, Bharata B Rao, pbonzini
From: Paolo Bonzini <pbonzini@redhat.com>
Implement .bdrv_truncate in GlusterFS block driver so that GlusterFS backend
can support image resizing.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Tested-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
block/gluster.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/block/gluster.c b/block/gluster.c
index 6de418c..645b7f1 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -493,6 +493,19 @@ out:
return NULL;
}
+static int qemu_gluster_truncate(BlockDriverState *bs, int64_t offset)
+{
+ int ret;
+ BDRVGlusterState *s = bs->opaque;
+
+ ret = glfs_ftruncate(s->fd, offset);
+ if (ret < 0) {
+ return -errno;
+ }
+
+ return 0;
+}
+
static BlockDriverAIOCB *qemu_gluster_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
@@ -631,6 +644,7 @@ static BlockDriver bdrv_gluster = {
.bdrv_create = qemu_gluster_create,
.bdrv_getlength = qemu_gluster_getlength,
.bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
+ .bdrv_truncate = qemu_gluster_truncate,
.bdrv_aio_readv = qemu_gluster_aio_readv,
.bdrv_aio_writev = qemu_gluster_aio_writev,
.bdrv_aio_flush = qemu_gluster_aio_flush,
@@ -650,6 +664,7 @@ static BlockDriver bdrv_gluster_tcp = {
.bdrv_create = qemu_gluster_create,
.bdrv_getlength = qemu_gluster_getlength,
.bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
+ .bdrv_truncate = qemu_gluster_truncate,
.bdrv_aio_readv = qemu_gluster_aio_readv,
.bdrv_aio_writev = qemu_gluster_aio_writev,
.bdrv_aio_flush = qemu_gluster_aio_flush,
@@ -669,6 +684,7 @@ static BlockDriver bdrv_gluster_unix = {
.bdrv_create = qemu_gluster_create,
.bdrv_getlength = qemu_gluster_getlength,
.bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
+ .bdrv_truncate = qemu_gluster_truncate,
.bdrv_aio_readv = qemu_gluster_aio_readv,
.bdrv_aio_writev = qemu_gluster_aio_writev,
.bdrv_aio_flush = qemu_gluster_aio_flush,
@@ -688,6 +704,7 @@ static BlockDriver bdrv_gluster_rdma = {
.bdrv_create = qemu_gluster_create,
.bdrv_getlength = qemu_gluster_getlength,
.bdrv_get_allocated_file_size = qemu_gluster_allocated_file_size,
+ .bdrv_truncate = qemu_gluster_truncate,
.bdrv_aio_readv = qemu_gluster_aio_readv,
.bdrv_aio_writev = qemu_gluster_aio_writev,
.bdrv_aio_flush = qemu_gluster_aio_flush,
--
1.7.11.7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] gluster: Add image resize support
2013-07-19 14:21 [Qemu-devel] [PATCH] gluster: Add image resize support Bharata B Rao
@ 2013-07-23 12:23 ` Stefan Hajnoczi
2013-07-29 11:42 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-07-23 12:23 UTC (permalink / raw)
To: Bharata B Rao; +Cc: kwolf, pbonzini, qemu-devel
On Fri, Jul 19, 2013 at 07:51:33PM +0530, Bharata B Rao wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
>
> Implement .bdrv_truncate in GlusterFS block driver so that GlusterFS backend
> can support image resizing.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Tested-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> ---
> block/gluster.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] gluster: Add image resize support
2013-07-19 14:21 [Qemu-devel] [PATCH] gluster: Add image resize support Bharata B Rao
2013-07-23 12:23 ` Stefan Hajnoczi
@ 2013-07-29 11:42 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2013-07-29 11:42 UTC (permalink / raw)
To: Bharata B Rao; +Cc: kwolf, pbonzini, qemu-devel
On Fri, Jul 19, 2013 at 07:51:33PM +0530, Bharata B Rao wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
>
> Implement .bdrv_truncate in GlusterFS block driver so that GlusterFS backend
> can support image resizing.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Tested-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> ---
> block/gluster.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-29 11:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-19 14:21 [Qemu-devel] [PATCH] gluster: Add image resize support Bharata B Rao
2013-07-23 12:23 ` Stefan Hajnoczi
2013-07-29 11:42 ` Stefan Hajnoczi
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.