Changeset 54060 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Feb 2, 2015 9:17:31 PM (10 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r53767 r54060 3675 3675 AssertReturn(enmVMState == VMSTATE_SUSPENDED, VERR_INVALID_STATE); 3676 3676 3677 /* Determine the base path for the device instance. */ 3678 PCFGMNODE pCtlInst; 3679 if (strcmp(pcszDevice, "Msd")) 3680 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%u/", pcszDevice, uInstance); 3681 else 3682 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "USB/%s/", pcszDevice, uInstance); 3683 AssertReturn(pCtlInst, VERR_INTERNAL_ERROR); 3684 3685 PCFGMNODE pLunL0 = NULL; 3686 int rc = pThis->i_configMediumAttachment(pCtlInst, 3687 pcszDevice, 3677 int rc = pThis->i_configMediumAttachment(pcszDevice, 3688 3678 uInstance, 3689 3679 enmBus, … … 3701 3691 pUVM, 3702 3692 NULL /* paLedDevType */, 3703 &pLunL0); 3704 /* Dump the changed LUN if possible, dump the complete device otherwise */ 3705 CFGMR3Dump(pLunL0 ? pLunL0 : pCtlInst); 3706 3693 NULL /* ppLunL0 */); 3707 3694 LogFlowFunc(("Returning %Rrc\n", rc)); 3708 3695 return rc; … … 3863 3850 AssertReturn(enmVMState == VMSTATE_SUSPENDED, VERR_INVALID_STATE); 3864 3851 3865 /* 3866 * Determine the base path for the device instance. USB Msd devices are handled different 3867 * because the PDM USB API requires a differnet CFGM tree when attaching a new USB device. 3868 */ 3869 PCFGMNODE pCtlInst; 3870 3871 if (enmBus == StorageBus_USB) 3872 pCtlInst = CFGMR3CreateTree(pUVM); 3873 else 3874 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%u/", pcszDevice, uInstance); 3875 3876 AssertReturn(pCtlInst, VERR_INTERNAL_ERROR); 3877 3878 PCFGMNODE pLunL0 = NULL; 3879 int rc = pThis->i_configMediumAttachment(pCtlInst, 3880 pcszDevice, 3852 int rc = pThis->i_configMediumAttachment(pcszDevice, 3881 3853 uInstance, 3882 3854 enmBus, … … 3894 3866 pUVM, 3895 3867 NULL /* paLedDevType */, 3896 &pLunL0); 3897 /* Dump the changed LUN if possible, dump the complete device otherwise */ 3898 if (enmBus != StorageBus_USB) 3899 CFGMR3Dump(pLunL0 ? pLunL0 : pCtlInst); 3900 3868 NULL); 3901 3869 LogFlowFunc(("Returning %Rrc\n", rc)); 3902 3870 return rc; … … 9702 9670 return VINF_SUCCESS; 9703 9671 9704 /* Determine the base path for the device instance. */9705 PCFGMNODE pCtlInst;9706 9707 if (enmBus == StorageBus_USB)9708 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "USB/%s/", pcszDevice);9709 else9710 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%u/", pcszDevice, uInstance);9711 9712 AssertReturn(pCtlInst, VERR_INTERNAL_ERROR);9713 9714 9672 /* Update the device instance configuration. */ 9715 PCFGMNODE pLunL0 = NULL; 9716 int rc = pThis->i_configMediumAttachment(pCtlInst, 9717 pcszDevice, 9673 int rc = pThis->i_configMediumAttachment(pcszDevice, 9718 9674 uInstance, 9719 9675 enmBus, … … 9731 9687 pUVM, 9732 9688 NULL /* paLedDevType */, 9733 &pLunL0); 9734 /* Dump the changed LUN if possible, dump the complete device otherwise */ 9735 CFGMR3Dump(pLunL0 ? pLunL0 : pCtlInst); 9689 NULL /* ppLunL0)*/); 9736 9690 if (RT_FAILURE(rc)) 9737 9691 { -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r53831 r54060 2222 2222 { 2223 2223 IMediumAttachment *pMediumAtt = atts[j]; 2224 rc = i_configMediumAttachment(pCtlInst, 2225 pszCtrlDev, 2224 rc = i_configMediumAttachment(pszCtrlDev, 2226 2225 ulInstance, 2227 2226 enmBus, … … 3546 3545 } 3547 3546 3548 int Console::i_configMediumAttachment(PCFGMNODE pCtlInst, 3549 const char *pcszDevice, 3547 int Console::i_configMediumAttachment(const char *pcszDevice, 3550 3548 unsigned uInstance, 3551 3549 StorageBus_T enmBus, … … 3571 3569 HRESULT hrc; 3572 3570 Bstr bstr; 3571 PCFGMNODE pCtlInst = NULL; 3573 3572 3574 3573 // #define RC_CHECK() AssertMsgReturn(RT_SUCCESS(rc), ("rc=%Rrc\n", rc), rc) … … 3589 3588 PCFGMNODE pLunL0 = NULL; 3590 3589 hrc = Console::i_convertBusPortDeviceToLun(enmBus, lPort, lDev, uLUN); H(); 3590 3591 /* Determine the base path for the device instance. */ 3592 if (enmBus != StorageBus_USB) 3593 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "Devices/%s/%u/", pcszDevice, uInstance); 3594 else 3595 { 3596 /* If we hotplug a USB device create a new CFGM tree. */ 3597 if (!fHotplug) 3598 pCtlInst = CFGMR3GetChildF(CFGMR3GetRootU(pUVM), "USB/%s/", pcszDevice, uInstance); 3599 else 3600 pCtlInst = CFGMR3CreateTree(pUVM); 3601 } 3602 AssertReturn(pCtlInst, VERR_INTERNAL_ERROR); 3591 3603 3592 3604 if (enmBus == StorageBus_USB) … … 4007 4019 if (paLedDevType) 4008 4020 paLedDevType[uLUN] = lType; 4021 4022 /* Dump the changed LUN if possible, dump the complete device otherwise */ 4023 if ( aMachineState != MachineState_Starting 4024 && aMachineState != MachineState_Restoring) 4025 CFGMR3Dump(pLunL0 ? pLunL0 : pCtlInst); 4009 4026 } 4010 4027 catch (ConfigError &x)
Note:
See TracChangeset
for help on using the changeset viewer.