VirtualBox

Changeset 84649 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 3, 2020 8:17:41 AM (5 years ago)
Author:
vboxsync
Message:

Guest Control/Main: Big guest error information revamp, to show more information about the actual context in which an error occurred [build fix]. bugref:9320

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

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

    r84648 r84649  
    26612661        default:
    26622662            strErr = Utf8StrFmt(Guest::tr("Unhandled error %Rrc for \"%s\" occurred for tool \"%s\" on guest -- please file a bug report"),
    2663                                 guestErrorInfo.getRc(), guestErrorInfo.getWhat(), pszTool);
     2663                                guestErrorInfo.getRc(), guestErrorInfo.getWhat().c_str(), pszTool);
    26642664            break;
    26652665    }
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r84648 r84649  
    459459 *
    460460 * @return VBox status code. VINF_NO_CHANGE if file was skipped.
    461  * @param  strSource            Full path of source file on the guest to copy.
    462  * @param  strDest              Full destination path and file name (host style) to copy file to.
     461 * @param  strSrc               Full path of source file on the guest to copy.
     462 * @param  strDst               Full destination path and file name (host style) to copy file to.
    463463 * @param  fFileCopyFlags       File copy flags.
    464464 */
    465 int GuestSessionTask::fileCopyFromGuest(const Utf8Str &strSrc, const Utf8Str &strDest, FileCopyFlag_T fFileCopyFlags)
    466 {
    467     LogFlowThisFunc(("strSource=%s, strDest=%s, enmFileCopyFlags=0x%x\n", strSrc.c_str(), strDest.c_str(), fFileCopyFlags));
     465int GuestSessionTask::fileCopyFromGuest(const Utf8Str &strSrc, const Utf8Str &strDst, FileCopyFlag_T fFileCopyFlags)
     466{
     467    LogFlowThisFunc(("strSource=%s, strDest=%s, enmFileCopyFlags=0x%x\n", strSrc.c_str(), strDst.c_str(), fFileCopyFlags));
    468468
    469469    GuestFileOpenInfo srcOpenInfo;
     
    537537    if (RT_SUCCESS(rc))
    538538    {
    539         rc = RTPathQueryInfo(strDest.c_str(), &dstObjInfo, RTFSOBJATTRADD_NOTHING);
     539        rc = RTPathQueryInfo(strDst.c_str(), &dstObjInfo, RTFSOBJATTRADD_NOTHING);
    540540        if (RT_SUCCESS(rc))
    541541        {
     
    543543            {
    544544                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    545                                     Utf8StrFmt(GuestSession::tr("Host file \"%s\" already exists"), strDest.c_str()));
     545                                    Utf8StrFmt(GuestSession::tr("Host file \"%s\" already exists"), strDst.c_str()));
    546546                rc = VERR_ALREADY_EXISTS;
    547547            }
     
    555555                    setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    556556                                        Utf8StrFmt(GuestSession::tr("Host file \"%s\" has same or newer modification date"),
    557                                                    strDest.c_str()));
     557                                                   strDst.c_str()));
    558558                    fSkip = true;
    559559                }
     
    565565                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    566566                                    Utf8StrFmt(GuestSession::tr("Host file lookup for \"%s\" failed: %Rrc"),
    567                                                strDest.c_str(), rc));
     567                                               strDst.c_str(), rc));
    568568        }
    569569    }
     
    583583            {
    584584                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    585                                     Utf8StrFmt(GuestSession::tr("Host file \"%s\" already exists"), strDest.c_str()));
     585                                    Utf8StrFmt(GuestSession::tr("Host file \"%s\" already exists"), strDst.c_str()));
    586586                rc = VERR_ALREADY_EXISTS;
    587587            }
    588588            else
    589                 pszDstFile = RTStrDup(strDest.c_str());
     589                pszDstFile = RTStrDup(strDst.c_str());
    590590        }
    591591        else if (RTFS_IS_DIRECTORY(dstObjInfo.Attr.fMode))
     
    593593            /* Build the final file name with destination path (on the host). */
    594594            char szDstPath[RTPATH_MAX];
    595             RTStrPrintf2(szDstPath, sizeof(szDstPath), "%s", strDest.c_str());
    596 
    597             if (   !strDest.endsWith("\\")
    598                 && !strDest.endsWith("/"))
     595            RTStrPrintf2(szDstPath, sizeof(szDstPath), "%s", strDst.c_str());
     596
     597            if (   !strDst.endsWith("\\")
     598                && !strDst.endsWith("/"))
    599599                RTPathAppend(szDstPath, sizeof(szDstPath), "/"); /* IPRT can handle / on all hosts. */
    600600
     
    609609                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    610610                                    Utf8StrFmt(GuestSession::tr("Host file \"%s\" is a symbolic link"),
    611                                                strDest.c_str()));
     611                                               strDst.c_str()));
    612612                rc = VERR_IS_A_SYMLINK;
    613613            }
    614614            else
    615                 pszDstFile = RTStrDup(strDest.c_str());
     615                pszDstFile = RTStrDup(strDst.c_str());
    616616        }
    617617        else
     
    622622    }
    623623    else if (rc == VERR_FILE_NOT_FOUND)
    624         pszDstFile = RTStrDup(strDest.c_str());
     624        pszDstFile = RTStrDup(strDst.c_str());
    625625
    626626    if (   RT_SUCCESS(rc)
     
    25792579                            if (itFiles->fFlags & ISOFILE_FLAG_OPTIONAL)
    25802580                                fOptional = true;
    2581                             rc = copyFileToGuest(pSession, hVfsIso, itFiles->strSource, itFiles->strDest, fOptional);
     2581                            rc = copyFileToGuest(pSession, hVfsIso, itFiles->strSource, itFiles->strDst, fOptional);
    25822582                            if (RT_FAILURE(rc))
    25832583                            {
    25842584                                hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    25852585                                                         Utf8StrFmt(GuestSession::tr("Error while copying file \"%s\" to \"%s\" on the guest: %Rrc"),
    2586                                                                     itFiles->strSource.c_str(), itFiles->strDest.c_str(), rc));
     2586                                                                    itFiles->strSource.c_str(), itFiles->strDst.c_str(), rc));
    25872587                                break;
    25882588                            }
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