qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>,
	qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, eblake@redhat.com, kwolf@redhat.com,
	mreitz@redhat.com, den@openvz.org, vsementsov@virtuozzo.com
Subject: Re: [Qemu-devel] [PATCH 1/1] nbd: implement bdrv_get_info callback
Date: Thu, 18 Jan 2018 13:09:42 +0100	[thread overview]
Message-ID: <1b55edad-f820-6898-1630-ccc76e6c4845@redhat.com> (raw)
In-Reply-To: <20180118115158.17219-1-edgar.kaziakhmedov@virtuozzo.com>

On 18/01/2018 12:51, Edgar Kaziakhmedov wrote:
> 
> +static int nbd_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
> +{
> +    if (bs->supported_zero_flags & BDRV_REQ_MAY_UNMAP) {
> +        bdi->can_write_zeroes_with_unmap = true;
> +    }
> +    return 0;
> +}
> +

Other drivers set the flag always, while NBD only sets it if the server
knows the flag.

I think NBD is more correct, so:

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

However, it would be nice to remove can_write_zeroes_with_unmap from
BlockDriverInfo, and make bdrv_can_write_zeroes_with_unmap just return
!!(bs->supported_zero_flags & BDRV_REQ_MAY_UNMAP).  Kevin, what do you
think?

Paolo

  reply	other threads:[~2018-01-18 12:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 11:51 [Qemu-devel] [PATCH 1/1] nbd: implement bdrv_get_info callback Edgar Kaziakhmedov
2018-01-18 12:09 ` Paolo Bonzini [this message]
2018-01-26 12:39   ` Edgar Kaziakhmedov
2018-01-26 14:28     ` Eric Blake
2018-02-02 14:06       ` Edgar Kaziakhmedov
2018-02-02 14:15         ` Eric Blake
2018-02-02 14:23           ` Edgar Kaziakhmedov

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=1b55edad-f820-6898-1630-ccc76e6c4845@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=edgar.kaziakhmedov@virtuozzo.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /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).