VirtualBox

Changeset 88079 in vbox


Ignore:
Timestamp:
Mar 10, 2021 8:48:09 PM (4 years ago)
Author:
vboxsync
Message:

VBoxManage: When setting the host interface for bridging or hostonly
attachments do a sanity check on it. Make sure IHost knows about it
and that the interface is of correct type. Warn the user if that's
not the case, but the warning is non-fatal. The API setters don't do
this, so provide at least some protection from typos and mistakes.
bugref:9966.

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk

    r87241 r88079  
    7878 VBoxManage_SOURCES    = \
    7979        VBoxManage.cpp \
     80        VBoxManageUtils.cpp \
    8081        VBoxInternalManage.cpp \
    8182        VBoxManageAppliance.cpp \
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r84814 r88079  
    3838
    3939#include "VBoxManage.h"
     40#include "VBoxManageUtils.h"
    4041
    4142#include <list>
     
    11861187                        }
    11871188                        CHECK_ERROR_RET(adapter, COMSETTER(BridgedInterface)(Bstr(a->argv[3]).raw()), RTEXITCODE_FAILURE);
     1189                        verifyHostNetworkInterfaceName(a->virtualBox, a->argv[3], HostNetworkInterfaceType_Bridged);
    11881190                        CHECK_ERROR_RET(adapter, COMSETTER(AttachmentType)(NetworkAttachmentType_Bridged), RTEXITCODE_FAILURE);
    11891191                    }
     
    12091211                        }
    12101212                        CHECK_ERROR_RET(adapter, COMSETTER(HostOnlyInterface)(Bstr(a->argv[3]).raw()), RTEXITCODE_FAILURE);
     1213                        verifyHostNetworkInterfaceName(a->virtualBox, a->argv[3], HostNetworkInterfaceType_HostOnly);
    12111214                        CHECK_ERROR_RET(adapter, COMSETTER(AttachmentType)(NetworkAttachmentType_HostOnly), RTEXITCODE_FAILURE);
    12121215                    }
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r88040 r88079  
    3838#include <VBox/log.h>
    3939#include "VBoxManage.h"
     40#include "VBoxManageUtils.h"
    4041
    4142#ifndef VBOX_ONLY_DOCS
     
    17301731                {
    17311732                    CHECK_ERROR(nic, COMSETTER(BridgedInterface)(Bstr(ValueUnion.psz).raw()));
     1733                    verifyHostNetworkInterfaceName(a->virtualBox, ValueUnion.psz,
     1734                                                   HostNetworkInterfaceType_Bridged);
    17321735                }
    17331736                break;
     
    17511754                {
    17521755                    CHECK_ERROR(nic, COMSETTER(HostOnlyInterface)(Bstr(ValueUnion.psz).raw()));
     1756                    verifyHostNetworkInterfaceName(a->virtualBox, ValueUnion.psz,
     1757                                                   HostNetworkInterfaceType_HostOnly);
    17531758                }
    17541759                break;
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