* [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID
@ 2023-03-27 9:01 Fiona Ebner
2023-03-27 9:01 ` [pve-devel] [PATCH qemu-server 2/2] backup: prepare: improve error messages Fiona Ebner
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Fiona Ebner @ 2023-03-27 9:01 UTC (permalink / raw)
To: pve-devel
which is the case for passed-through disks. The qemu_img_format()
function cannot correctly handle those, and it's not safe to assume
they are raw (it's most likely, but not guaranteed), so just use the
storage method for the format like it was done before commit
efa3aa24 ("avoid list context for volume_size_info calls"). This will
use 'qemu-img info' to get the actual format.
Reported in the community forum:
https://forum.proxmox.com/threads/124794/
https://forum.proxmox.com/threads/124823/
https://forum.proxmox.com/threads/124818/
Fixes: efa3aa24 ("avoid list context for volume_size_info calls")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
PVE/VZDump/QemuServer.pm | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index add26ad6..036a7228 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -119,11 +119,20 @@ sub prepare {
}
next if !$path;
- my $size = eval { PVE::Storage::volume_size_info($self->{storecfg}, $volid, 5) };
- die "no such volume '$volid'\n" if $@;
+ my ($size, $format);
+ if ($storeid) {
+ # The call in list context can be expensive for certain plugins like RBD, just get size
+ $size = eval { PVE::Storage::volume_size_info($self->{storecfg}, $volid, 5) };
+ die "no such volume '$volid'\n" if $@;
- my $scfg = PVE::Storage::storage_config($self->{storecfg}, $storeid);
- my $format = PVE::QemuServer::qemu_img_format($scfg, $volname);
+ my $scfg = PVE::Storage::storage_config($self->{storecfg}, $storeid);
+ $format = PVE::QemuServer::qemu_img_format($scfg, $volname);
+ } else {
+ ($size, $format) = eval {
+ PVE::Storage::volume_size_info($self->{storecfg}, $volid, 5);
+ };
+ die "no such volume '$volid'\n" if $@;
+ }
my $diskinfo = {
path => $path,
--
2.30.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH qemu-server 2/2] backup: prepare: improve error messages
2023-03-27 9:01 [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID Fiona Ebner
@ 2023-03-27 9:01 ` Fiona Ebner
2023-03-27 9:35 ` [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID Friedrich Weber
2023-03-27 9:40 ` [pve-devel] applied-series: " Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Fiona Ebner @ 2023-03-27 9:01 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
PVE/VZDump/QemuServer.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index 036a7228..af197882 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -123,7 +123,7 @@ sub prepare {
if ($storeid) {
# The call in list context can be expensive for certain plugins like RBD, just get size
$size = eval { PVE::Storage::volume_size_info($self->{storecfg}, $volid, 5) };
- die "no such volume '$volid'\n" if $@;
+ die "cannot determine size of volume '$volid' - $@\n" if $@;
my $scfg = PVE::Storage::storage_config($self->{storecfg}, $storeid);
$format = PVE::QemuServer::qemu_img_format($scfg, $volname);
@@ -131,7 +131,7 @@ sub prepare {
($size, $format) = eval {
PVE::Storage::volume_size_info($self->{storecfg}, $volid, 5);
};
- die "no such volume '$volid'\n" if $@;
+ die "cannot determine size and format of volume '$volid' - $@\n" if $@;
}
my $diskinfo = {
--
2.30.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID
2023-03-27 9:01 [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID Fiona Ebner
2023-03-27 9:01 ` [pve-devel] [PATCH qemu-server 2/2] backup: prepare: improve error messages Fiona Ebner
@ 2023-03-27 9:35 ` Friedrich Weber
2023-03-27 9:40 ` [pve-devel] applied-series: " Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Friedrich Weber @ 2023-03-27 9:35 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
Tested-by: Friedrich Weber <f.weber@proxmox.com>
Checked the following:
* PVE 7.3: create VM with a passed-through disk, backup works
* Upgrade to PVE 7.4: backup fails with "no storage ID specified" error
* Applied this patch: backup works again
Tested with backup to local directory as well as PBS.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] applied-series: [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID
2023-03-27 9:01 [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID Fiona Ebner
2023-03-27 9:01 ` [pve-devel] [PATCH qemu-server 2/2] backup: prepare: improve error messages Fiona Ebner
2023-03-27 9:35 ` [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID Friedrich Weber
@ 2023-03-27 9:40 ` Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2023-03-27 9:40 UTC (permalink / raw)
To: Proxmox VE development discussion, Fiona Ebner
Am 27/03/2023 um 11:01 schrieb Fiona Ebner:
> which is the case for passed-through disks. The qemu_img_format()
> function cannot correctly handle those, and it's not safe to assume
> they are raw (it's most likely, but not guaranteed), so just use the
> storage method for the format like it was done before commit
> efa3aa24 ("avoid list context for volume_size_info calls"). This will
> use 'qemu-img info' to get the actual format.
>
> Reported in the community forum:
> https://forum.proxmox.com/threads/124794/
> https://forum.proxmox.com/threads/124823/
> https://forum.proxmox.com/threads/124818/
>
> Fixes: efa3aa24 ("avoid list context for volume_size_info calls")
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
> PVE/VZDump/QemuServer.pm | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
>
applied both patches with Friedrich's T-b, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-27 9:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 9:01 [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID Fiona Ebner
2023-03-27 9:01 ` [pve-devel] [PATCH qemu-server 2/2] backup: prepare: improve error messages Fiona Ebner
2023-03-27 9:35 ` [pve-devel] [PATCH qemu-server 1/2] backup: prepare: fix format detection for disks without storage ID Friedrich Weber
2023-03-27 9:40 ` [pve-devel] applied-series: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox