From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQn6k-0001i5-Fn for qemu-devel@nongnu.org; Thu, 20 Mar 2014 20:14:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQn6e-0007h5-B2 for qemu-devel@nongnu.org; Thu, 20 Mar 2014 20:14:46 -0400 Received: from mail-yk0-f177.google.com ([209.85.160.177]:51058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQn6e-0007gw-7E for qemu-devel@nongnu.org; Thu, 20 Mar 2014 20:14:40 -0400 Received: by mail-yk0-f177.google.com with SMTP id q200so4371342ykb.8 for ; Thu, 20 Mar 2014 17:14:39 -0700 (PDT) From: Leandro Dorileo Date: Thu, 20 Mar 2014 21:13:22 -0300 Message-Id: <1395360813-2833-16-git-send-email-l@dorileo.org> In-Reply-To: <1395360813-2833-1-git-send-email-l@dorileo.org> References: <1395360813-2833-1-git-send-email-l@dorileo.org> Subject: [Qemu-devel] [PATCH 15/26] raw-win32: migrate cow driver QemuOptionParameter usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Stefan Hajnoczi , Liu Yuan , Jeff Cody , Markus Armbruster , Peter Lieven , "Richard W.M. Jones" , Luiz Capitulino , Leandro Dorileo , Ronnie Sahlberg , Josh Durgin , Anthony Liguori , Paolo Bonzini , Stefan Weil , Max Reitz , MORITA Kazutaka , Benoit Canet Do the directly migration from QemuOptionParameter to QemuOpts on raw-win32 block driver. Signed-off-by: Leandro Dorileo --- block/raw-win32.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/block/raw-win32.c b/block/raw-win32.c index 48cb2c2..4cca514 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -475,21 +475,14 @@ static int64_t raw_get_allocated_file_size(BlockDriverState *bs) return st.st_size; } -static int raw_create(const char *filename, QEMUOptionParameter *options, - Error **errp) +static int raw_create(const char *filename, QemuOpts *options, Error **errp) { int fd; int64_t total_size = 0; strstart(filename, "file:", &filename); - /* Read out options */ - while (options && options->name) { - if (!strcmp(options->name, BLOCK_OPT_SIZE)) { - total_size = options->value.n / 512; - } - options++; - } + total_size = qemu_opt_get_size(options, BLOCK_OPT_SIZE, 0); fd = qemu_open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); @@ -503,13 +496,17 @@ static int raw_create(const char *filename, QEMUOptionParameter *options, return 0; } -static QEMUOptionParameter raw_create_options[] = { - { - .name = BLOCK_OPT_SIZE, - .type = OPT_SIZE, - .help = "Virtual disk size" +static QemuOptsList raw_create_options = { + .name = "raw_create_options", + .head = QTAILQ_HEAD_INITIALIZER(raw_create_options.head), + .desc = { + { + .name = BLOCK_OPT_SIZE, + .type = QEMU_OPT_SIZE, + .help = "Virtual disk size" + }, + { NULL } }, - { NULL } }; static BlockDriver bdrv_file = { @@ -532,7 +529,7 @@ static BlockDriver bdrv_file = { .bdrv_get_allocated_file_size = raw_get_allocated_file_size, - .create_options = raw_create_options, + .create_options = &raw_create_options, }; /***********************************************/ -- 1.9.0