From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEMaF-0008HQ-Px for qemu-devel@nongnu.org; Fri, 14 Feb 2014 12:29:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEMa9-0004VE-Qj for qemu-devel@nongnu.org; Fri, 14 Feb 2014 12:29:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEMa9-0004U7-I8 for qemu-devel@nongnu.org; Fri, 14 Feb 2014 12:29:45 -0500 From: Stefan Hajnoczi Date: Fri, 14 Feb 2014 18:29:25 +0100 Message-Id: <1392398973-15092-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1392398973-15092-1-git-send-email-stefanha@redhat.com> References: <1392398973-15092-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 03/11] block: Add notes to iSCSI's .bdrv_open and .bdrv_reopen_prepare List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Anthony Liguori From: Jeff Cody 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 Signed-off-by: Stefan Hajnoczi --- block/iscsi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/block/iscsi.c b/block/iscsi.c index 8d0f966..c97c040 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) @@ -1336,11 +1340,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; } -- 1.8.5.3