all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v6 storage] Optionally allow blockdev in abs_filesystem_path
@ 2021-03-09 10:43 Dominic Jäger
  2021-03-09 10:43 ` [pve-devel] [PATCH v6 qemu-server] Add API for import wizards Dominic Jäger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dominic Jäger @ 2021-03-09 10:43 UTC (permalink / raw)
  To: pve-devel

This is required to import from LVM storages

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
v5->v6: unchanged

 PVE/Storage.pm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 8ee2c92..7c2e24e 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -609,7 +609,7 @@ sub path {
 }
 
 sub abs_filesystem_path {
-    my ($cfg, $volid) = @_;
+    my ($cfg, $volid, $allowBlockdev) = @_;
 
     my $path;
     if (parse_volume_id ($volid, 1)) {
@@ -623,8 +623,11 @@ sub abs_filesystem_path {
 	    }
 	}
     }
-
-    die "can't find file '$volid'\n" if !($path && -f $path);
+    if ($allowBlockdev) {
+	die "can't find file '$volid'\n" if !($path && (-f $path || -b $path));
+    } else {
+	die "can't find file '$volid'\n" if !($path && -f $path);
+    }
 
     return $path;
 }
-- 
2.20.1




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-15  9:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 10:43 [pve-devel] [PATCH v6 storage] Optionally allow blockdev in abs_filesystem_path Dominic Jäger
2021-03-09 10:43 ` [pve-devel] [PATCH v6 qemu-server] Add API for import wizards Dominic Jäger
     [not found]   ` <<20210309104318.317454-2-d.jaeger@proxmox.com>
2021-03-15  9:25     ` Fabian Grünbichler
2021-03-09 10:43 ` [pve-devel] [PATCH v6 manager] gui: Add import for disk & VM Dominic Jäger
     [not found] ` <<20210309104318.317454-1-d.jaeger@proxmox.com>
2021-03-15  9:25   ` [pve-devel] [PATCH v6 storage] Optionally allow blockdev in abs_filesystem_path Fabian Grünbichler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal