[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 1/2] raw_bsd: add offset and size options
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v8 1/2] raw_bsd: add offset and size options |
Date: |
Mon, 31 Oct 2016 12:11:37 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 31.10.2016 um 11:27 hat Tomáš Golembiovský geschrieben:
> 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ý <address@hidden>
> @@ -181,6 +356,10 @@ static BlockAIOCB *raw_aio_ioctl(BlockDriverState *bs,
> BlockCompletionFunc *cb,
> void *opaque)
> {
> + BDRVRawState *s = bs->opaque;
> + if (s->offset || s->has_size) {
> + return NULL;
> + }
> return bdrv_aio_ioctl(bs->file->bs, req, buf, cb, opaque);
> }
>
This hunk had a real merge conflict (aio -> co), so I'm posting my
conflict resolution below.
Kevin
@@ -178,6 +353,10 @@ static void raw_lock_medium(BlockDriverState *bs, bool
locked)
static int raw_co_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
{
+ BDRVRawState *s = bs->opaque;
+ if (s->offset || s->has_size) {
+ return -ENOTSUP;
+ }
return bdrv_co_ioctl(bs->file->bs, req, buf);
}