All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/1] vmdk: Use bdrv_nb_sectors() where sectors, not bytes are wanted
Date: Thu, 21 Aug 2014 08:43:23 +0200	[thread overview]
Message-ID: <8738cql4vo.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <20140821011523.GC2943@T430.nay.redhat.com> (Fam Zheng's message of "Thu, 21 Aug 2014 09:15:23 +0800")

Fam Zheng <famz@redhat.com> writes:

> On Wed, 08/20 19:07, Markus Armbruster wrote:
>> Instead of bdrv_getlength().
>> 
>> Commit 57322b7 did this all over block, but one more bdrv_getlength()
>> has crept in since.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  block/vmdk.c | 11 +++++------
>>  1 file changed, 5 insertions(+), 6 deletions(-)
>> 
>> diff --git a/block/vmdk.c b/block/vmdk.c
>> index 01412a8..3b74e85 100644
>> --- a/block/vmdk.c
>> +++ b/block/vmdk.c
>> @@ -397,7 +397,7 @@ static int vmdk_add_extent(BlockDriverState *bs,
>>  {
>>      VmdkExtent *extent;
>>      BDRVVmdkState *s = bs->opaque;
>> -    int64_t length;
>> +    int64_t nb_sectors;
>>  
>>      if (cluster_sectors > 0x200000) {
>>          /* 0x200000 * 512Bytes = 1GB for one cluster is unrealistic */
>> @@ -413,9 +413,9 @@ static int vmdk_add_extent(BlockDriverState *bs,
>>          return -EFBIG;
>>      }
>>  
>> -    length = bdrv_getlength(file);
>> -    if (length < 0) {
>> -        return length;
>> +    nb_sectors = bdrv_getlength(file);
>
> Should be bdrv_nb_sectors.

Brown paperbag...  I shouldn't do "trivial" patches when tired.

I wish "make check-block" covered a bit more, or there was something
that does while being trivial enough for me to run it unthinkingly.

Thanks!

[...]

  reply	other threads:[~2014-08-21  6:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 17:07 [Qemu-devel] [PATCH 1/1] vmdk: Use bdrv_nb_sectors() where sectors, not bytes are wanted Markus Armbruster
2014-08-20 18:55 ` Eric Blake
2014-08-21  1:15 ` Fam Zheng
2014-08-21  6:43   ` Markus Armbruster [this message]
2014-08-21  7:09     ` Fam Zheng
2014-08-21  8:35     ` Kevin Wolf
2014-08-21 12:22       ` Markus Armbruster
2014-08-21 12:33         ` 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=8738cql4vo.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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.