All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: 叶残风 <renyime@gmail.com>, eblake@redhat.com
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-img: return allocated size for block device with qcow2 format
Date: Fri, 4 May 2018 16:35:52 +0200	[thread overview]
Message-ID: <325f0743-7fca-0aab-c0f2-1ab46f94864b@redhat.com> (raw)
In-Reply-To: <CA+6E1=kp+xYKEc0Xz8tj8M0r4nGb8PG+vxvxm=cDTEGCEsDTPg@mail.gmail.com>

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

On 2018-05-03 15:06, 叶残风 wrote:
> 
> Thanks for your review, Eric.
> Yes, the wr_highest_offset can tell the end offset at runtime, and 
> write_threshold similar to it. But in my situation, I need to know 
> the allocated end without a vm running.

Oh, I've just seen that your patch doesn't even get the allocated size,
it actually determines the highest allocated offset.  Well, those are
two different things.  You should not return this value via
qcow2_get_allocated_file_size().  I'm not sure where it should go
(probably wr_highest_offset?) and how it should be presented in
qemu-img, though.

Also note that bdrv_get_allocated_file_size() is called by QMP's
query-named-block-nodes and query-block, both of which are online
synchronous functions.  It should not take a long time, specifically it
should not scan the whole qcow2 file.

Max


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

  reply	other threads:[~2018-05-04 14:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02 13:34 [Qemu-devel] [PATCH] qemu-img: return allocated size for block device with qcow2 format Ivan Ren
2018-05-02 14:02 ` Eric Blake
2018-05-03 13:06   ` 叶残风
2018-05-04 14:35     ` Max Reitz [this message]
2018-05-04 15:57       ` Ivan Ren
2018-05-02 14:37 ` Max Reitz
2018-05-02 15:01   ` Eric Blake
2018-05-02 15:13     ` Max Reitz
2018-05-02 15:19       ` Eric Blake
2018-05-02 15:33         ` Max Reitz
2018-05-03 13:08   ` 叶残风
2018-05-04 14:27     ` Max Reitz

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=325f0743-7fca-0aab-c0f2-1ab46f94864b@redhat.com \
    --to=mreitz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=renyime@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.