]> Git Repo - qemu.git/blobdiff - block/raw-format.c
block: Add PreallocMode to BD.bdrv_truncate()
[qemu.git] / block / raw-format.c
index a1622c6219ebd224814042a06ec3829189d88dff..721c9a025ba3be5fdd213a7c05605c82efbebd97 100644 (file)
@@ -352,10 +352,17 @@ static void raw_refresh_limits(BlockDriverState *bs, Error **errp)
     }
 }
 
-static int raw_truncate(BlockDriverState *bs, int64_t offset, Error **errp)
+static int raw_truncate(BlockDriverState *bs, int64_t offset,
+                        PreallocMode prealloc, Error **errp)
 {
     BDRVRawState *s = bs->opaque;
 
+    if (prealloc != PREALLOC_MODE_OFF) {
+        error_setg(errp, "Unsupported preallocation mode '%s'",
+                   PreallocMode_lookup[prealloc]);
+        return -ENOTSUP;
+    }
+
     if (s->has_size) {
         error_setg(errp, "Cannot resize fixed-size raw disks");
         return -ENOTSUP;
This page took 0.023835 seconds and 4 git commands to generate.