From patchwork Tue Feb 4 19:12:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Cody X-Patchwork-Id: 316753 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 56A292C0096 for ; Wed, 5 Feb 2014 07:32:11 +1100 (EST) Received: from localhost ([::1]:54329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAlQq-0003TO-0B for incoming@patchwork.ozlabs.org; Tue, 04 Feb 2014 14:13:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40261) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAlQU-0003Qd-Ae for qemu-devel@nongnu.org; Tue, 04 Feb 2014 14:13:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAlQO-0002eR-BV for qemu-devel@nongnu.org; Tue, 04 Feb 2014 14:12:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53061) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAlQO-0002eE-40 for qemu-devel@nongnu.org; Tue, 04 Feb 2014 14:12:48 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s14JCkkC013999 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Feb 2014 14:12:47 -0500 Received: from localhost (ovpn-112-42.phx2.redhat.com [10.3.112.42]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s14JCiU6001065 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 4 Feb 2014 14:12:46 -0500 From: Jeff Cody To: qemu-devel@nongnu.org Date: Tue, 4 Feb 2014 14:12:44 -0500 Message-Id: <6811045539cc2d35ceff331326220aba2af9e670.1391541004.git.jcody@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH] block: Add notes to iSCSI's .bdrv_open and .bdrv_reopen_prepare 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 iSCSI currently does not need to do any actions to support the current usage of bdrv_reopen(). However, it is important to note a couple of things: 1.) A connection will not be re-established to an iSCSI target, and 2.) If iscsi_open() is changed to parse 'flags', then iscsi_reopen_prepare() may need to be more than a stub. In light of the above, this commit adds comments above both of the functions to bring attention to these facts. Signed-off-by: Jeff Cody --- block/iscsi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c index 6f4af72..cb0ac69 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1099,6 +1099,10 @@ fail: /* * We support iscsi url's on the form * iscsi://[%@][:]// + * + * Note: flags are currently not used by iscsi_open. If this function + * is changed such that flags are used, please examine iscsi_reopen_prepare() + * to see if needs to be changed as well. */ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) @@ -1337,11 +1341,13 @@ static int iscsi_refresh_limits(BlockDriverState *bs) return 0; } -/* We have nothing to do for iSCSI reopen, stub just returns - * success */ +/* Since iscsi_open() ignores bdrv_flags, there is nothing to do here in + * prepare. Note that this will not re-establish a connection with an iSCSI + * target - it is effectively a NOP. */ static int iscsi_reopen_prepare(BDRVReopenState *state, BlockReopenQueue *queue, Error **errp) { + /* NOP */ return 0; }