qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, vsementsov@virtuozzo.com, den@virtuozzo.com
Subject: Re: [Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server
Date: Wed, 22 Feb 2017 17:51:10 +0100	[thread overview]
Message-ID: <ecab92ba-94d4-7b1d-c854-fa2ff9b93acc@redhat.com> (raw)
In-Reply-To: <20170221024248.11027-8-eblake@redhat.com>



On 21/02/2017 03:42, Eric Blake wrote:
> +    /* Send NBD_INFO_BLOCK_SIZE always, but tweak the minimum size
> +     * according to whether the client requested it, and according to
> +     * whether this is OPT_INFO or OPT_GO. */
> +    /* minimum - 1 for back-compat, or 512 if client is new enough.
> +     * TODO: consult blk_bs(blk)->request_align? */
> +    sizes[0] = (opt == NBD_OPT_INFO || blocksize) ? BDRV_SECTOR_SIZE : 1;
> +    /* preferred - At least 4096, but larger as appropriate. */
> +    sizes[1] = MAX(blk_get_opt_transfer(exp->blk), 4096);

Can we just say zero if the preferred transfer size is unknown?

Apart from this, it looks good.

Paolo

> +    /* maximum - At most 32M, but smaller as appropriate. */
> +    sizes[2] = MIN(blk_get_max_transfer(exp->blk), NBD_MAX_BUFFER_SIZE);
> +    TRACE("advertising minimum 0x%" PRIx32 ", preferred 0x%" PRIx32
> +          ", maximum 0x%" PRIx32, sizes[0], sizes[1], sizes[2]);

  reply	other threads:[~2017-02-22 16:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  2:42 [Qemu-devel] [PATCH v4 0/8] Implement NBD_OPT_GO, block size advertisement Eric Blake
2017-02-21  2:42 ` [Qemu-devel] [PATCH v4 1/8] nbd/client: fix drop_sync [CVE-2017-2630] Eric Blake
2017-02-21  8:11   ` Marc-André Lureau
2017-02-21  2:42 ` [Qemu-devel] [PATCH v4 2/8] nbd: Create struct for tracking export info Eric Blake
2017-02-21  8:11   ` Marc-André Lureau
2017-02-21  2:42 ` [Qemu-devel] [PATCH v4 3/8] block: Add blk_get_opt_transfer() Eric Blake
2017-02-21  8:11   ` Marc-André Lureau
2017-02-21  2:42 ` [Qemu-devel] [PATCH v4 4/8] nbd: Expose and debug more NBD constants Eric Blake
2017-02-21  8:12   ` Marc-André Lureau
2017-02-21  2:42 ` [Qemu-devel] [PATCH v4 5/8] nbd: Implement NBD_OPT_GO on server Eric Blake
2017-02-21  2:42 ` [Qemu-devel] [PATCH v4 6/8] nbd: Implement NBD_OPT_GO on client Eric Blake
2017-02-21  2:42 ` [Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server Eric Blake
2017-02-22 16:51   ` Paolo Bonzini [this message]
2017-02-22 17:11     ` Eric Blake
2017-02-22 17:26       ` Paolo Bonzini
2017-02-22 20:34         ` Eric Blake
2017-02-23 13:13           ` Paolo Bonzini
2017-02-23 15:38             ` Eric Blake
2017-02-21  2:42 ` [Qemu-devel] [PATCH v4 8/8] nbd: Implement NBD_INFO_BLOCK_SIZE on client Eric Blake

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=ecab92ba-94d4-7b1d-c854-fa2ff9b93acc@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=eblake@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).