]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: catch unsupported growing of qcow2 images 41654/head
authorKai Lüke <kai@amutable.com>
Thu, 16 Apr 2026 06:10:02 +0000 (15:10 +0900)
committerKai Lüke <kai@amutable.com>
Fri, 17 Apr 2026 11:07:15 +0000 (20:07 +0900)
For qcow2 images it's not enough to grow the file. Since we probably
don't want to shell out to qemu-img either let's just error out to make
the user aware that growing needs to be done manually.

src/vmspawn/vmspawn.c

index 548a083fac5c6897059c2fc14599b5c80eff0019..c970cd4ba631b6814cfc23e02fdd13d0342773c5 100644 (file)
@@ -4001,6 +4001,10 @@ static int verify_arguments(void) {
                         log_warning("--grow-image has no effect with --image-disk-type=scsi-cd (CD-ROMs are read-only).");
         }
 
+        if (arg_grow_image && arg_image_format == IMAGE_FORMAT_QCOW2)
+                return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+                                       "--grow-image is not supported for qcow2 images, use 'qemu-img resize FILE SIZE'.");
+
         return 0;
 }