VirtualBox

Changeset 94954 in vbox


Ignore:
Timestamp:
May 9, 2022 12:03:01 PM (3 years ago)
Author:
vboxsync
Message:

Main/src-client/GuestImpl.cpp: Adjust to the new rules wrt. to rc -> hrc,vrc usage, ​bugref:10223

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r93468 r94954  
    247247
    248248    uint8_t uInstance;
    249     int rc = RTStrToUInt8Ex(pszLastSlash, NULL, 10, &uInstance);
    250     AssertLogRelMsgReturn(RT_SUCCESS(rc) && rc != VWRN_NUMBER_TOO_BIG && rc != VWRN_NEGATIVE_UNSIGNED,
    251                           ("%Rrc '%s'\n", rc, pszName), VINF_SUCCESS)
     249    int vrc = RTStrToUInt8Ex(pszLastSlash, NULL, 10, &uInstance);
     250    AssertLogRelMsgReturn(RT_SUCCESS(vrc) && vrc != VWRN_NUMBER_TOO_BIG && vrc != VWRN_NEGATIVE_UNSIGNED,
     251                          ("%Rrc '%s'\n", vrc, pszName), VINF_SUCCESS)
    252252#endif
    253253
     
    302302    if (ptrVM.isOk())
    303303    {
    304         int rc;
     304        int vrc;
    305305
    306306        /*
     
    312312            /* Query the missing per-VM memory statistics. */
    313313            uint64_t cbTotalMemIgn, cbPrivateMemIgn, cbZeroMemIgn;
    314             rc = ptrVM.vtable()->pfnPGMR3QueryMemoryStats(ptrVM.rawUVM(), &cbTotalMemIgn, &cbPrivateMemIgn,
    315                                                           &cbSharedMem, &cbZeroMemIgn);
    316             if (rc == VINF_SUCCESS)
     314            vrc = ptrVM.vtable()->pfnPGMR3QueryMemoryStats(ptrVM.rawUVM(), &cbTotalMemIgn, &cbPrivateMemIgn,
     315                                                           &cbSharedMem, &cbZeroMemIgn);
     316            if (vrc == VINF_SUCCESS)
    317317                validStats |= pm::VMSTATMASK_GUEST_MEMSHARED;
    318318        }
     
    320320        if (mCollectVMMStats)
    321321        {
    322             rc = ptrVM.vtable()->pfnPGMR3QueryGlobalMemoryStats(ptrVM.rawUVM(), &cbAllocTotal, &cbFreeTotal,
    323                                                                 &cbBalloonedTotal, &cbSharedTotal);
    324             AssertRC(rc);
    325             if (rc == VINF_SUCCESS)
     322            vrc = ptrVM.vtable()->pfnPGMR3QueryGlobalMemoryStats(ptrVM.rawUVM(), &cbAllocTotal, &cbFreeTotal,
     323                                                                 &cbBalloonedTotal, &cbSharedTotal);
     324            AssertRC(vrc);
     325            if (vrc == VINF_SUCCESS)
    326326                validStats |= pm::VMSTATMASK_VMM_ALLOC  | pm::VMSTATMASK_VMM_FREE
    327327                           |  pm::VMSTATMASK_VMM_BALOON | pm::VMSTATMASK_VMM_SHARED;
     
    331331        uint64_t uTxPrev = mNetStatTx;
    332332        mNetStatRx = mNetStatTx = 0;
    333         rc = ptrVM.vtable()->pfnSTAMR3Enum(ptrVM.rawUVM(), "/Public/Net/*/Bytes*", i_staticEnumStatsCallback, this);
    334         AssertRC(rc);
     333        vrc = ptrVM.vtable()->pfnSTAMR3Enum(ptrVM.rawUVM(), "/Public/Net/*/Bytes*", i_staticEnumStatsCallback, this);
     334        AssertRC(vrc);
    335335
    336336        uint64_t uTsNow = RTTimeNanoTS();
     
    709709
    710710    uint64_t cbFreeTotal, cbAllocTotal, cbBalloonedTotal, cbSharedTotal;
    711     int rc = ptrVM.vtable()->pfnPGMR3QueryGlobalMemoryStats(ptrVM.rawUVM(), &cbAllocTotal, &cbFreeTotal,
    712                                                             &cbBalloonedTotal, &cbSharedTotal);
    713     AssertRCReturn(rc, E_FAIL);
     711    int vrc = ptrVM.vtable()->pfnPGMR3QueryGlobalMemoryStats(ptrVM.rawUVM(), &cbAllocTotal, &cbFreeTotal,
     712                                                             &cbBalloonedTotal, &cbSharedTotal);
     713    AssertRCReturn(vrc, E_FAIL);
    714714
    715715    *aMemAllocTotal   = (ULONG)(cbAllocTotal / _1K);  /* bytes -> KB */
     
    720720    /* Query the missing per-VM memory statistics. */
    721721    uint64_t cbTotalMemIgn, cbPrivateMemIgn, cbSharedMem, cbZeroMemIgn;
    722     rc = ptrVM.vtable()->pfnPGMR3QueryMemoryStats(ptrVM.rawUVM(), &cbTotalMemIgn, &cbPrivateMemIgn, &cbSharedMem, &cbZeroMemIgn);
    723     AssertRCReturn(rc, E_FAIL);
     722    vrc = ptrVM.vtable()->pfnPGMR3QueryMemoryStats(ptrVM.rawUVM(), &cbTotalMemIgn, &cbPrivateMemIgn, &cbSharedMem, &cbZeroMemIgn);
     723    AssertRCReturn(vrc, E_FAIL);
    724724    *aMemShared = (ULONG)(cbSharedMem / _1K);
    725725
     
    813813    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    814814
    815     HRESULT rc = S_OK;
     815    HRESULT hrc = S_OK;
    816816    switch (aLevel)
    817817    {
     
    829829
    830830        default:
    831             rc = setError(VBOX_E_NOT_SUPPORTED,
    832                           tr("Invalid status level defined: %u"), aLevel);
     831            hrc = setError(VBOX_E_NOT_SUPPORTED,
     832                           tr("Invalid status level defined: %u"), aLevel);
    833833            break;
    834834    }
    835835
    836     return rc;
    837 }
     836    return hrc;
     837}
     838
    838839HRESULT Guest::setCredentials(const com::Utf8Str &aUserName, const com::Utf8Str &aPassword,
    839840                              const com::Utf8Str &aDomain, BOOL aAllowInteractiveLogon)
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