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

Re: [PATCH v2 2/3] xl/libxl: Add ability to specify SMBIOS strings


  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Fri, 9 Sep 2022 11:19:39 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Nick Rosbrook <rosbrookn@xxxxxxxxx>, "Juergen Gross" <jgross@xxxxxxxx>
  • Delivery-date: Fri, 09 Sep 2022 10:20:06 +0000
  • Ironport-data: A9a23:yOF/tq+VlObAcl4/8ZZ0DrUDi36TJUtcMsCJ2f8bNWPcYEJGY0x3z DMfWmqFbK6IamWgfNl3b4/g8hkO7ZPXzoRmHVFr/Co8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si+Fa+Sn9z8kvU2xbuKUIPbePSxsThNTRi4kiBZy88Y0mYctitWia++3k YqaT/b3ZRn0gFaYDkpOs/jZ8EI37ayr0N8llgdWic5j7Qe2e0Y9VPrzFYnpR1PkT49dGPKNR uqr5NlVKUuAon/Bovv8+lrKWhViroz6ZGBiuVIPM0SWuTBQpzRa70oOHKF0hXG7Kdm+t4sZJ N1l7fRcQOqyV0HGsLx1vxJwS0mSMUDakVNuzLfWXcG7liX7n3XQL/pGS24SAaM/wu1MUFpA+ OQfDW1KVxyyiLfjqF67YrEEasULKcDqOMUUu216zCGfBvEjKXzBa/yUv5kChm52350QW6aFD yYaQWMHgBDoahtTOlARGdQmkf2hnHXXeDxEslOF46Ew5gA/ySQugei2aYuOK7RmQ+1llFyH5 V6X3FjeB0pFN9CRkxOK9Cqz07qncSTTB9tJSezQGuRRqEeU3WYJDxoVU3O0pPC4jgi1XNc3A 04b4C01toAp6VemCNL6WnWQv3qsrhMaHd1KHIUS6giLxrDF/gWxCW0NTzoHY9sj3OcmSDpv2 lKXktfBAT10rKbTWX+b7q2Trz65JW4SN2BqWMMfZVJbuZ+5+th110+RCIY4eEKosjHrMXbf5 wykixA1vOQog8MT0IDmumnLsj358/AlUTUJChXrsnONt10nPtD+Ptf0tjA3/t4bct/HEwDpU Gws3pHHsbtQVczleDmlGr1lIV2/2xqS3NQwa3ZLFoJpyTmi8mXLkWt4sGAnfxcB3irplFbUj K7vVeB5vsU70IOCN/MfXm5II51CIVLcPdrkTOvISdFFf4J8cgSKlAk3OxDKgT63yRd2yPxgU Xt+TSpLJS9CYZmLMRLsH7tNuVPV7ntWKZzvqWDTkE38jOv2iI+9QrYZKlqeBt0EAFe/iFyMq 75i2z6ikUo3vBvWPnaKqub+7DkicRAGOHwBg5AJKbXbf1E5RgnMyZb5mNscRmCspIwN/s+gw 513chYGoLYjrRUr8Tm3V00=
  • Ironport-hdrordr: A9a23:J7US+qGTfx7+cF3HpLqE6MeALOsnbusQ8zAXP0AYc3Jom+ij5q STdZUgpHrJYVkqNU3I9ertBEDEewK6yXcX2/hyAV7BZmnbUQKTRekIh7cKgQeQeBEWntQts5 uIGJIeNDSfNzdHsfo=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Sep 08, 2022 at 03:51:12PM -0400, Jason Andryuk wrote:
> hvm_xs_strings.h specifies xenstore entries which can be used to set or
> override smbios strings.  hvmloader has support for reading them, but
> xl/libxl support is not wired up.
> 
> Allow specifying the strings with the new xl.cfg option:
> smbios=["bios_vendor=Xen Project","system_version=1.0"]

I've tried something like:
    smbios=['oem=foo=bar']
And only "foo" is added to the smbios string. Shouldn't we allow users
to have '=' in their smbios strings?

> ---
> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
> index 2abaab439c..c3125ed310 100644
> --- a/tools/libs/light/libxl_dom.c
> +++ b/tools/libs/light/libxl_dom.c
> @@ -771,6 +771,27 @@ static int hvm_build_set_xs_values(libxl__gc *gc,
>              goto err;
>      }
>  
> +    for (int i = 0; i < info->u.hvm.num_smbios; i++) {
> +        char *p;
> +        path = GCSPRINTF("/local/domain/%d/"HVM_XS_BIOS_STRINGS"/%s", domid,
> +                   libxl_smbios_type_to_string(info->u.hvm.smbios[i].key));
> +
> +        /* Convert libxl_smbios_type string to xenstore path that hvmloader
> +           will use, as defined by HVM_XS_*. That is convert the '_' to '-'. 
> */

Could you add a '*' on the second line of that multi-line comment ?
    /* Multi-line
     * comments */

> +        p = strrchr(path, '/');
> +        for ( ; *p; p++) {
> +            if (*p == '_')
> +                *p = '-';
> +        }
> +
> +        LOGD(DEBUG, domid, "Writing %s = \"%s\"\n", path,

Could you remove the \n ? LOGD() macro already adds a new line.

> +             info->u.hvm.smbios[i].value);
> +        ret = libxl__xs_printf(gc, XBT_NULL, path, "%s",
> +                               info->u.hvm.smbios[i].value);
> +        if (ret)
> +            goto err;
> +    }
> +
>      /* Only one module can be passed. PVHv2 guests do not support this. */
>      if (dom->acpi_modules[0].guest_addr_out && 
>          info->type == LIBXL_DOMAIN_TYPE_HVM) {

The rest of the patch looks fine, even if I can't say much about the
generated golang code.

Thanks,

-- 
Anthony PERARD



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.