[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 1/3] block: Introduce "null" drivers
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v6 1/3] block: Introduce "null" drivers |
Date: |
Thu, 11 Sep 2014 13:48:26 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, 09/10 15:27, Benoît Canet wrote:
> The Wednesday 10 Sep 2014 à 11:08:46 (+0800), Fam Zheng wrote :
> > This is an analogue to Linux null_blk. It can be used for testing or
> > benchmarking block device emulation and general block layer
> > functionalities such as coroutines and throttling, where disk IO is not
> > necessary or wanted.
> >
> > Use null-aio:// for AIO version, and null-co:// for coroutine version.
> >
> > Signed-off-by: Fam Zheng <address@hidden>
> > ---
> > block/Makefile.objs | 1 +
> > block/null.c | 178
> > +++++++++++++++++++++++++++++++++++++++++++++++++++
> > qapi/block-core.json | 19 +++++-
> > 3 files changed, 196 insertions(+), 2 deletions(-)
> > create mode 100644 block/null.c
> >
> > diff --git a/block/Makefile.objs b/block/Makefile.objs
> > index f45f939..36a844f 100644
> > --- a/block/Makefile.objs
> > +++ b/block/Makefile.objs
> > @@ -9,6 +9,7 @@ block-obj-y += snapshot.o qapi.o
> > block-obj-$(CONFIG_WIN32) += raw-win32.o win32-aio.o
> > block-obj-$(CONFIG_POSIX) += raw-posix.o
> > block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
> > +block-obj-y += null.o
> >
> > block-obj-y += nbd.o nbd-client.o sheepdog.o
> > block-obj-$(CONFIG_LIBISCSI) += iscsi.o
> > diff --git a/block/null.c b/block/null.c
> > new file mode 100644
> > index 0000000..0037c1f
> > --- /dev/null
> > +++ b/block/null.c
> > @@ -0,0 +1,178 @@
> > +/*
> > + * Null block driver
> > + *
> > + * Authors:
> > + * Fam Zheng <address@hidden>
> > + *
> > + * Copyright (C) 2014 Red Hat, Inc.
> > + *
> > + * This work is licensed under the terms of the GNU GPL, version 2 or
> > later.
> > + * See the COPYING file in the top-level directory.
> > + */
> > +
> > +#include "block/block_int.h"
> > +
> > +typedef struct {
> > + int64_t length;
> > +} BDRVNullState;
> > +
> > +static QemuOptsList runtime_opts = {
> > + .name = "null",
> > + .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
> > + .desc = {
> > + {
> > + .name = "filename",
> > + .type = QEMU_OPT_STRING,
> > + .help = "",
> > + },
> > + {
> > + .name = BLOCK_OPT_SIZE,
> > + .type = QEMU_OPT_SIZE,
>
> > + .help = "size of the null block",
> Are we taking about a single block of the device or about the device as a
> whole ?
>
> Below assigning BLOCK_OPT_SIZE to s->length let think the .help should be
> + .help = "size of the null block device",
OK, I will change it and resend.
Fam