qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, den@openvz.org, vsementsov@virtuozzo.com,
	dautovri@hpcdlab.com
Subject: [PATCH 2/5] block/prl-xml: add bdrv_co_readv/writev and flush
Date: Fri, 13 Nov 2020 15:58:45 +0300	[thread overview]
Message-ID: <20201113125848.20498-3-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20201113125848.20498-1-vsementsov@virtuozzo.com>

From: Klim Kireev <klim.kireev@virtuozzo.com>

This commit adds bdrv_co_readv, bdrv_co_writev, and bdrv_co_flush_to_os
implementation. It merely passes these functions down
to top BlockDriverState in the snapshot chain.

Signed-off-by: Klim Kireev <klim.kireev@virtuozzo.com>
Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
---
 block/prl-xml.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/block/prl-xml.c b/block/prl-xml.c
index fa9c4fd5fa..5ab32bb6ab 100644
--- a/block/prl-xml.c
+++ b/block/prl-xml.c
@@ -467,6 +467,22 @@ fail:
     return ret;
 }
 
+static coroutine_fn int
+prl_co_readv(BlockDriverState *bs, int64_t sector_num,
+             int nb_sectors, QEMUIOVector *qiov)
+{
+    BDRVPrlXmlState *s = bs->opaque;
+    return bdrv_co_readv(s->image, sector_num, nb_sectors, qiov);
+}
+
+static coroutine_fn int
+prl_co_writev(BlockDriverState *bs, int64_t sector_num,
+              int nb_sectors, QEMUIOVector *qiov)
+{
+    BDRVPrlXmlState *s = bs->opaque;
+    return bdrv_co_writev(s->image, sector_num, nb_sectors, qiov);
+}
+
 static void prl_close_xml(BlockDriverState *bs)
 {
     BDRVPrlXmlState *s = bs->opaque;
@@ -474,11 +490,20 @@ static void prl_close_xml(BlockDriverState *bs)
     xmlFreeDoc(s->xml);
 }
 
+static coroutine_fn int prl_co_flush_to_os(BlockDriverState *bs)
+{
+    BDRVPrlXmlState *s = bs->opaque;
+    return bdrv_co_flush(s->image->bs);
+}
+
 static BlockDriver bdrv_prl_xml = {
     .format_name                = "prl-xml",
     .instance_size              = sizeof(BDRVPrlXmlState),
     .bdrv_open                  = prl_open_xml,
+    .bdrv_co_readv              = prl_co_readv,
+    .bdrv_co_writev             = prl_co_writev,
     .bdrv_close                 = prl_close_xml,
+    .bdrv_co_flush_to_os        = prl_co_flush_to_os,
     .create_opts                = &prl_xml_create_opts,
     .bdrv_child_perm            = bdrv_filter_default_perms,
     .is_filter                  = true
-- 
2.21.3



  parent reply	other threads:[~2020-11-13 13:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 12:58 [PATCH RFC 0/5] block: implement Parallels Disk format driver Vladimir Sementsov-Ogievskiy
2020-11-13 12:58 ` [PATCH 1/5] block/prl-xml: add Parallels xml BlockDriver Vladimir Sementsov-Ogievskiy
2020-11-13 12:58 ` Vladimir Sementsov-Ogievskiy [this message]
2020-11-13 12:58 ` [PATCH 3/5] block/prl-xml: add bdrv_probe Vladimir Sementsov-Ogievskiy
2020-11-13 12:58 ` [PATCH 4/5] block/prl-xml: add bdrv_check Vladimir Sementsov-Ogievskiy
2020-11-13 12:58 ` [PATCH 5/5] iotests: add test for prl-xml format Vladimir Sementsov-Ogievskiy

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=20201113125848.20498-3-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=dautovri@hpcdlab.com \
    --cc=den@openvz.org \
    --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).