qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, kwolf@redhat.com, mreitz@redhat.com
Subject: [Qemu-devel] [PATCH v2 5/5] include/block/block_int: Document protocol related functions
Date: Mon, 12 Mar 2018 19:07:53 -0300	[thread overview]
Message-ID: <20180312220753.20096-6-farosas@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180312220753.20096-1-farosas@linux.vnet.ibm.com>

Clarify that:

- for protocols the brdv_file_open function is used instead
of bdrv_open;

- when protocol_name is set, a driver should expect
to be given only a filename and no other options.

Signed-off-by: Fabiano Rosas <farosas@linux.vnet.ibm.com>
---
 include/block/block_int.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/block/block_int.h b/include/block/block_int.h
index 27e17addba..c4dd1d4bb8 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -126,6 +126,8 @@ struct BlockDriver {
 
     int (*bdrv_open)(BlockDriverState *bs, QDict *options, int flags,
                      Error **errp);
+
+    /* Protocol drivers should implement this instead of bdrv_open */
     int (*bdrv_file_open)(BlockDriverState *bs, QDict *options, int flags,
                           Error **errp);
     void (*bdrv_close)(BlockDriverState *bs);
@@ -251,6 +253,12 @@ struct BlockDriver {
      */
     int coroutine_fn (*bdrv_co_flush_to_os)(BlockDriverState *bs);
 
+    /*
+     * Drivers setting this field must be able to work with just a plain
+     * filename with '<protocol_name>:' as a prefix, and no other options.
+     * Options may be extracted from the filename by implementing
+     * bdrv_parse_filename.
+     */
     const char *protocol_name;
     int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset,
                          PreallocMode prealloc, Error **errp);
-- 
2.13.6

  parent reply	other threads:[~2018-03-12 22:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 22:07 [Qemu-devel] [PATCH v2 0/5] block: Ensure non-protocol drivers can only be selected explicitly Fabiano Rosas
2018-03-12 22:07 ` [Qemu-devel] [PATCH v2 1/5] block/replication: Remove protocol_name field Fabiano Rosas
2018-03-12 22:07 ` [Qemu-devel] [PATCH v2 2/5] block/quorum: Remove protocol-related fields Fabiano Rosas
2018-03-14 15:15   ` Alberto Garcia
2018-03-12 22:07 ` [Qemu-devel] [PATCH v2 3/5] block/throttle: " Fabiano Rosas
2018-03-14 15:18   ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2018-03-12 22:07 ` [Qemu-devel] [PATCH v2 4/5] block/blkreplay: " Fabiano Rosas
2018-03-12 22:07 ` Fabiano Rosas [this message]
2018-03-20 10:48 ` [Qemu-devel] [PATCH v2 0/5] block: Ensure non-protocol drivers can only be selected explicitly Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180312220753.20096-6-farosas@linux.vnet.ibm.com \
    --to=farosas@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).