From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C64BE1FF396 for ; Thu, 23 May 2024 11:03:22 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9A6881BA77; Thu, 23 May 2024 11:03:39 +0200 (CEST) Date: Thu, 23 May 2024 11:03:00 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20240503083412.6732-1-f.ebner@proxmox.com> <20240503083412.6732-2-f.ebner@proxmox.com> In-Reply-To: <20240503083412.6732-2-f.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1716454655.pvpww4onlg.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.054 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemumigrate.pm, proxmox.com] Subject: [pve-devel] applied: [PATCH qemu-server 2/2] migration: add missing use statements X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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 > --- > 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