From: Lorenz Stechauner <l.stechauner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v4 qemu-server] vm_start: check if storages of volumes support correct content-type
Date: Tue, 22 Jun 2021 14:30:30 +0200 [thread overview]
Message-ID: <20210622123030.2586071-1-l.stechauner@proxmox.com> (raw)
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
---
changes to v3:
* dropped already applied patch
* moved check to cfg2cmd (with helper)
* 'images' content-type is not anymore hard-coded
vm state files are not included anymore and efi disks have type 'images' - therefore they should work
PVE/QemuServer.pm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index fe31741..d8e2d44 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3610,6 +3610,7 @@ sub config_to_command {
my ($ds, $drive) = @_;
if (PVE::Storage::parse_volume_id($drive->{file}, 1)) {
+ check_volume_storage_type($storecfg, $drive->{file});
push @$vollist, $drive->{file};
}
@@ -7736,4 +7737,17 @@ sub vm_is_paused {
return $qmpstatus && $qmpstatus->{status} eq "paused";
}
+sub check_volume_storage_type {
+ my ($storecfg, $vol) = @_;
+
+ my ($storeid, $volname) = PVE::Storage::parse_volume_id($vol);
+ my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
+ my ($vtype) = PVE::Storage::parse_volname($storecfg, $vol);
+
+ die "storage '$storeid' does not support content-type '$vtype'\n"
+ if !$scfg->{content}->{$vtype};
+
+ return 1;
+}
+
1;
--
2.30.2
next reply other threads:[~2021-06-22 12:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-22 12:30 Lorenz Stechauner [this message]
2021-06-23 10:06 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210622123030.2586071-1-l.stechauner@proxmox.com \
--to=l.stechauner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox