VirtualBox

Changeset 78565 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
May 17, 2019 12:06:36 PM (6 years ago)
Author:
vboxsync
Message:

Main: bugref:6913: Fixed NULL id in the IMediumRegisteredEvent and fixed generation other medium and storage device events

Location:
trunk/src/VBox/Main/src-server
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r78509 r78565  
    43374337                        tr("Setting passthrough rejected as the device attached to device slot %d on port %d of controller '%s' is not a DVD"),
    43384338                        aDevice, aControllerPort, aName.c_str());
     4339
     4340    bool fValueChanged = pAttach->i_getPassthrough() != (aPassthrough != 0);
     4341
    43394342    pAttach->i_updatePassthrough(!!aPassthrough);
    43404343
     
    43424345    alock.release();
    43434346    rc = i_onStorageDeviceChange(pAttach, FALSE /* aRemove */, FALSE /* aSilent */);
    4344     if (SUCCEEDED(rc))
     4347    if (SUCCEEDED(rc) && fValueChanged)
    43454348        mParent->i_onStorageDeviceChanged(pAttach, FALSE, FALSE);
    43464349
     
    61576160    if (FAILED(rc)) return rc;
    61586161
     6162    MediumAttachmentList llDetachedAttachments;
    61596163    {
    61606164        /* find all attached devices to the appropriate storage controller and detach them all */
     
    61776181            if (pAttachTemp->i_getControllerName() == aName)
    61786182            {
     6183                llDetachedAttachments.push_back(pAttachTemp);
    61796184                rc = i_detachDevice(pAttachTemp, alock, NULL);
    61806185                if (FAILED(rc)) return rc;
    61816186            }
    61826187        }
     6188    }
     6189
     6190    /* send event about detached devices before removing parent controller */
     6191    for (MediumAttachmentList::const_iterator
     6192         it = llDetachedAttachments.begin();
     6193         it != llDetachedAttachments.end();
     6194         ++it)
     6195    {
     6196        mParent->i_onStorageDeviceChanged(*it, TRUE, FALSE);
    61836197    }
    61846198
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r78403 r78565  
    23362336    pVirtualBox->i_saveModifiedRegistries();
    23372337
    2338     if (SUCCEEDED(mrc))
     2338    if (SUCCEEDED(mrc) && uId.isValid() && !uId.isZero())
    23392339        pVirtualBox->i_onMediumRegistered(uId, devType, FALSE);
    23402340
     
    84148414
    84158415    if (task.NotifyAboutChanges() && SUCCEEDED(rc))
     8416    {
    84168417        m->pVirtualBox->i_onMediumConfigChanged(this);
     8418        m->pVirtualBox->i_onMediumRegistered(m->id, m->devType, TRUE);
     8419    }
    84178420
    84188421    return rc;
     
    86418644
    86428645    if (task.NotifyAboutChanges() && SUCCEEDED(mrc))
     8646    {
    86438647        m->pVirtualBox->i_onMediumConfigChanged(this);
     8648        m->pVirtualBox->i_onMediumRegistered(m->id, m->devType, TRUE);
     8649    }
    86448650
    86458651    return mrc;
     
    96509656
    96519657    /* Reset UUID to prevent Create* from reusing it again */
     9658    com::Guid uOldId = m->id;
    96529659    unconst(m->id).clear();
    96539660
    9654     if (task.NotifyAboutChanges() && SUCCEEDED(rc) && m->pParent.isNotNull())
    9655         m->pVirtualBox->i_onMediumConfigChanged(m->pParent);
     9661    if (task.NotifyAboutChanges() && SUCCEEDED(rc))
     9662    {
     9663        if (m->pParent.isNotNull())
     9664            m->pVirtualBox->i_onMediumConfigChanged(m->pParent);
     9665        m->pVirtualBox->i_onMediumRegistered(uOldId, m->devType, TRUE);
     9666    }
    96569667
    96579668    return rc;
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r76592 r78565  
    32343234                    else
    32353235                    {
    3236                         for (ComObjPtr<Medium> pTmpMedium = it->mpSource->i_getParent();
     3236                        for (ComObjPtr<Medium> pTmpMedium = it->mpSource;
    32373237                             pTmpMedium && pTmpMedium != it->mpTarget;
    32383238                             pTmpMedium = pTmpMedium->i_getParent())
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r78261 r78565  
    19781978    {
    19791979        medium.queryInterfaceTo(aMedium.asOutParam());
    1980         i_onMediumRegistered(medium->i_getId(), medium->i_getDeviceType(), TRUE);
     1980        com::Guid uMediumId = medium->i_getId();
     1981        if (uMediumId.isValid() && !uMediumId.isZero())
     1982            i_onMediumRegistered(uMediumId, medium->i_getDeviceType(), TRUE);
    19811983    }
    19821984
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