Changeset 88039 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 9, 2021 12:28:53 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 143170
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r87241 r88039 1633 1633 ASSERT(nic); 1634 1634 1635 /* 1636 * Check if the NIC is already enabled. Do not try to 1637 * enable it if it already is. That makes a 1638 * difference for saved VMs for which you can change 1639 * the NIC attachment, but can't change the NIC 1640 * enabled status (yes, the setter also should not 1641 * freak out about a no-op request). 1642 */ 1643 BOOL fEnabled;; 1644 CHECK_ERROR(nic, COMGETTER(Enabled)(&fEnabled)); 1645 1635 1646 if (!RTStrICmp(ValueUnion.psz, "none")) 1636 1647 { 1637 CHECK_ERROR(nic, COMSETTER(Enabled)(FALSE)); 1648 if (!!fEnabled) 1649 CHECK_ERROR(nic, COMSETTER(Enabled)(FALSE)); 1638 1650 } 1639 1651 else if (!RTStrICmp(ValueUnion.psz, "null")) 1640 1652 { 1641 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1653 if (!fEnabled) 1654 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1642 1655 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Null)); 1643 1656 } 1644 1657 else if (!RTStrICmp(ValueUnion.psz, "nat")) 1645 1658 { 1646 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1659 if (!fEnabled) 1660 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1647 1661 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_NAT)); 1648 1662 } … … 1650 1664 || !RTStrICmp(ValueUnion.psz, "hostif")) /* backward compatibility */ 1651 1665 { 1652 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1666 if (!fEnabled) 1667 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1653 1668 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Bridged)); 1654 1669 } 1655 1670 else if (!RTStrICmp(ValueUnion.psz, "intnet")) 1656 1671 { 1657 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1672 if (!fEnabled) 1673 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1658 1674 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Internal)); 1659 1675 } 1660 1676 else if (!RTStrICmp(ValueUnion.psz, "hostonly")) 1661 1677 { 1662 1663 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE));1678 if (!fEnabled) 1679 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1664 1680 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_HostOnly)); 1665 1681 } 1666 1682 else if (!RTStrICmp(ValueUnion.psz, "generic")) 1667 1683 { 1668 1669 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE));1684 if (!fEnabled) 1685 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1670 1686 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_Generic)); 1671 1687 } 1672 1688 else if (!RTStrICmp(ValueUnion.psz, "natnetwork")) 1673 1689 { 1674 1675 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE));1690 if (!fEnabled) 1691 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1676 1692 CHECK_ERROR(nic, COMSETTER(AttachmentType)(NetworkAttachmentType_NATNetwork)); 1677 1693 }
Note:
See TracChangeset
for help on using the changeset viewer.