From: Stefan Reiter <s.reiter@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Fabian Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server 1/3] machine: split out helper for handling query-machines qmp command result
Date: Thu, 4 Mar 2021 13:51:25 +0100 [thread overview]
Message-ID: <6d7ed73f-3c13-ccf0-2f52-01db26457eec@proxmox.com> (raw)
In-Reply-To: <20210301155327.24841-1-f.ebner@proxmox.com>
LGTM, for both qemu-server patches:
Reviewed-by: Stefan Reiter <s.reiter@proxmox.com>
Not sure about the formatting in the GUI, but I'm also the wrong person
to ask there. Maybe don't capitalize "Qemu", as we also don't do that
for "running"/"stopped"/... either?
On 01/03/2021 16:53, Fabian Ebner wrote:
> to be re-used in the vmstatus() call.
>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> PVE/QemuServer/Machine.pm | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/PVE/QemuServer/Machine.pm b/PVE/QemuServer/Machine.pm
> index c168ade..2474951 100644
> --- a/PVE/QemuServer/Machine.pm
> +++ b/PVE/QemuServer/Machine.pm
> @@ -18,11 +18,8 @@ sub machine_type_is_q35 {
> return $conf->{machine} && ($conf->{machine} =~ m/q35/) ? 1 : 0;
> }
>
> -# this only works if VM is running
> -sub get_current_qemu_machine {
> - my ($vmid) = @_;
> -
> - my $res = PVE::QemuServer::Monitor::mon_cmd($vmid, 'query-machines');
> +sub current_from_query_machines {
> + my ($res) = @_;
>
> my ($current, $pve_version, $default);
> foreach my $e (@$res) {
> @@ -37,6 +34,15 @@ sub get_current_qemu_machine {
> return $current || $default || 'pc';
> }
>
> +# this only works if VM is running
> +sub get_current_qemu_machine {
> + my ($vmid) = @_;
> +
> + my $res = PVE::QemuServer::Monitor::mon_cmd($vmid, 'query-machines');
> +
> + return current_from_query_machines($res);
> +}
> +
> # returns a string with major.minor+pve<VERSION>, patch version-part is ignored
> # as it's seldom ressembling a real QEMU machine type, so it would be '0' 99% of
> # the time anyway.. This explicitly separates pveversion from the machine.
>
next prev parent reply other threads:[~2021-03-04 12:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 15:53 Fabian Ebner
2021-03-01 15:53 ` [pve-devel] [PATCH qemu-server 2/3] fix #3301: status: add currently running machine and QEMU version to full status Fabian Ebner
2021-03-04 12:58 ` [pve-devel] applied: " Thomas Lamprecht
2021-03-01 15:53 ` [pve-devel] [PATCH manager 3/3] fix #3301: ui: show currently running QEMU version Fabian Ebner
2021-03-04 12:51 ` Stefan Reiter [this message]
2021-03-08 12:57 ` [pve-devel] [PATCH qemu-server 1/3] machine: split out helper for handling query-machines qmp command result Fabian Ebner
2021-03-04 12:58 ` [pve-devel] applied: " 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=6d7ed73f-3c13-ccf0-2f52-01db26457eec@proxmox.com \
--to=s.reiter@proxmox.com \
--cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.