[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 13/23] qemu_conf: split out virQEMUDriverConfigLoadDeviceEntry




On 1/15/19 8:23 AM, Ján Tomko wrote:
> Split out parts of the config parsing code to make
> the parent function easier to read.
> 
> Signed-off-by: Ján Tomko <jtomko redhat com>
> ---
>  src/qemu/qemu_conf.c | 45 +++++++++++++++++++++++++++-----------------
>  1 file changed, 28 insertions(+), 17 deletions(-)
> 
> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
> index b555e33e7b..776ba3f3ad 100644
> --- a/src/qemu/qemu_conf.c
> +++ b/src/qemu/qemu_conf.c
> @@ -423,6 +423,31 @@ virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFSPtr hugetlbfs,
>  }
>  
>  
> +static int
> +virQEMUDriverConfigLoadDeviceEntry(virQEMUDriverConfigPtr cfg,
> +                                   virConfPtr conf)
> +{
> +    bool tmp;
> +    int rv;
> +
> +    if (virConfGetValueBool(conf, "mac_filter", &cfg->macFilter) < 0)
> +        return -1;
> +
> +    if (virConfGetValueBool(conf, "relaxed_acs_check", &cfg->relaxedACS) < 0)
> +        return -1;
> +    if (virConfGetValueString(conf, "lock_manager", &cfg->lockManagerName) < 0)
> +        return -1;
> +    if ((rv = virConfGetValueBool(conf, "allow_disk_format_probing", &tmp)) < 0)
> +        return -1;
> +    if (rv == 1 && tmp) {
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("allow_disk_format_probing is no longer supported"));
> +        return -1;
> +    }
> +
> +    return 0;
> +}
> +

blank line

Reviewed-by: John Ferlan <jferlan redhat com>

John

[...]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]