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ý <[email protected]>

> @@ -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);
 }

Reply via email to