VirtualBox

Ticket #1957 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

DMI default processing is wrong => Fixed in 1.6.6

Reported by: TerryE Owned by:
Priority: major Component: VMM
Version: VirtualBox 1.6.2 Keywords: DMI BIOS
Cc: Guest type: Windows
Host type: Linux

Description

My system is a home built one and as such the Mortheboard BIOS DmiSystemVendor is an empty string. In order to avoid reactivation on Dual Native/VM boot, I therefore need my VM DmiSystemVendor to be empty also. However in src/VBox/Devices/PC/DevPcBios.cpp we have

#define READCFGSTR(name, variable, default_value) \
    do { \
        rc = CFGMR3QueryStringAlloc(pCfgHandle, name, & variable); \
        if (rc == VERR_CFGM_VALUE_NOT_FOUND) \
            variable = MMR3HeapStrDup(PDMDevHlpGetVM(pDevIns), MM_TAG_CFGM, default_value); \
        else if (VBOX_FAILURE(rc)) \
            return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, \
                    N_("Configuration error: Querying \"" name "\" as a string failed")); \
    } while (0)
...
    READCFGSTR("DmiSystemVendor",      pszDmiSystemVendor,    "innotek GmbH");

and in src/VBox/VMM/CFGM.cpp

CFGMR3DECL(int) CFGMR3QueryStringAlloc(PCFGMNODE pNode, const char *pszName, char **ppszString)
{
    size_t cch;
    int rc = CFGMR3QuerySize(pNode, pszName, &cch);
    if (VBOX_SUCCESS(rc))
    {
        char *pszString = (char *)MMR3HeapAlloc(pNode->pVM, MM_TAG_CFGM_USER, cch);
        if (pszString)
        {
            rc = CFGMR3QueryString(pNode, pszName, pszString, cch);
            if (VBOX_SUCCESS(rc))
                *ppszString = pszString;
            else
                MMR3HeapFree(pszString);
        }
        else
            rc = VERR_NO_MEMORY;
    }
    return rc;
}

Hence

VBoxManage setextradata "My VM" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" ""

results in DmiSystemVendor being set to innotek GmbH if you specify "" !

Change History

comment:1 Changed 6 years ago by TerryE

This also applies to Version 1.6.4

comment:2 Changed 6 years ago by frank

  • Summary changed from DMI default processing is wrong to DMI default processing is wrong => Fixed in 1.6.6

Small issues will be solved immediately. Actually this problem results from the syntax of

VBoxManage setextradata

that is, an empty string removes the data key. So I added a special keyword <EMPTY>. You can now do

VBoxManage setextradata "My VM" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "<EMPTY>"

to set an empty DMI system vendor string.

Fix is in SVN and backported to 1.6.6.

comment:3 Changed 6 years ago by TerryE

Frank, that's brilliant thanks.

In fact I suspected that this might be the case, so I also tried just hacking the XML to set it to "", but the null string seems to excite the error return from VERR_CFGM_VALUE_NOT_FOUND from CFGMR3QueryStringAlloc (either that or as you suggest null strings are optimised away during the load) which then means that the default is used.

This is an example of where making the PUEL build entirely closed works against you: it's not worth my while doing an OSE build because I need USB support, but if I could do a PEUL debug build (e.g. by linking to closed shared libraries for the PEUL bits that I could just have debugged this and sent you the patch. OK, this one is probably only a few line change for you, but the next one might be a bit more tricky. :-)

I'll put a decent post on the forum explaining how to use the DMI stuff in detail and include this after 1.6.6 is released. Terry

comment:4 Changed 6 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use