all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Markus Frank <m.frank@proxmox.com>
Subject: Re: [pve-devel] [PATCH guest-common v13 2/12] add dir mapping section config
Date: Tue, 18 Feb 2025 13:35:47 +0100	[thread overview]
Message-ID: <e2d18f4d-3953-4028-9570-3a28b9e9de46@proxmox.com> (raw)
In-Reply-To: <20250122100901.74830-3-m.frank@proxmox.com>

Am 22.01.25 um 11:08 schrieb Markus Frank:
> Adds a config file for directories by using a 'map' property string for
> each node mapping.
> 
> Next to node & path, there is the optional announce-submounts parameter
> which forces virtiofsd to report a different device number for each
> submount it encounters. Without it, duplicates may be created because
> inode IDs are only unique on a single filesystem.
> 
> example config:
> ```
> some-dir-id
> 	map node=node1,path=/mnt/share/,announce-submounts=1
> 	map node=node2,path=/mnt/share/,
> ```
> 
> Signed-off-by: Markus Frank <m.frank@proxmox.com>

Just a few small comments, if there will be a v14, those should be
addressed. Otherwise:

Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>

> +my $map_fmt = {
> +    node => get_standard_option('pve-node'),
> +    path => {
> +	description => "Absolute directory path that should be shared with the guest.",
> +	type => 'string',
> +	format => 'pve-storage-path',
> +    },
> +    'announce-submounts' => {
> +	type => 'boolean',
> +	description => "Announce that the directory contains other mounted file systems."
> +           ." If this is not set and multiple file systems are mounted, the guest may"
> +           ." encounter duplicates due to file system specific inode IDs.",

Style nit: wrong indentation for the two lines above

> +	optional => 1,
> +	default => 1,
> +    },
> +    description => {
> +	description => "Description of the node specific directory.",
> +	type => 'string',
> +	optional => 1,
> +	maxLength => 4096,
> +    },
> +};
> +
> +my $defaultData = {
> +    propertyList => {
> +	id => {
> +	    type => 'string',
> +	    description => "The ID of the directory",

Nit: I'd clarify slightly more with "of the directory mapping"

> +	    format => 'pve-configid',
> +	},
> +	description => {
> +	    type => 'string',
> +	    description => "Description of the directory",

Nit: I'd clarify slightly more with "of the directory mapping"

> +	    optional => 1,
> +	    maxLength => 4096,
> +	},
> +	map => {
> +	    type => 'array',
> +	    description => 'A list of maps for the cluster nodes.',
> +	    optional => 1,
> +	    items => {
> +		type => 'string',
> +		format => $map_fmt,
> +	    },
> +	},
> +    },
> +};
> +
> +sub private {
> +    return $defaultData;
> +}
> +
> +sub map_fmt {
> +    return $map_fmt;
> +}

The map_fmt() subroutine is never called from anywhere or am I missing
something?

> +sub write_dir_config {
> +    my ($cfg) = @_;
> +
> +    cfs_write_file($FILENAME, $cfg);

Rather orthogonal to the series, but since this is a new configuration
file, should we start out with it always being UTF-8? I sent an RFC for
allowing to register such configuration files:

https://lore.proxmox.com/pve-devel/20250218123006.61691-1-f.ebner@proxmox.com/T/#t

If some proposal for registering UTF-8 configs is accepted before this
series lands, it would be nice to opt into it. But it's not a blocker
and could still be done when applying if everything else is ready.

> +}
> +
> +sub find_on_current_node {
> +    my ($id) = @_;
> +
> +    my $cfg = config();
> +    my $node = PVE::INotify::nodename();
> +
> +    return get_node_mapping($cfg, $id, $node);
> +}


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


  reply	other threads:[~2025-02-18 12:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-22 10:08 [pve-devel] [PATCH cluster/guest-common/docs/qemu-server/manager v13 0/12] virtiofs Markus Frank
2025-01-22 10:08 ` [pve-devel] [PATCH cluster v13 1/12] add mapping/dir.cfg for resource mapping Markus Frank
2025-01-22 10:08 ` [pve-devel] [PATCH guest-common v13 2/12] add dir mapping section config Markus Frank
2025-02-18 12:35   ` Fiona Ebner [this message]
2025-02-19 10:06   ` Fiona Ebner
2025-02-19 17:00     ` Thomas Lamprecht
2025-01-22 10:08 ` [pve-devel] [PATCH docs v13 3/12] add doc section for the shared filesystem virtio-fs Markus Frank
2025-02-19 11:49   ` Fiona Ebner
2025-01-22 10:08 ` [pve-devel] [PATCH qemu-server v13 4/12] control: add virtiofsd as runtime dependency for qemu-server Markus Frank
2025-02-19 11:51   ` Fiona Ebner
2025-01-22 10:08 ` [pve-devel] [PATCH qemu-server v13 5/12] fix #1027: virtio-fs support Markus Frank
2025-02-19 13:43   ` Fiona Ebner
2025-01-22 10:08 ` [pve-devel] [PATCH qemu-server v13 6/12] migration: check_local_resources for virtiofs Markus Frank
2025-02-19 13:56   ` Fiona Ebner
2025-01-22 10:08 ` [pve-devel] [PATCH qemu-server v13 7/12] disable snapshot (with RAM) and hibernate with virtio-fs devices Markus Frank
2025-02-19 13:58   ` Fiona Ebner
2025-01-22 10:08 ` [pve-devel] [PATCH manager v13 08/12] api: add resource map api endpoints for directories Markus Frank
2025-02-19 14:14   ` Fiona Ebner
2025-01-22 10:08 ` [pve-devel] [PATCH manager v13 09/12] ui: add edit window for dir mappings Markus Frank
2025-01-22 10:08 ` [pve-devel] [PATCH manager v13 10/12] ui: add resource mapping view for directories Markus Frank
2025-02-18 14:29   ` Fiona Ebner
2025-01-22 10:09 ` [pve-devel] [PATCH manager v13 11/12] ui: form: add selector for directory mappings Markus Frank
2025-01-22 10:09 ` [pve-devel] [PATCH manager v13 12/12] ui: add options to add virtio-fs to qemu config Markus Frank
2025-02-19 14:17   ` Fiona Ebner
2025-02-19 14:19 ` [pve-devel] [PATCH cluster/guest-common/docs/qemu-server/manager v13 0/12] virtiofs Fiona 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=e2d18f4d-3953-4028-9570-3a28b9e9de46@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=m.frank@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 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