All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] Add 'offset' and 'size' options
@ 2016-10-17 22:25 Tomáš Golembiovský
  2016-10-17 22:25 ` [Qemu-devel] [PATCH v2] raw_bsd: add offset and size options Tomáš Golembiovský
  2016-10-18 11:49 ` [Qemu-devel] [PATCH v2] Add 'offset' and 'size' options Kevin Wolf
  0 siblings, 2 replies; 5+ messages in thread
From: Tomáš Golembiovský @ 2016-10-17 22:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Tomáš Golembiovský, Kevin Wolf, Max Reitz,
	Markus Armbruster, Eric Blake, qemu-block

This is a follow-up to the patch:
    [PATCH] raw-posix: add 'offset' and 'size' options

The main changes are:
 -  options were moved from 'file' driver into 'raw' driver as suggested
 -  added support for writing, reopen and truncate when possible

If I forgot to address somebody's comments feel free to raise them again,
please.

Some general notes to the code:

1)  The size is rounded *down* to the 512 byte boundary. It's not that
    the raw driver really cares about this, but if we don't do it then 
    bdrv_getlength() will do that instead of us. The problem is that
    bdrv_getlength() does round *up* and this can lead to reads/writes
    outside the specified 'size'.

2)  We don't provide '.bdrv_get_allocated_file_size' function. As a
    result the information about allocated disk size reports size of the
    whole file. This is, rather confusingly, larger than the provided
    'size'. But I don't think this matters much. Note that we don't have
    any easy way how to get the correct information here apart from
    checking all the block with bdrv_co_get_block_status() (as suggested
    by Kevin Wolf).

3)  No options for raw_create(). The 'size' and 'offset' options were
    added only to open/reopen. In my opinion there is no real reason for
    them there. AFAIK you cannot create embeded QCOW2/VMDK/etc. image
    that way anyway.


Tomáš Golembiovský (1):
  raw_bsd: add offset and size options

 block/raw_bsd.c      | 169 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 qapi/block-core.json |  16 ++++-
 2 files changed, 181 insertions(+), 4 deletions(-)

-- 
2.10.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-18 13:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-17 22:25 [Qemu-devel] [PATCH v2] Add 'offset' and 'size' options Tomáš Golembiovský
2016-10-17 22:25 ` [Qemu-devel] [PATCH v2] raw_bsd: add offset and size options Tomáš Golembiovský
2016-10-18 12:03   ` Daniel P. Berrange
2016-10-18 13:03   ` Kevin Wolf
2016-10-18 11:49 ` [Qemu-devel] [PATCH v2] Add 'offset' and 'size' options Kevin Wolf

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.