VirtualBox

Changeset 88086 in vbox


Ignore:
Timestamp:
Mar 11, 2021 12:50:12 PM (4 years ago)
Author:
vboxsync
Message:

VBoxManage: move getMaxNics() to VBoxManageUtils.cpp. bugref:9966.

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r85780 r88086  
    221221/* VBoxManageControlVM.cpp */
    222222RTEXITCODE handleControlVM(HandlerArg *a);
    223 #ifndef VBOX_ONLY_DOCS
    224 unsigned int getMaxNics(IVirtualBox* vbox, IMachine* mach);
    225 #endif
    226223
    227224/* VBoxManageModifyVM.cpp */
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r88079 r88086  
    6262        return (unsigned)u32;
    6363    errorArgument("Invalid %s number '%s'", name, psz);
    64     return 0;
    65 }
    66 
    67 unsigned int getMaxNics(IVirtualBox* vbox, IMachine* mach)
    68 {
    69     ComPtr<ISystemProperties> info;
    70     ChipsetType_T aChipset;
    71     ULONG NetworkAdapterCount = 0;
    72     HRESULT rc;
    73 
    74     do {
    75         CHECK_ERROR_BREAK(vbox, COMGETTER(SystemProperties)(info.asOutParam()));
    76         CHECK_ERROR_BREAK(mach, COMGETTER(ChipsetType)(&aChipset));
    77         CHECK_ERROR_BREAK(info, GetMaxNetworkAdapters(aChipset, &NetworkAdapterCount));
    78 
    79         return (unsigned int)NetworkAdapterCount;
    80     } while (0);
    81 
    8264    return 0;
    8365}
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r87851 r88086  
    4444
    4545#include "VBoxManage.h"
     46#include "VBoxManageUtils.h"
     47
    4648using namespace com;
    4749
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageUtils.cpp

    r88079 r88086  
    2323
    2424#include <VBox/com/array.h>
     25#include <VBox/com/errorprint.h>
    2526#include <VBox/com/string.h>
    2627
    2728using namespace com;
     29
     30
     31
     32unsigned int getMaxNics(const ComPtr<IVirtualBox> &pVirtualBox,
     33                        const ComPtr<IMachine> &pMachine)
     34{
     35    ComPtr<ISystemProperties> info;
     36    ChipsetType_T aChipset;
     37    ULONG NetworkAdapterCount = 0;
     38    HRESULT rc;
     39
     40    do {
     41        CHECK_ERROR_BREAK(pVirtualBox, COMGETTER(SystemProperties)(info.asOutParam()));
     42        CHECK_ERROR_BREAK(pMachine, COMGETTER(ChipsetType)(&aChipset));
     43        CHECK_ERROR_BREAK(info, GetMaxNetworkAdapters(aChipset, &NetworkAdapterCount));
     44
     45        return (unsigned int)NetworkAdapterCount;
     46    } while (0);
     47
     48    return 0;
     49}
    2850
    2951
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageUtils.h

    r88079 r88086  
    2828#endif
    2929
     30unsigned int getMaxNics(const ComPtr<IVirtualBox> &pVirtualBox,
     31                        const ComPtr<IMachine> &pMachine);
     32
    3033void verifyHostNetworkInterfaceName(const ComPtr<IVirtualBox> &pVirtualBox,
    3134                                    const char *pszTargetName,
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