Am 19.10.2016 um 17:38 hat Eric Blake geschrieben: > On 10/19/2016 07:27 AM, Tomáš Golembiovský wrote: > > Added two new options 'offset' and 'size'. This makes it possible to use > > only part of the file as a device. This can be used e.g. to limit the > > access only to single partition in a disk image or use a disk inside a > > tar archive (like OVA). > > > > When 'size' is specified we do our best to honour it. > > > > Signed-off-by: Tomáš Golembiovský <tgole...@redhat.com> > > --- > > block/raw_bsd.c | 168 > > ++++++++++++++++++++++++++++++++++++++++++++++++++- > > qapi/block-core.json | 16 ++++- > > 2 files changed, 180 insertions(+), 4 deletions(-) > > > > diff --git a/block/raw_bsd.c b/block/raw_bsd.c > > index 588d408..25b5ba8 100644 > > --- a/block/raw_bsd.c > > +++ b/block/raw_bsd.c > > @@ -31,6 +31,30 @@ > > #include "qapi/error.h" > > #include "qemu/option.h" > > > > +typedef struct BDRVRawState { > > + uint64_t offset; > > + uint64_t size; > > + bool has_size; > > +} BDRVRawState; > > This seems like it is duplicating a struct that QAPI should be able to > give us for free, if we would just use it.
Possibly it has the same fields as BlockdevOptionsRaw, but I would use QAPI structs only for configuring a block device and not for its state after opening it (i.e. bs->opaque). So I agree with the explicit definition here. Kevin
pgphSicRo8MJI.pgp
Description: PGP signature