[pve-devel] applied: [PATCH qemu-server 2/2] migration: add missing use statements

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu May 23 11:03:00 CEST 2024


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 at 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 at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
> 
> 
> 




More information about the pve-devel mailing list