public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Filip Schauer <f.schauer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container 2/3] config: support printing a device
Date: Mon, 16 Dec 2024 18:21:31 +0100	[thread overview]
Message-ID: <20241216172132.235857-3-f.schauer@proxmox.com> (raw)
In-Reply-To: <20241216172132.235857-1-f.schauer@proxmox.com>

Signed-off-by: Filip Schauer <f.schauer@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2024-12-16 17:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 17:21 [pve-devel] [PATCH container 0/3] implement device hotplug Filip Schauer
2024-12-16 17:21 ` [pve-devel] [PATCH container 1/3] extract apparmor profile & namespace switch to its own helper Filip Schauer
2024-12-16 17:21 ` Filip Schauer [this message]
2024-12-16 17:21 ` [pve-devel] [PATCH container 3/3] implement device hotplug Filip Schauer

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=20241216172132.235857-3-f.schauer@proxmox.com \
    --to=f.schauer@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