[pve-devel] [PATCH container 2/3] config: support printing a device

Filip Schauer f.schauer at proxmox.com
Mon Dec 16 18:21:31 CET 2024


Signed-off-by: Filip Schauer <f.schauer at proxmox.com>
---
 src/PVE/LXC/Config.pm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 5cc37f7..b44bcce 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -1333,6 +1333,14 @@ sub parse_volume {
     return;
 }
 
+sub print_volume {
+    my ($class, $key, $volume) = @_;
+
+    return $class->print_ct_unused($volume) if $key =~ m/^unused(\d+)$/;
+
+    return $class->print_ct_mountpoint($volume, $key eq 'rootfs');
+}
+
 sub parse_device {
     my ($class, $device_string, $noerr) = @_;
 
@@ -1350,12 +1358,10 @@ sub parse_device {
     return $res;
 }
 
-sub print_volume {
-    my ($class, $key, $volume) = @_;
-
-    return $class->print_ct_unused($volume) if $key =~ m/^unused(\d+)$/;
+sub print_device {
+    my ($class, $info) = @_;
 
-    return $class->print_ct_mountpoint($volume, $key eq 'rootfs');
+    return PVE::JSONSchema::print_property_string($info, $dev_desc);
 }
 
 sub volid_key {
-- 
2.39.5





More information about the pve-devel mailing list