public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: [pve-devel] applied: [PATCH qemu-server 2/2] migration: add missing use statements
Date: Thu, 23 May 2024 11:03:00 +0200	[thread overview]
Message-ID: <1716454655.pvpww4onlg.astroid@yuna.none> (raw)
In-Reply-To: <20240503083412.6732-2-f.ebner@proxmox.com>

but slight follow-up question below

On May 3, 2024 10:34 am, Fiona Ebner wrote:
> There's functions from all of those being used, but without importing
> first.
> 
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  PVE/QemuMigrate.pm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
> index 649cfec4..312ddaf8 100644
> --- a/PVE/QemuMigrate.pm
> +++ b/PVE/QemuMigrate.pm
> @@ -7,14 +7,17 @@ use IO::File;
>  use IPC::Open2;
>  use Time::HiRes qw( usleep );
>  
> +use PVE::AccessControl;
>  use PVE::Cluster;
>  use PVE::Format qw(render_bytes);
>  use PVE::GuestHelpers qw(safe_boolean_ne safe_string_ne);
>  use PVE::INotify;
> +use PVE::JSONSchema;
>  use PVE::RPCEnvironment;
>  use PVE::Replication;
>  use PVE::ReplicationConfig;
>  use PVE::ReplicationState;
> +use PVE::Storage::Plugin;

this one is only used for a single check_connection call in `prepare`:

	if ($scfg->{shared}) {
	    # PVE::Storage::activate_storage checks this for non-shared storages
	    my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
	    warn "Used shared storage '$sid' is not online on source node!\n"
		if !$plugin->check_connection($sid, $scfg);
	}

can't we get rid of this? either we are live-migrating, then the storage
is already active and in use. or we are migrating offline, then shared
storages are irrelevant (unless it's a remote migration, but then we
will activate the storage anyhow)?

or, couldn't we replace it with an eval-ed call to activate_storage for
the same effect (to get a warning if the storage is somehow broken, even
though it is not a pre-requisite for migration)?

I'm currently trying to eliminate direct calls to plugin code (i.e., not
via PVE::Storage itself as entry point), and this seems like low-hanging
fruit ;) the same also exists in pve-container for migration..

>  use PVE::Storage;
>  use PVE::StorageTunnel;
>  use PVE::Tools;
> -- 
> 2.39.2
> 
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 


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


  reply	other threads:[~2024-05-23  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03  8:34 [pve-devel] [PATCH qemu-server 1/2] migration: avoid crash with heavy IO on local VM disk Fiona Ebner
2024-05-03  8:34 ` [pve-devel] [PATCH qemu-server 2/2] migration: add missing use statements Fiona Ebner
2024-05-23  9:03   ` Fabian Grünbichler [this message]
2024-05-28  7:50     ` [pve-devel] applied: " Fiona Ebner
2024-05-23  9:08 ` [pve-devel] [PATCH qemu-server 1/2] migration: avoid crash with heavy IO on local VM disk Fabian Grünbichler
2024-05-23  9:29   ` Thomas Lamprecht
2024-05-28  8:01   ` 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=1716454655.pvpww4onlg.astroid@yuna.none \
    --to=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 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