qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/3] Combine bdrv_co_readv and bdrv_co_writev into bdrv_co_rw_vector
Date: Wed, 29 Feb 2012 17:01:30 +0100	[thread overview]
Message-ID: <4F4E4BDA.9000304@redhat.com> (raw)
In-Reply-To: <1330473276-8975-4-git-send-email-mjt@msgid.tls.msk.ru>

Il 29/02/2012 00:54, Michael Tokarev ha scritto:
>      BlockDriver *drv = bs->drv;
>      BdrvTrackedRequest req;
> +    bool is_write = flags & (BDRV_REQ_WRITE|BDRV_REQ_ZERO_WRITE);
>      int ret;

You can do BDRV_REQ_WRITE|BDRV_REQ_ZERO_WRITE, but not
BDRV_REQ_READ|BDRV_REQ_COPY_ON_READ.  That's ugly.

> +/* defines for is_write for bdrv_*_rw_vector */
> +#define BDRV_READ	false
> +#define BDRV_WRITE	true
> +

Please no, if you have to do this just change to bits.  This would have
the advantage of passing all the flags, including COPY_ON_READ.  In some
sense discard could be treated as a write too.

I don't oppose this change completely, in fact I think adding the flags
to co_readv/co_writev would be a good change.  But I'm skeptical, the
actual amount of unification is not that large.

Paolo

  reply	other threads:[~2012-02-29 16:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1330473276-8975-1-git-send-email-mjt@tls.msk.ru>
2012-02-28 23:54 ` [Qemu-devel] [PATCH 1/3] Combine bdrv_read and bdrv_write to bdrv_rw Michael Tokarev
2012-02-29 15:53   ` Paolo Bonzini
2012-02-29 16:00     ` Michael Tokarev
2012-02-29 16:07       ` Paolo Bonzini
2012-02-29 16:36         ` Michael Tokarev
2012-02-28 23:54 ` [Qemu-devel] [PATCH 2/3] Combine bdrv_aio_readv and bdrv_aio_writev into bdrv_aio_rw_vector Michael Tokarev
2012-02-29 15:54   ` Paolo Bonzini
2012-02-29 16:16     ` Michael Tokarev
2012-02-28 23:54 ` [Qemu-devel] [PATCH 3/3] Combine bdrv_co_readv and bdrv_co_writev into bdrv_co_rw_vector Michael Tokarev
2012-02-29 16:01   ` Paolo Bonzini [this message]
2012-02-29 16:12     ` Michael Tokarev
2012-02-29 16:24       ` Paolo Bonzini
2012-02-29 16:45         ` Michael Tokarev

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=4F4E4BDA.9000304@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mjt@tls.msk.ru \
    --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).