[PATCH RESEND v1 2/7] qemu: Implement the CFPC pSeries feature

Michal Privoznik mprivozn at redhat.com
Mon Apr 27 12:46:35 UTC 2020


On 4/27/20 2:14 PM, Daniel Henrique Barboza wrote:
> This patch adds the implementation of the CFPC pSeries feature,
> using the QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC capability added
> in the previous patch.
> 
> CPFC can have the values "broken", "workaround" or "fixed". Extra
> code is required to handle it since it's not a regular tristate
> capability.
> 
> This is the XML format for the cap:
> 
> <features>
>    <cfpc value='workaround'/>
> </features>
> 
> Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
> ---
>   docs/formatdomain.html.in                     | 11 +++++
>   docs/schemas/domaincommon.rng                 | 15 +++++++
>   src/conf/domain_conf.c                        | 44 +++++++++++++++++++
>   src/conf/domain_conf.h                        | 12 +++++
>   src/libvirt_private.syms                      |  1 +
>   src/qemu/qemu_command.c                       |  5 +++
>   src/qemu/qemu_validate.c                      | 11 +++++
>   tests/qemuxml2argvdata/pseries-features.args  |  3 +-
>   tests/qemuxml2argvdata/pseries-features.xml   |  1 +
>   tests/qemuxml2argvtest.c                      | 17 ++++++-
>   tests/qemuxml2xmloutdata/pseries-features.xml |  1 +
>   tests/qemuxml2xmltest.c                       |  3 +-
>   12 files changed, 121 insertions(+), 3 deletions(-)
> 


> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index ecb80ef8f2..8594049e52 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -1816,6 +1816,7 @@ typedef enum {
>       VIR_DOMAIN_FEATURE_MSRS,
>       VIR_DOMAIN_FEATURE_CCF_ASSIST,
>       VIR_DOMAIN_FEATURE_XEN,
> +    VIR_DOMAIN_FEATURE_CFPC,
>   
>       VIR_DOMAIN_FEATURE_LAST
>   } virDomainFeature;
> @@ -1987,6 +1988,17 @@ typedef enum {
>   
>   VIR_ENUM_DECL(virDomainHPTResizing);
>   
> +typedef enum {
> +    VIR_DOMAIN_CFPC_NONE = 0,
> +    VIR_DOMAIN_CFPC_BROKEN,
> +    VIR_DOMAIN_CFPC_WORKAROUND,
> +    VIR_DOMAIN_CFPC_FIXED,
> +
> +    VIR_DOMAIN_CFPC_LAST
> +} virDomainCFPC;
> +
> +VIR_ENUM_DECL(virDomainCFPC);
> +

This declares both:

virDomainCFPCTypeToString()
virDomainCFPCTypeFromString()

>   /* Operating system configuration data & machine / arch */
>   struct _virDomainOSEnv {
>       char *name;
> diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
> index a9694f34c0..308959b493 100644
> --- a/src/libvirt_private.syms
> +++ b/src/libvirt_private.syms
> @@ -235,6 +235,7 @@ virDomainBlockIoTuneInfoHasMaxLength;
>   virDomainBootTypeFromString;
>   virDomainBootTypeToString;
>   virDomainCapabilitiesPolicyTypeToString;
> +virDomainCFPCTypeToString;

And even though we need only this, I'd like to expose TypeFromString() 
too for a possible future use. I mean, it's declared in the header file.

>   virDomainChrConsoleTargetTypeFromString;
>   virDomainChrConsoleTargetTypeToString;
>   virDomainChrDefForeach;

Michal




More information about the libvir-list mailing list