public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Lorenz Stechauner <l.stechauner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v3 qemu-server 1/1] vm_start: check if storages of volumes support content images
Date: Thu, 27 May 2021 14:23:31 +0200	[thread overview]
Message-ID: <20210527122331.86302-3-l.stechauner@proxmox.com> (raw)
In-Reply-To: <20210527122331.86302-1-l.stechauner@proxmox.com>

it is now necessary for storages to support the 'images' content in
order to start vms on them. all native storage plugins already
report the images content correctly.

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
---
 PVE/QemuServer.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 0bfbca4..3b656a1 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5124,6 +5124,13 @@ sub vm_start_nolock {
     my ($cmd, $vollist, $spice_port) = config_to_command($storecfg, $vmid,
 	$conf, $defaults, $forcemachine, $forcecpu, $params->{'pbs-backing'});
 
+    for my $vol (@$vollist) {
+	if (my ($storeid, $volname) = PVE::Storage::parse_volume_id($vol, 1)) {
+	    my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
+	    die "storage '$storeid' does not support vm disks\n" if !$scfg->{content}->{images};
+	}
+    }
+
     my $migration_ip;
     my $get_migration_ip = sub {
 	my ($nodename) = @_;
-- 
2.20.1





  parent reply	other threads:[~2021-05-27 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 12:23 [pve-devel] [PATCH-SERIES v3 container/qemu-server] fix #3421: allow custom storage plugins to support rootfs Lorenz Stechauner
2021-05-27 12:23 ` [pve-devel] [PATCH v3 container 1/1] " Lorenz Stechauner
2021-06-21  8:52   ` [pve-devel] applied: " Thomas Lamprecht
2021-05-27 12:23 ` Lorenz Stechauner [this message]
2021-06-21  9:11   ` [pve-devel] [PATCH v3 qemu-server 1/1] vm_start: check if storages of volumes support content images Thomas Lamprecht
2021-06-02  7:29 ` [pve-devel] [PATCH-SERIES v3 container/qemu-server] fix #3421: allow custom storage plugins to support rootfs Fabian Ebner
2021-06-02 11:51   ` Fabian Ebner

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=20210527122331.86302-3-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal