Received: from eggs.gnu.org ([2001:4830:134:3::10]:55075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V96Ij-0007hv-Jt for qemu-devel@nongnu.org; Tue, 13 Aug 2013 00:33:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V96Ia-0000XI-Uf for qemu-devel@nongnu.org; Tue, 13 Aug 2013 00:33:45 -0400 Received: from mail-pd0-x234.google.com ([2607:f8b0:400e:c02::234]:65197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V96Ia-0000X1-HH for qemu-devel@nongnu.org; Tue, 13 Aug 2013 00:33:36 -0400 Received: by mail-pd0-f180.google.com with SMTP id y10so4310353pdj.39 for ; Mon, 12 Aug 2013 21:33:35 -0700 (PDT) Sender: Dong Xu Wang From: Dong Xu Wang Date: Tue, 13 Aug 2013 12:31:56 +0800 Message-Id: <1376368326-7433-16-git-send-email-wdongxu@linux.vnet.ibm.com> In-Reply-To: <1376368326-7433-1-git-send-email-wdongxu@linux.vnet.ibm.com> References: <1376368326-7433-1-git-send-email-wdongxu@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH V18 15/25] block: add QemuOpts support for raw.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, wdongxu@cn.ibm.com, stefanha@redhat.com, Dong Xu Wang Signed-off-by: Dong Xu Wang --- block/raw.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/block/raw.c b/block/raw.c index 4751825..7636f6b 100644 --- a/block/raw.c +++ b/block/raw.c @@ -139,6 +139,24 @@ static QEMUOptionParameter raw_create_options[] = { { NULL } }; +static int raw_create_new(const char *filename, QemuOpts *opts) +{ + return bdrv_create_file_new(filename, opts); +} + +static QemuOptsList raw_create_opts = { + .name = "raw-create-opts", + .head = QTAILQ_HEAD_INITIALIZER(raw_create_opts.head), + .desc = { + { + .name = BLOCK_OPT_SIZE, + .type = QEMU_OPT_SIZE, + .help = "Virtual disk size" + }, + { /* end of list */ } + } +}; + static int raw_has_zero_init(BlockDriverState *bs) { return bdrv_has_zero_init(bs->file); @@ -180,7 +198,9 @@ static BlockDriver bdrv_raw = { .bdrv_aio_ioctl = raw_aio_ioctl, .bdrv_create = raw_create, + .bdrv_create_new = raw_create_new, .create_options = raw_create_options, + .bdrv_create_opts = &raw_create_opts, .bdrv_has_zero_init = raw_has_zero_init, }; -- 1.7.11.7