From: Kai Lüke Date: Thu, 16 Apr 2026 06:10:02 +0000 (+0900) Subject: vmspawn: catch unsupported growing of qcow2 images X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50d4e25f37fa8860ff3a0457f36362d6953fbfd2;p=thirdparty%2Fsystemd.git 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. --- 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; }