qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, 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: Fri, 26 Jan 2018 08:28:21 -0600	[thread overview]
Message-ID: <8b87f82d-2a90-d6cf-0fc4-aee0d704a403@redhat.com> (raw)
In-Reply-To: <5858df64-9495-1332-3c53-fab0204f79a9@virtuozzo.com>

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]

On 01/26/2018 06:39 AM, Edgar Kaziakhmedov wrote:
> PIng
> 
> So, let me know if I need to make any changes in patch
> 
> On 1/18/18 1:09 PM, Paolo Bonzini wrote:
>> 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.

Well, other drivers may be able to always implement it (NBD can only
implement it if the server supports WRITE_ZEROES - and I'm even in the
middle of working up an nbdkit patch [1] that makes it easier to write
an NBD server that specifically does not support WRITE_ZEROES to make
code paths like this easier to test)

[1]

>>
>> I think NBD is more correct, so:
>>
>> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Agreed; I'm fine queueing this on my NBD queue, except I'd first like to
hear Kevin's opinion:

>>
>> 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?

Actually, I may even just give a shot at writing this alternative patch,
to make Kevin's decision easier.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2018-01-26 18:07 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
2018-01-26 12:39   ` Edgar Kaziakhmedov
2018-01-26 14:28     ` Eric Blake [this message]
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=8b87f82d-2a90-d6cf-0fc4-aee0d704a403@redhat.com \
    --to=eblake@redhat.com \
    --cc=den@openvz.org \
    --cc=edgar.kaziakhmedov@virtuozzo.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@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).