VirtualBox

Changeset 58959 in vbox


Ignore:
Timestamp:
Dec 2, 2015 9:10:52 PM (9 years ago)
Author:
vboxsync
Message:

Main: Fix starting a VM with a physical PCI device attached. The assignment->COMGETTER(...) calls failed unnoticed with E_ACCESSDENIED producing bogues PCI addresses

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp

    r50922 r58959  
    6666                                  BOOL          fPhysical)
    6767{
    68     (void)aParent;
     68    NOREF(aParent);
     69
     70    /* Enclose the state transition NotReady->InInit->Ready */
     71    AutoInitSpan autoInitSpan(this);
     72    AssertReturn(autoInitSpan.isOk(), E_FAIL);
     73
    6974    m = new Data(aDevName, aHostAddress, aGuestAddress, fPhysical);
    7075
    71     return m != NULL ? S_OK : E_FAIL;
     76    /* Confirm a successful initialization */
     77    autoInitSpan.setSucceeded();
     78
     79    return S_OK;
    7280}
    7381
     
    96104void PCIDeviceAttachment::uninit()
    97105{
    98     if (m)
    99     {
    100         delete m;
    101         m = NULL;
    102     }
     106    /* Enclose the state transition Ready->InUninit->NotReady */
     107    AutoUninitSpan autoUninitSpan(this);
     108    if (autoUninitSpan.uninitDone())
     109        return;
     110
     111    delete m;
     112    m = NULL;
    103113}
    104114
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r58449 r58959  
    573573        PCIBusAddress GuestPCIAddress;
    574574
    575         assignment->COMGETTER(GuestAddress)(&guest);
     575        hrc = assignment->COMGETTER(GuestAddress)(&guest);   H();
    576576        GuestPCIAddress.fromLong(guest);
    577577        Assert(GuestPCIAddress.valid());
     
    626626        Bstr aDevName;
    627627
    628         assignment->COMGETTER(HostAddress)(&host);
    629         assignment->COMGETTER(GuestAddress)(&guest);
    630         assignment->COMGETTER(Name)(aDevName.asOutParam());
     628        hrc = assignment->COMGETTER(HostAddress)(&host);            H();
     629        hrc = assignment->COMGETTER(GuestAddress)(&guest);          H();
     630        hrc = assignment->COMGETTER(Name)(aDevName.asOutParam());   H();
    631631
    632632        InsertConfigNode(pPCIDevs, Utf8StrFmt("%d", iDev).c_str(), &pInst);
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