VirtualBox

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


Ignore:
Timestamp:
Aug 19, 2018 7:07:19 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
124451
Message:

Main,FE/VBoxManage: Allow changing the UART type of the serial ports through the API

File:
1 edited

Legend:

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

    r72973 r73768  
    476476        m->bd.backup();
    477477        m->bd->fServer = RT_BOOL(aServer);
     478
     479        m->fModified = true;
     480        // leave the lock before informing callbacks
     481        alock.release();
     482
     483        AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
     484        m->pMachine->i_setModified(Machine::IsModified_SerialPorts);
     485        mlock.release();
     486
     487        m->pMachine->i_onSerialPortChange(this);
     488    }
     489
     490    return S_OK;
     491}
     492
     493HRESULT SerialPort::getUartType(UartType_T *aUartType)
     494{
     495    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     496
     497    *aUartType = m->bd->uartType;
     498
     499    return S_OK;
     500}
     501
     502HRESULT SerialPort::setUartType(UartType_T aUartType)
     503{
     504    /* the machine needs to be mutable */
     505    AutoMutableOrSavedOrRunningStateDependency adep(m->pMachine);
     506    if (FAILED(adep.rc())) return adep.rc();
     507
     508    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     509
     510    if (m->bd->uartType != aUartType)
     511    {
     512        m->bd.backup();
     513        m->bd->uartType = aUartType;
    478514
    479515        m->fModified = true;
Note: See TracChangeset for help on using the changeset viewer.

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