qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@suse.de>
To: Laurent Vivier <Laurent.Vivier@bull.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/4] qcow2: Clean-up	update_cluster_refcount().
Date: Fri, 07 Nov 2008 09:54:31 +0100	[thread overview]
Message-ID: <49140247.5090508@suse.de> (raw)
In-Reply-To: <1226047715.4046.8.camel@frecb07144>

Laurent Vivier schrieb:
> Le jeudi 06 novembre 2008 à 18:32 +0100, Kevin Wolf a écrit :
>> Laurent Vivier schrieb:
>>> pièce jointe document texte brut
>>> (0001-Clean-up-update_cluster_refcount.patch)
>>> Move some parts to alloc_refcount_block() and block cache
>>>  checking to load_refcount_block().
>>>
>>> Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
>>> ---
>>>  block-qcow2.c |   71 +++++++++++++++++++++++++++++++++++-----------------------
>>>  1 file changed, 43 insertions(+), 28 deletions(-)
>>>
>>> Index: qemu/block-qcow2.c
>>> ===================================================================
>>> --- qemu.orig/block-qcow2.c	2008-11-06 16:34:46.000000000 +0100
>>> +++ qemu/block-qcow2.c	2008-11-06 16:40:27.000000000 +0100
>>> @@ -2169,6 +2169,10 @@ static int load_refcount_block(BlockDriv
>>>  {
>>>      BDRVQcowState *s = bs->opaque;
>>>      int ret;
>>> +
>>> +    if (refcount_block_offset == s->refcount_block_cache_offset)
>>> +        return 0;
>>> +
>>>      ret = bdrv_pread(s->hd, refcount_block_offset, s->refcount_block_cache,
>>>                       s->cluster_size);
>>>      if (ret != s->cluster_size)
>>> @@ -2189,11 +2193,8 @@ static int get_refcount(BlockDriverState
>>>      refcount_block_offset = s->refcount_table[refcount_table_index];
>>>      if (!refcount_block_offset)
>>>          return 0;
>>> -    if (refcount_block_offset != s->refcount_block_cache_offset) {
>>> -        /* better than nothing: return allocated if read error */
>>> -        if (load_refcount_block(bs, refcount_block_offset) < 0)
>>> -            return 1;
>>> -    }
>>> +    if (load_refcount_block(bs, refcount_block_offset) < 0)
>>> +        return 1;
>> Please retain the comment saying that 1 is not the correct value but we
>> default to allocated for safety if the block could not be read. I don't
>> think this is obvious.
> 
> I totally agree with you, but it's just a code move, I don't want to
> change anything except the line numbers.
> 
> I think this kind of change must have its own patch.

No, it's a move which drops a comment and it shouldn't do that. ;-)

> -        /* better than nothing: return allocated if read error */

Kevin

  reply	other threads:[~2008-11-07  8:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20081106165212.380421945@bull.net>
2008-11-06 16:55 ` [Qemu-devel] [PATCH 1/4] qcow2: Clean-up update_cluster_refcount() Laurent Vivier
2008-11-06 17:32   ` Kevin Wolf
2008-11-07  8:48     ` Laurent Vivier
2008-11-07  8:54       ` Kevin Wolf [this message]
2008-11-07  9:22         ` Laurent Vivier
2008-11-06 16:55 ` [Qemu-devel] [PATCH 2/4] qcow2: Allow update_cluster_refcount() to update several clusters refcount Laurent Vivier
2008-11-06 18:11   ` Kevin Wolf
2008-11-07 10:03     ` Laurent Vivier
2008-11-07 10:21       ` Kevin Wolf
2008-11-07 11:39         ` Laurent Vivier
2008-11-06 16:55 ` [Qemu-devel] [PATCH 3/4] qcow2: Align I/O access to l2 table and refcount block Laurent Vivier
2008-11-06 16:56 ` [Qemu-devel] [PATCH 4/4] qcow2: detect if no disk cache Laurent Vivier

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=49140247.5090508@suse.de \
    --to=kwolf@suse.de \
    --cc=Laurent.Vivier@bull.net \
    --cc=qemu-devel@nongnu.org \
    /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).