From 50d4e25f37fa8860ff3a0457f36362d6953fbfd2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kai=20L=C3=BCke?= Date: Thu, 16 Apr 2026 15:10:02 +0900 Subject: [PATCH] vmspawn: catch unsupported growing of qcow2 images 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index 548a083fac5..c970cd4ba63 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -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; } -- 2.47.3