VirtualBox

Changeset 4485 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 3, 2007 8:50:34 AM (17 years ago)
Author:
vboxsync
Message:

Pass the VM's GUID to DevPcBIOS so that the GUID can be stored in DMI/SMBIOS
tables and used by applications.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r4391 r4485  
    734734 */
    735735#define STRCPY(p, s) do { memcpy (p, s, sizeof(s)); p += sizeof(s); } while (0)
    736 static void pcbiosPlantDMITable(uint8_t *pTable)
     736static void pcbiosPlantDMITable(uint8_t *pTable, PRTUUID puuid)
    737737{
    738738    char *pszStr = (char*)pTable;
     
    784784    pSystemInf->u8SerialNumber   = iStrNr++;
    785785    STRCPY(pszStr, "0");
     786    memcpy(pSystemInf->au8Uuid, puuid, sizeof(RTUUID));
    786787    pSystemInf->u8WakeupType     = 6; /* Power Switch */
    787788    pSystemInf->u8SKUNumber      = 0;
     
    10921093                              "DelayBoot\0"
    10931094                              "LanBootRom\0"
     1095                              "UUID\0"
    10941096                              "IOAPIC\0"))
    10951097        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
     
    11421144        return rc;
    11431145
    1144     pcbiosPlantDMITable(pData->au8DMIPage);
     1146    /*
     1147     * Query the machine's UUID for SMBIOS/DMI use.
     1148     */
     1149    RTUUID  uuid;
     1150    rc = CFGMR3QueryBytes(pCfgHandle, "UUID", &uuid, sizeof(uuid));
     1151    if (VBOX_FAILURE(rc))
     1152        return PDMDEV_SET_ERROR(pDevIns, rc,
     1153                                N_("Configuration error: Querying \"UUID\" failed"));
     1154
     1155
     1156    /* Convert the UUID to network byte order. Not entirely straightforward as parts are MSB already... */
     1157    uuid.Gen.u32TimeLow = RT_H2BE_U32(uuid.Gen.u32TimeLow);
     1158    uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid);
     1159    uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion);
     1160    pcbiosPlantDMITable(pData->au8DMIPage, &uuid);
    11451161    if (pData->u8IOAPIC)
    11461162        pcbiosPlantMPStable(pDevIns, pData->au8DMIPage + 0x100);
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r4427 r4485  
    215215    rc = CFGMR3InsertString(pCfg,   "FloppyDevice",         "i82078");              RC_CHECK();
    216216    rc = CFGMR3InsertInteger(pCfg,  "IOAPIC",               fIOAPIC);               RC_CHECK();
     217
     218    /*
     219     * Machine UUID.
     220     */
     221    Guid uuid;
     222    hrc = pMachine->COMGETTER (Id)(uuid.asOutParam());                              H();
     223    rc = CFGMR3InsertBytes(pCfg,  "UUID", (void *)uuid.raw(), sizeof(RTUUID));      RC_CHECK();
    217224
    218225    DeviceType_T bootDevice;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette