qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [Qemu-devel] [PATCH] Teach block/vdi about "discarded" (no longer allocated) blocks
Date: Thu, 27 Oct 2011 18:12:00 +0200	[thread overview]
Message-ID: <4EA982D0.10902@weilnetz.de> (raw)
In-Reply-To: <4EA91C16.6050908@redhat.com>

Am 27.10.2011 10:53, schrieb Kevin Wolf:
> Am 26.10.2011 21:51, schrieb Eric Sunshine:
>> An entry in the VDI block map will hold an offset to the actual block if
>> the block is allocated, or one of two specially-interpreted values if
>> not allocated. Using VirtualBox terminology, value VDI_IMAGE_BLOCK_FREE
>> (0xffffffff) represents a never-allocated block (semantically arbitrary
>> content). VDI_IMAGE_BLOCK_ZERO (0xfffffffe) represents a "discarded"
>> block (semantically zero-filled). block/vdi knows only about
>> VDI_IMAGE_BLOCK_FREE. Teach it about VDI_IMAGE_BLOCK_ZERO.
>>
>> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
>
> Thanks, applied to the block branch.
>
> Kevin


Kevin, I don't want to block improvements. Nevertheless
I'd like to see a small modification in this patch:
both #defines should be implemented without a type cast.
Please change them or wait until Eric sends an update.

My favorite is this:

#define VDI_UNALLOCATED UINT32_MAX
#define VDI_DISCARD     (VDI_UNALLOCATED - 1)

This would also be ok:

#define VDI_UNALLOCATED 0xffffffffU
#define VDI_DISCARD     0xfffffffeU

Using the macro names and the definitions (with type cast)
from the original VirtualBox code would also be ok.

Cheers,
Stefan

  reply	other threads:[~2011-10-27 16:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26 19:51 [Qemu-devel] [PATCH] Teach block/vdi about "discarded" (no longer allocated) blocks Eric Sunshine
2011-10-26 20:24 ` Stefan Weil
2011-10-26 20:54   ` Eric Sunshine
2011-10-27  7:05 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2011-10-27  8:53 ` [Qemu-devel] " Kevin Wolf
2011-10-27 16:12   ` Stefan Weil [this message]
2011-10-27 16:20     ` Eric Sunshine
2011-10-28  8:00     ` Kevin Wolf
2011-10-28  8:15       ` Eric Sunshine
2011-10-28  9:22         ` Kevin Wolf
2011-10-28 14:33           ` Stefan Weil

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=4EA982D0.10902@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=sunshine@sunshineco.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).