From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQn6R-0001DY-Ml for qemu-devel@nongnu.org; Thu, 20 Mar 2014 20:14:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQn6K-0007cJ-ND for qemu-devel@nongnu.org; Thu, 20 Mar 2014 20:14:27 -0400 Received: from mail-yh0-f54.google.com ([209.85.213.54]:60230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQn6K-0007cF-JS for qemu-devel@nongnu.org; Thu, 20 Mar 2014 20:14:20 -0400 Received: by mail-yh0-f54.google.com with SMTP id f73so1715222yha.27 for ; Thu, 20 Mar 2014 17:14:20 -0700 (PDT) From: Leandro Dorileo Date: Thu, 20 Mar 2014 21:13:17 -0300 Message-Id: <1395360813-2833-11-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 10/26] nfs: migrate nfs 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 nfs block driver. Signed-off-by: Leandro Dorileo --- block/nfs.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index 98aa363..c01f109 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -357,20 +357,13 @@ static int nfs_file_open(BlockDriverState *bs, QDict *options, int flags, return 0; } -static int nfs_file_create(const char *url, QEMUOptionParameter *options, - Error **errp) +static int nfs_file_create(const char *url, QemuOpts *options, Error **errp) { int ret = 0; int64_t total_size = 0; NFSClient *client = g_malloc0(sizeof(NFSClient)); - /* Read out options */ - while (options && options->name) { - if (!strcmp(options->name, "size")) { - total_size = options->value.n; - } - options++; - } + total_size = qemu_opt_get_size(options, BLOCK_OPT_SIZE, 0); ret = nfs_client_open(client, url, O_CREAT, errp); if (ret < 0) { -- 1.9.0