From patchwork Thu Nov 7 15:01:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Canet?= X-Patchwork-Id: 289380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 405262C008E for ; Fri, 8 Nov 2013 02:08:19 +1100 (EST) Received: from localhost ([::1]:40743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeR7Z-0006Li-Np for incoming@patchwork.ozlabs.org; Thu, 07 Nov 2013 10:03:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeR5v-0004MM-I6 for qemu-devel@nongnu.org; Thu, 07 Nov 2013 10:02:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeR5q-0008Ub-JO for qemu-devel@nongnu.org; Thu, 07 Nov 2013 10:02:03 -0500 Received: from nodalink.pck.nerim.net ([62.212.105.220]:41969 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeR5q-0008UV-A6 for qemu-devel@nongnu.org; Thu, 07 Nov 2013 10:01:58 -0500 Received: by paradis.irqsave.net (Postfix, from userid 1002) id 66CD1874620; Thu, 7 Nov 2013 16:01:57 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.77.2]) by paradis.irqsave.net (Postfix) with ESMTP id 6F95D874710; Thu, 7 Nov 2013 16:01:46 +0100 (CET) From: =?UTF-8?q?Beno=C3=AEt=20Canet?= To: qemu-devel@nongnu.org Date: Thu, 7 Nov 2013 16:01:43 +0100 Message-Id: <1383836503-25447-3-git-send-email-benoit@irqsave.net> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1383836503-25447-1-git-send-email-benoit@irqsave.net> References: <1383836503-25447-1-git-send-email-benoit@irqsave.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 62.212.105.220 Cc: kwolf@redhat.com, famz@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , armbru@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH 2/2] block: Allow the user to define "node-name" option. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org As node-name is a separate name space as device-name we can enable it's definition right now: nobody will use it so no harm involved. Signed-off-by: Benoit Canet --- block.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index 230e71a..132981f 100644 --- a/block.c +++ b/block.c @@ -885,7 +885,8 @@ int bdrv_file_open(BlockDriverState **pbs, const char *filename, options = qdict_new(); } - bs = bdrv_new("", NULL); + bs = bdrv_new("", qdict_get_try_str(options, "node-name")); + qdict_del(options, "node-name"); bs->options = options; options = qdict_clone_shallow(options); @@ -1007,7 +1008,8 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp) sizeof(backing_filename)); } - bs->backing_hd = bdrv_new("", NULL); + bs->backing_hd = bdrv_new("", qdict_get_try_str(options, "node-name")); + qdict_del(options, "node-name"); if (bs->backing_format[0] != '\0') { back_drv = bdrv_find_format(bs->backing_format);