Oracle VM VirtualBox: Ticket #1957: DMI default processing is wrong => Fixed in 1.6.6https://www.virtualbox.org/ticket/1957
<p>
My system is a home built one and as such the Mortheboard BIOS <strong>DmiSystemVendor</strong> 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
</p>
<pre class="wiki">#define READCFGSTR(name, variable, default_value) \
do { \
rc = CFGMR3QueryStringAlloc(pCfgHandle, name, &amp; 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");
</pre><p>
and in <strong>src/VBox/VMM/CFGM.cpp</strong>
</p>
<pre class="wiki">CFGMR3DECL(int) CFGMR3QueryStringAlloc(PCFGMNODE pNode, const char *pszName, char **ppszString)
{
size_t cch;
int rc = CFGMR3QuerySize(pNode, pszName, &amp;cch);
if (VBOX_SUCCESS(rc))
{
char *pszString = (char *)MMR3HeapAlloc(pNode-&gt;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;
}
</pre><p>
Hence
</p>
<pre class="wiki">VBoxManage setextradata "My VM" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" ""
</pre><blockquote>
<p>
results in DmiSystemVendor being set to <strong>innotek GmbH</strong> if you specify <strong>""</strong> !
</p>
</blockquote>
en-usOracle VM VirtualBox/graphics/vbox_logo2_gradient.pnghttps://www.virtualbox.org/ticket/1957
Trac 0.12TerryEThu, 14 Aug 2008 14:22:26 GMThttps://www.virtualbox.org/ticket/1957#comment:1
https://www.virtualbox.org/ticket/1957#comment:1
<p>
This also applies to Version 1.6.4
</p>
TicketfrankThu, 14 Aug 2008 15:39:48 GMTsummary changedhttps://www.virtualbox.org/ticket/1957#comment:2
https://www.virtualbox.org/ticket/1957#comment:2
<ul>
<li><strong>summary</strong>
changed from <em>DMI default processing is wrong</em> to <em>DMI default processing is wrong => Fixed in 1.6.6</em>
</li>
</ul>
<p>
Small issues will be solved immediately. Actually this problem results from the syntax of
</p>
<pre class="wiki">VBoxManage setextradata
</pre><p>
that is, an empty string removes the data key. So I added a special keyword &lt;EMPTY&gt;. You can now do
</p>
<pre class="wiki">VBoxManage setextradata "My VM" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "&lt;EMPTY&gt;"
</pre><p>
to set an empty DMI system vendor string.
</p>
<p>
Fix is in SVN and backported to 1.6.6.
</p>
TicketTerryEThu, 14 Aug 2008 16:16:17 GMThttps://www.virtualbox.org/ticket/1957#comment:3
https://www.virtualbox.org/ticket/1957#comment:3
<p>
Frank, that's brilliant thanks.
</p>
<p>
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.
</p>
<p>
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 <em>need</em> 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. :-)
</p>
<p>
I'll put a decent post on the forum explaining how to use the DMI stuff in detail and include this <em>after</em> 1.6.6 is released. <em>Terry
</em></p>
TicketfrankTue, 02 Sep 2008 12:44:59 GMTstatus changed; resolution sethttps://www.virtualbox.org/ticket/1957#comment:4
https://www.virtualbox.org/ticket/1957#comment:4
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
Ticket