From: Kevin Wolf <kwolf@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 12/17] block: Convert bdrv_write() to BdrvChild
Date: Wed, 29 Jun 2016 17:33:58 +0200 [thread overview]
Message-ID: <20160629153358.GC4831@noname.redhat.com> (raw)
In-Reply-To: <02972b11-ccb3-5c2a-844b-611061506338@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2298 bytes --]
Am 29.06.2016 um 17:22 hat Max Reitz geschrieben:
> On 29.06.2016 14:11, Kevin Wolf wrote:
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
> > ---
> >
> > This patch contains non-trivial fixes, so I think it's worth sending out a v2
> > for it even though I already applied the series. I added a coroutine entry
> > wrapper qcow(2)_write that can be used from .bdrv_write_compressed. These
> > wrappers will soon disappear again when .bdrv_write_compressed is changed into
> > .bdrv_co_pwritev_compressed (Pavel Butsykin's backup compression series).
> >
> > block/io.c | 5 +++--
> > block/qcow.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
> > block/qcow2-cluster.c | 2 +-
> > block/qcow2-refcount.c | 2 +-
> > block/qcow2.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
> > block/vdi.c | 4 ++--
> > block/vvfat.c | 5 ++---
> > include/block/block.h | 2 +-
> > 8 files changed, 100 insertions(+), 12 deletions(-)
>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
>
> [...]
>
> > diff --git a/block/qcow2.c b/block/qcow2.c
> > index 0178931..cd9c27b 100644
> > --- a/block/qcow2.c
> > +++ b/block/qcow2.c
> > @@ -2533,6 +2533,51 @@ static int qcow2_truncate(BlockDriverState *bs, int64_t offset)
> > return 0;
> > }
> >
> > +typedef struct Qcow2WriteCo {
> > + BlockDriverState *bs;
> > + int64_t sector_num;
> > + const uint8_t *buf;
> > + int nb_sectors;
> > + int ret;
> > +} Qcow2WriteCo;
> > +
> > +static void qcow2_write_co_entry(void *opaque)
> > +{
> > + Qcow2WriteCo *co = opaque;
> > + QEMUIOVector qiov;
> > + uint64_t offset = co->sector_num * BDRV_SECTOR_SIZE;
> > + uint64_t bytes = co->nb_sectors * BDRV_SECTOR_SIZE;
>
> It doesn't make much sense to make this a uint64_t, and I'm afraid
> Coverity will complain about it... It's not wrong, though, but an int
> would have been more "honest".
Hm, just copied from vmdk... Anyway, you right that we don't really need
uint64_t here because of BDRV_REQUEST_MAX_SECTORS, but BDRV_SECTOR_SIZE
is unsigned long long, so at least this is a proper 64 bit calculation
and Coverity should stay silent.
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2016-06-29 15:34 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-21 9:21 [Qemu-devel] [PATCH 00/17] block: Convert common I/O path to BdrvChild Kevin Wolf
2016-06-21 9:21 ` [Qemu-devel] [PATCH 01/17] vvfat: Use BdrvChild for s->qcow Kevin Wolf
2016-06-22 16:54 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 02/17] blkreplay: Convert to byte-based I/O Kevin Wolf
2016-06-22 17:03 ` Max Reitz
2016-06-22 17:15 ` Eric Blake
2016-06-21 9:21 ` [Qemu-devel] [PATCH 03/17] vhdx: Some more BlockBackend use in vhdx_create() Kevin Wolf
2016-06-22 17:08 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 04/17] block: Convert bdrv_co_readv() to BdrvChild Kevin Wolf
2016-06-25 15:07 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 05/17] block: Convert bdrv_co_writev() " Kevin Wolf
2016-06-25 15:14 ` Max Reitz
2016-06-27 8:56 ` Kevin Wolf
2016-06-21 9:21 ` [Qemu-devel] [PATCH 06/17] block: Convert bdrv_aio_readv() " Kevin Wolf
2016-06-25 15:16 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 07/17] block: Convert bdrv_aio_writev() " Kevin Wolf
2016-06-25 15:20 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 08/17] block: Convert bdrv_co_do_readv/writev " Kevin Wolf
2016-06-25 15:26 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 09/17] block: Move bdrv_commit() to block/commit.c Kevin Wolf
2016-06-24 15:37 ` Eric Blake
2016-06-21 9:21 ` [Qemu-devel] [PATCH 10/17] block: Use BlockBackend for I/O in bdrv_commit() Kevin Wolf
2016-06-25 15:34 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 11/17] block: Convert bdrv_read() to BdrvChild Kevin Wolf
2016-06-27 13:24 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 12/17] block: Convert bdrv_write() " Kevin Wolf
2016-06-27 13:44 ` Max Reitz
2016-06-27 13:47 ` Max Reitz
2016-06-29 12:11 ` [Qemu-devel] [PATCH v2 " Kevin Wolf
2016-06-29 15:22 ` Max Reitz
2016-06-29 15:33 ` Kevin Wolf [this message]
2016-06-29 15:37 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 13/17] block: Convert bdrv_pread(v) " Kevin Wolf
2016-06-27 14:55 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 14/17] block: Convert bdrv_pwrite(v/_sync) " Kevin Wolf
2016-06-27 15:07 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 15/17] block: Convert bdrv_pwrite_zeroes() " Kevin Wolf
2016-06-27 15:12 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 16/17] block: Convert bdrv_prwv_co() " Kevin Wolf
2016-06-27 15:19 ` Max Reitz
2016-06-21 9:21 ` [Qemu-devel] [PATCH 17/17] block: Convert bdrv_co_preadv/pwritev " Kevin Wolf
2016-06-21 9:47 ` [Qemu-devel] [PATCH 00/17] block: Convert common I/O path " Paolo Bonzini
2016-06-21 10:56 ` Kevin Wolf
2016-06-21 11:01 ` Paolo Bonzini
2016-06-21 11:31 ` Kevin Wolf
2016-06-22 8:37 ` Fam Zheng
2016-06-28 13:28 ` Stefan Hajnoczi
2016-06-29 11:58 ` 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=20160629153358.GC4831@noname.redhat.com \
--to=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).