public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 3/5] memory: replace deprecated check_running() call
Date: Mon,  4 Sep 2023 13:39:47 +0200	[thread overview]
Message-ID: <20230904113949.940431-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20230904113949.940431-1-f.ebner@proxmox.com>

PVE::QemuServer::check_running() does both
PVE::QemuConfig::assert_config_exists_on_node()
PVE::QemuServer::Helpers::vm_running_locally()

The former one isn't needed here when doing hotplug, because the API
already assert that the VM config exists. It also would introduce a
new cyclic dependency between PVE::QemuServer::Memory <->
PVE::QemuConfig with the proposed virtio-mem patch set.

In preparation to remove the cyclic include of PVE::QemuServer in the
memory module.

No functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer/Memory.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer/Memory.pm b/PVE/QemuServer/Memory.pm
index c5c3a0a6..6ec5ceec 100644
--- a/PVE/QemuServer/Memory.pm
+++ b/PVE/QemuServer/Memory.pm
@@ -175,7 +175,7 @@ sub foreach_dimm{
 sub qemu_memory_hotplug {
     my ($vmid, $conf, $defaults, $value) = @_;
 
-    return $value if !PVE::QemuServer::check_running($vmid);
+    return $value if !PVE::QemuServer::Helpers::vm_running_locally($vmid);
 
     my $sockets = $conf->{sockets} || 1;
 
-- 
2.39.2





  parent reply	other threads:[~2023-09-04 11:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 11:39 [pve-devel] [PATCH-SERIES qemu-server] avoid cyclic use of main module in memory module Fiona Ebner
2023-09-04 11:39 ` [pve-devel] [PATCH qemu-server 1/5] move parse_number_sets() helper to helpers module Fiona Ebner
2023-09-04 11:39 ` [pve-devel] [PATCH qemu-server 2/5] move NUMA-related code into memory module Fiona Ebner
2023-09-04 11:39 ` Fiona Ebner [this message]
2023-09-04 11:39 ` [pve-devel] [PATCH qemu-server 4/5] introduce QMPHelpers module Fiona Ebner
2023-09-04 11:39 ` [pve-devel] [PATCH qemu-server 5/5] add memory parser Fiona Ebner
2023-09-18 15:12 ` [pve-devel] applied-series: [PATCH-SERIES qemu-server] avoid cyclic use of main module in memory module Thomas Lamprecht

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=20230904113949.940431-4-f.ebner@proxmox.com \
    --to=f.ebner@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