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

Re: [libvirt] [PATCH] conf: Use the correct limit for the number of PHBs



On Thu, Aug 17, 2017 at 09:55:42 +0200, Andrea Bolognani wrote:
> I mistakenly thought pSeries guests supported 32 PHBs,
> but it turns out they only support 31. Validate the
> target index accordingly.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1479647
> 
> Signed-off-by: Andrea Bolognani <abologna redhat com>
> ---
>  src/conf/domain_conf.c                                |  4 ++--
>  src/qemu/qemu_domain_address.c                        |  4 ++--
>  .../qemuxml2argv-pseries-phb-too-many.xml             | 19 +++++++++++++++++++
>  tests/qemuxml2argvtest.c                              |  1 +
>  4 files changed, 24 insertions(+), 4 deletions(-)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-phb-too-many.xml
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 281dc68f0..8257f04ab 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -9326,10 +9326,10 @@ virDomainControllerDefParseXML(xmlNodePtr node,
>                  goto error;
>              }
>              if (def->opts.pciopts.targetIndex < 0 ||
> -                def->opts.pciopts.targetIndex > 31) {
> +                def->opts.pciopts.targetIndex > 30) {
>                  virReportError(VIR_ERR_XML_ERROR,
>                                 _("PCI controller target index '%s' out of "
> -                                 "range - must be 0-31"),
> +                                 "range - must be 0-30"),

NACK, you can't make parser checks more strict once the code is released.
This needs to go to the validation callback.

Attachment: signature.asc
Description: PGP signature


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