]> Git Repo - qemu.git/commitdiff
block: Add notes to iSCSI's .bdrv_open and .bdrv_reopen_prepare
authorJeff Cody <[email protected]>
Tue, 4 Feb 2014 19:12:44 +0000 (14:12 -0500)
committerStefan Hajnoczi <[email protected]>
Fri, 14 Feb 2014 12:38:35 +0000 (13:38 +0100)
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 <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
block/iscsi.c

index 8d0f9667c507f3fe0d5718ee329e1c9096ece572..c97c04060dca61681a8ef7814ecbf62a742d81a5 100644 (file)
@@ -1099,6 +1099,10 @@ fail:
 /*
  * We support iscsi url's on the form
  * iscsi://[<username>%<password>@]<host>[:<port>]/<targetname>/<lun>
+ *
+ * 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;
 }
 
This page took 0.036279 seconds and 4 git commands to generate.