From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Weil <weil@mail.berlios.de>
Cc: QEMU Developers <qemu-devel@nongnu.org>, Christoph Hellwig <hch@lst.de>
Subject: Re: [Qemu-devel] [PATCH] Add new block driver for the VDI format (use aio)
Date: Mon, 27 Jul 2009 10:00:34 +0200 [thread overview]
Message-ID: <4A6D5EA2.2080706@redhat.com> (raw)
In-Reply-To: <4A69DF48.7000109@mail.berlios.de>
Stefan Weil schrieb:
>>> +/* Enable (currently) unsupported features (not implemented yet). */
>>> +//~ #define CONFIG_VDI_UNSUPPORTED
>>> +
>>> +/* Support non-standard block (cluster) size. */
>>> +//~ #define CONFIG_VDI_BLOCK_SIZE
>>>
>> Actually, this is only about support for image creation. Any reason why
>> we shouldn't support creating images with non-standard block sizes? The
>> code already supports opening such images unconditionally, so the only
>> effect of turning it off for image creation is that we can't test that
>> functionality in qemu-iotests.
>>
>> [Oh, sorry, actually there is a check in open which I missed at first.
>> Any reason why we can't support it? But it's consistent at least.]
>>
>
> Multiples of 512 (SECTOR_SIZE) might work.
>
> VirtualBox uses 1 MiB blocks, and I did not see options to create images
> with different block sizes. Maybe they even don't support such images.
> So I did not spend the time to test other block sizes.
> Why implement things nobody needs?
Ok, that makes sense. Probably we should remove the #define completely
then. I mean, why creating images that nobody - not even we ourselves -
can read?
>>
>>> +/* Support static (pre-allocated) images. */
>>> +#define CONFIG_VDI_STATIC_IMAGE
>>> +
>>> +/* Command line option for static images. */
>>> +#define BLOCK_OPT_STATIC "static"
>>>
>> What about calling it "preallocate" and moving it to block_int.h? I
>> think this could make sense for other drivers, too.
>>
>
> Yes, this would be reasonable if we had more drivers with support
> for "preallocate".
>
> The VDI documentation calls these images "static", and they prefer
> dynamic images, so this static option is not really very important.
I might consider implementing it for qcow2. Cluster allocation is the
really slow part, so having complete L1/L2 tables in place from the very
beginning could speed up things.
Though I guess that for static images typically not only metadata is
preallocated, but zeros are written for the whole disk content? Maybe we
could implement a three-way flag like preallocate=[no,metadata,data] and
let qemu-img handle the data part (writing zeros is the same for all
formats and would even work with raw).
>>> +static int vdi_make_empty(BlockDriverState *bs)
>>> +{
>>> + /* TODO: missing code. */
>>> + logout("\n");
>>> + return 0;
>>> +}
>>>
>> If you don't implement it, leave it out. Setting
>> bdrv_vdi.bdrv_make_empty != NULL means that you claim to have that
>> functionality.
>>
>>
>
> I did not analyse what *_make_empty is supposed to do.
> This is one of the details were hints of the block driver experts
> would be helpful.
It's used after committing to a backing file. qcow1 seems to be the only
format actually implementing it. It complete clears the L1/L2 tables (=
the block map for VDI) so that all accesses go to the backing file again
and it can shrink the image file.
>>> +
>>> +#if defined(CONFIG_AIO)
>>> +
>>> +#if 0
>>>
>> I guess you should remove this block before the patch is included.
>>
>
> This is also one of the details were hints of the block driver experts
> would be helpful as I did not understand this aio_remove / aio_cancel
> mechanism.
I wouldn't consider myself an AIO expert and I don't want to tell you
something wrong, so maybe Christoph would be the right one here?
>> Does VDI support compression even theoretically?
>>
>
> I think it would be possible to extend the specification
> to support compression or encryption.
>
> The official specification (as far as I know it) does not
> support compression (nor encryption).
Then remove the entry. The function vdi_write_compressed doesn't exist
and doesn't even make sense with the current specification. The same
applies for vdi_set_key.
Kevin
next prev parent reply other threads:[~2009-07-27 8:02 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-03 19:24 [Qemu-devel] [PATCH] RFC: Add new block driver for the VDI format Stefan Weil
2009-07-03 19:29 ` [Qemu-devel] [PATCH] Check availability of uuid header / lib Stefan Weil
2009-07-03 19:29 ` [Qemu-devel] [PATCH] Add new block driver for the VDI format Stefan Weil
2009-07-05 8:05 ` Christoph Hellwig
2009-07-05 14:02 ` Stefan Weil
2009-07-06 10:25 ` Christoph Hellwig
2009-07-06 17:19 ` Stefan Weil
2009-07-05 14:44 ` Kevin Wolf
2009-07-06 13:37 ` [Qemu-devel] [PATCH] RFC: " Anthony Liguori
2009-07-06 21:10 ` Stefan Weil
2009-07-06 21:28 ` Anthony Liguori
2009-07-07 7:55 ` Kevin Wolf
2009-07-07 9:04 ` Jamie Lokier
2009-07-07 10:30 ` Christoph Hellwig
2009-07-07 10:33 ` Kevin Wolf
2009-08-02 14:27 ` Avi Kivity
2009-08-03 2:25 ` Anthony Liguori
2009-08-03 13:02 ` Avi Kivity
2009-08-03 15:20 ` Christoph Hellwig
2009-07-23 15:58 ` [Qemu-devel] [PATCH] RFC: Add new block driver for the VDI format (aio version) Stefan Weil
2009-07-23 20:27 ` [Qemu-devel] [PATCH] Check availability of uuid header / lib Stefan Weil
2009-07-24 6:32 ` Christoph Egger
2009-10-01 18:13 ` Stefan Weil
2009-10-02 8:32 ` Christoph Egger
2009-10-01 18:10 ` [Qemu-devel] [PATCH] Check availability of uuid header / library Stefan Weil
2009-07-23 20:29 ` [Qemu-devel] [PATCH] Add new block driver for the VDI format (use aio) Stefan Weil
2009-07-24 9:18 ` Kevin Wolf
2009-07-24 16:20 ` Stefan Weil
2009-07-27 8:00 ` Kevin Wolf [this message]
2009-07-27 9:23 ` Jamie Lokier
2009-07-28 6:37 ` Amit Shah
2009-07-28 8:34 ` Jamie Lokier
2009-07-28 8:56 ` Daniel P. Berrange
2009-07-28 9:03 ` Jamie Lokier
2009-07-28 9:11 ` Kevin Wolf
2009-07-31 15:04 ` Christoph Hellwig
2009-07-31 19:53 ` Stefan Weil
2009-07-31 15:25 ` Anthony Liguori
2009-07-31 18:27 ` Stefan Weil
2009-07-31 19:45 ` [Qemu-devel] [PATCH] Add new block driver for the VDI format (only aio supported) Stefan Weil
2009-07-23 20:30 ` [Qemu-devel] [PATCH] add support for new option of vdi format Stefan Weil
2009-07-23 20:34 ` [Qemu-devel] " Stefan Weil
2009-07-31 14:59 ` [Qemu-devel] " Christoph Hellwig
2009-08-13 16:53 ` Christoph Hellwig
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=4A6D5EA2.2080706@redhat.com \
--to=kwolf@redhat.com \
--cc=hch@lst.de \
--cc=qemu-devel@nongnu.org \
--cc=weil@mail.berlios.de \
/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).