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>,
	"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: Re: [pve-devel] [PATCH storage 2/3] fix #6338: rbd: use image-/snap-spec consistently
Date: Mon, 5 May 2025 16:24:30 +0200	[thread overview]
Message-ID: <41082533-b283-4e91-95ad-4fea316b6d41@proxmox.com> (raw)
In-Reply-To: <20250423135904.716443-3-f.gruenbichler@proxmox.com>

Am 23.04.25 um 15:59 schrieb Fabian Grünbichler:
> diff --git a/src/PVE/Storage/RBDPlugin.pm b/src/PVE/Storage/RBDPlugin.pm
> index 8c67a37..3bb5807 100644
> --- a/src/PVE/Storage/RBDPlugin.pm
> +++ b/src/PVE/Storage/RBDPlugin.pm
> @@ -89,22 +89,17 @@ my $rbd_cmd = sub {
>      my ($scfg, $storeid, $op, @options) = @_;
>  
>      my $cmd_option = PVE::CephConfig::ceph_connect_option($scfg, $storeid);
> -    my $pool =  $scfg->{pool} ? $scfg->{pool} : 'rbd';
>  
>      my $cmd = ['/usr/bin/rbd'];
> -    if ($op eq 'import') {
> -	push $cmd->@*, '--dest-pool', $pool;
> -    } else {
> +    # `ls` doesn't take an image-spec, otherwise pool and namespace should be specified there
> +    if ($op eq 'ls') {
> +	my $pool = $scfg->{pool} ? $scfg->{pool} : 'rbd';
>  	push $cmd->@*, '-p', $pool;
> +	if (defined($scfg->{namespace})) {
> +	    push @$cmd, '--namespace', $cfg->{namespace};

Typo here that's fixed in next commit

> @@ -890,7 +890,9 @@ sub volume_export {
>  
>      my ($size) = $class->volume_size_info($scfg, $storeid, $volname);
>      PVE::Storage::Plugin::write_common_header($fh, $size);
> -    my $cmd = $rbd_cmd->($scfg, $storeid, 'export', '--export-format', '1', $volname, '-');
> +
> +    my $snap_spec = get_rbd_path($scfg, $volname, $snapshot);
> +    my $cmd = $rbd_cmd->($scfg, $storeid, 'export', '--export-format', '1', $snap_spec, '-');
>      run_rbd_command(
>  	$cmd,
>  	errmsg => 'could not export image',

Oh, so a snapshot was never exported before, but always the image? Mea
culpa. Can only be reached via manual CLI luckily, but still good to get
fixed. You'll need to adapt getting the size too in the lines above,
that still uses just $volname.

Other than those, looks good to me.


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

  reply	other threads:[~2025-05-05 14:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 13:59 [pve-devel] [RFC storage 0/3] rbd: use image-/snap-spec instead of --pool/ Fabian Grünbichler
2025-04-23 13:59 ` [pve-devel] [PATCH storage 1/3] rbd: extend get_rbd_(dev_)path helpers with $snap parameter Fabian Grünbichler
2025-04-23 13:59 ` [pve-devel] [PATCH storage 2/3] fix #6338: rbd: use image-/snap-spec consistently Fabian Grünbichler
2025-05-05 14:24   ` Fiona Ebner [this message]
2025-04-23 13:59 ` [pve-devel] [PATCH storage 3/3] rbd: add protect/unprotect helpers Fabian Grünbichler
2025-05-05 14:24   ` Fiona Ebner
2025-05-06 11:07     ` Fabian Grünbichler
2025-05-06 11:40       ` Fiona Ebner
2025-04-30 15:51 ` [pve-devel] [RFC storage 0/3] rbd: use image-/snap-spec instead of --pool/ Aaron Lauterer

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=41082533-b283-4e91-95ad-4fea316b6d41@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=f.gruenbichler@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