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 164D51FF396 for ; Thu, 6 Jun 2024 11:23:44 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C6CD7B1CE; Thu, 6 Jun 2024 11:23:03 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Thu, 6 Jun 2024 11:22:13 +0200 Message-Id: <20240606092220.1190913-19-d.csapak@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606092220.1190913-1-d.csapak@proxmox.com> References: <20240606092220.1190913-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.021 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 T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH qemu-server v4 12/12] migration: show vfio state transferred too 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" there is no total here, so we can't show any, just what was transferred up until now (if any). Signed-off-by: Dominik Csapak --- new in v4 PVE/API2/Qemu.pm | 2 +- PVE/QemuMigrate.pm | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 0a999006..34bfcdf4 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -4541,7 +4541,7 @@ __PACKAGE__->register_method({ } # if nothing came up, add it to the allowed nodes - if (!$res->{not_allowed_nodes}->{$node}) { + if (scalar($res->{not_allowed_nodes}->{$node}->%*) == 0) { push $res->{allowed_nodes}->@*, $node; } } diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm index 41ff12c2..bd65558c 100644 --- a/PVE/QemuMigrate.pm +++ b/PVE/QemuMigrate.pm @@ -1242,6 +1242,7 @@ sub phase2 { $self->log('info', "migrate uri => $migrate_uri failed: $merr") if $merr; my $last_mem_transferred = 0; + my $last_vfio_transferred = 0; my $usleep = 1000000; my $i = 0; my $err_count = 0; @@ -1301,8 +1302,11 @@ sub phase2 { last; } - if ($memstat->{transferred} ne $last_mem_transferred) { + if ($memstat->{transferred} ne $last_mem_transferred || + $stat->{vfio}->{transferred} ne $last_vfio_transferred + ) { my $trans = $memstat->{transferred} || 0; + my $vfio_transferred = $stat->{vfio}->{transferred} || 0; my $rem = $memstat->{remaining} || 0; my $total = $memstat->{total} || 0; my $speed = ($memstat->{'pages-per-second'} // 0) * ($memstat->{'page-size'} // 0); @@ -1320,6 +1324,11 @@ sub phase2 { my $progress = "transferred $transferred_h of $total_h VM-state, ${speed_h}/s"; + if ($vfio_transferred > 0) { + my $vfio_h = render_bytes($vfio_transferred, 1); + $progress .= " (+ $vfio_h VFIO-state)"; + } + if ($dirty_rate > $speed) { my $dirty_rate_h = render_bytes($dirty_rate, 1); $progress .= ", VM dirties lots of memory: $dirty_rate_h/s"; @@ -1361,6 +1370,7 @@ sub phase2 { } $last_mem_transferred = $memstat->{transferred}; + $last_vfio_transferred = $stat->{vfio}->{transferred}; } if ($self->{storage_migration}) { -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel