all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: PVE development discussion <pve-devel@pve.proxmox.com>,
	Stefan Reiter <s.reiter@proxmox.com>
Subject: Re: [pve-devel] [PATCH v3 qemu-server 3/3] fix #2671: include CPU format in man page again
Date: Thu, 9 Jul 2020 14:29:38 +0200	[thread overview]
Message-ID: <9f2416b1-ab1b-5c42-db06-7abf5ee07a3a@proxmox.com> (raw)
In-Reply-To: <20200625113541.16684-4-s.reiter@proxmox.com>

On 25.06.20 13:35, Stefan Reiter wrote:
> Use the new register_format(3) call to use a validator (instead of a
> parser) for 'pve-(vm-)?cpu-conf'. This way the $cpu_fmt hash can be used for
> generating the documentation, while still applying the same verification
> rules as before.
> 
> Since the function no longer parses but only verifies, the parsing in
> print_cpu_device/get_cpu_options has to go via JSONSchema directly.
> 
> Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
> ---
>  PVE/QemuServer/CPUConfig.pm | 56 ++++++++++++-------------------------
>  1 file changed, 18 insertions(+), 38 deletions(-)
> 
> diff --git a/PVE/QemuServer/CPUConfig.pm b/PVE/QemuServer/CPUConfig.pm
> index 6250591..8ed898c 100644
> --- a/PVE/QemuServer/CPUConfig.pm
> +++ b/PVE/QemuServer/CPUConfig.pm
> @@ -153,6 +153,7 @@ my $cpu_fmt = {
>      'phys-bits' => {
>  	type => 'string',
>  	format => 'pve-phys-bits',
> +	format_description => '8-64|host',
>  	description => "The physical memory address bits that are reported to"
>  		     . " the guest OS. Should be smaller or equal to the host's."
>  		     . " Set to 'host' to use value from host CPU, but note that"
> @@ -182,57 +183,36 @@ sub parse_phys_bits {
>  
>  # $cpu_fmt describes both the CPU config passed as part of a VM config, as well
>  # as the definition of a custom CPU model. There are some slight differences
> -# though, which we catch in the custom verification function below.
> -PVE::JSONSchema::register_format('pve-cpu-conf', \&parse_cpu_conf_basic);
> -sub parse_cpu_conf_basic {

This method is still used in PVE/QemuMigrate.pm:236 and breaks live-migration with
cpu type = host..





      parent reply	other threads:[~2020-07-09 12:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200625113541.16684-1-s.reiter@proxmox.com>
     [not found] ` <20200625113541.16684-4-s.reiter@proxmox.com>
     [not found]   ` <1594028311.osgnixtap1.astroid@nora.none>
2020-07-08  8:29     ` [pve-devel] applied: " Fabian Grünbichler
2020-07-09 12:29   ` Thomas Lamprecht [this message]

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=9f2416b1-ab1b-5c42-db06-7abf5ee07a3a@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pve-devel@pve.proxmox.com \
    --cc=s.reiter@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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal