VirtualBox

Ignore:
Timestamp:
Jun 3, 2020 8:11:04 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138400
Message:

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

File:
1 edited

Legend:

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

    r84551 r84648  
    193193}
    194194
     195/**
     196 * Sets the task's progress object to an error using a string message.
     197 *
     198 * @returns Returns \a hr for covenience.
     199 * @param   hr                  Progress operation result to set.
     200 * @param   strMsg              Message to set.
     201 */
    195202HRESULT GuestSessionTask::setProgressErrorMsg(HRESULT hr, const Utf8Str &strMsg)
    196203{
    197     LogFlowFunc(("hr=%Rhrc, strMsg=%s\n",
    198                  hr, strMsg.c_str()));
     204    LogFlowFunc(("hr=%Rhrc, strMsg=%s\n", hr, strMsg.c_str()));
    199205
    200206    if (mProgress.isNull()) /* Progress is optional. */
     
    218224}
    219225
    220 HRESULT GuestSessionTask::setProgressErrorMsg(HRESULT hrc, int vrc, const char *pszFormat, ...)
    221 {
    222     LogFlowFunc(("hrc=%Rhrc, vrc=%Rrc, pszFormat=%s\n", hrc, vrc, pszFormat));
    223 
    224     /* The progress object is optional. */
    225     if (!mProgress.isNull())
    226     {
    227         BOOL fCanceled;
    228         BOOL fCompleted;
    229         if (   SUCCEEDED(mProgress->COMGETTER(Canceled(&fCanceled)))
    230             && !fCanceled
    231             && SUCCEEDED(mProgress->COMGETTER(Completed(&fCompleted)))
    232             && !fCompleted)
    233         {
    234             va_list va;
    235             va_start(va, pszFormat);
    236             HRESULT hrc2 = mProgress->i_notifyCompleteBothV(hrc, vrc, COM_IIDOF(IGuestSession),
    237                                                             GuestSession::getStaticComponentName(), pszFormat, va);
    238             va_end(va);
    239             if (FAILED(hrc2))
    240                 hrc = hrc2;
    241         }
    242     }
    243     return hrc;
     226/**
     227 * Sets the task's progress object to an error using a string message and a guest error info object.
     228 *
     229 * @returns Returns \a hr for covenience.
     230 * @param   hr                  Progress operation result to set.
     231 * @param   strMsg              Message to set.
     232 * @param   guestErrorInfo      Guest error info to use.
     233 */
     234HRESULT GuestSessionTask::setProgressErrorMsg(HRESULT hr, const Utf8Str &strMsg, const GuestErrorInfo &guestErrorInfo)
     235{
     236    return setProgressErrorMsg(hr, strMsg + Utf8Str(": ") + GuestBase::getErrorAsString(guestErrorInfo));
    244237}
    245238
     
    353346 *
    354347 * @return VBox status code.
     348 * @param  strSrcFile         Full path of source file on the host to copy.
    355349 * @param  srcFile            Guest file (source) to copy to the host. Must be in opened and ready state already.
     350 * @param  strDstFile         Full destination path and file name (guest style) to copy file to.
    356351 * @param  phDstFile          Pointer to host file handle (destination) to copy to. Must be in opened and ready state already.
    357352 * @param  fFileCopyFlags     File copy flags.
     
    359354 * @param  cbSize             Size (in bytes) to copy from the source file.
    360355 */
    361 int GuestSessionTask::fileCopyFromGuestInner(ComObjPtr<GuestFile> &srcFile, PRTFILE phDstFile, FileCopyFlag_T fFileCopyFlags,
    362                                             uint64_t offCopy, uint64_t cbSize)
     356int GuestSessionTask::fileCopyFromGuestInner(const Utf8Str &strSrcFile, ComObjPtr<GuestFile> &srcFile,
     357                                             const Utf8Str &strDstFile, PRTFILE phDstFile,
     358                                             FileCopyFlag_T fFileCopyFlags, uint64_t offCopy, uint64_t cbSize)
    363359{
    364360    RT_NOREF(fFileCopyFlags);
     
    379375        {
    380376            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    381                                 Utf8StrFmt(GuestSession::tr("Seeking to offset %RU64 failed: %Rrc"), offCopy, rc));
     377                                Utf8StrFmt(GuestSession::tr("Seeking to offset %RU64 of guest file \"%s\" failed: %Rrc"),
     378                                           offCopy, strSrcFile.c_str(), rc));
    382379            return rc;
    383380        }
     
    393390        {
    394391            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    395                                 Utf8StrFmt(GuestSession::tr("Reading %RU32 bytes @ %RU64 from guest failed: %Rrc"), cbChunk, cbWrittenTotal, rc));
     392                                Utf8StrFmt(GuestSession::tr("Reading %RU32 bytes @ %RU64 from guest \"%s\" failed: %Rrc"),
     393                                           cbChunk, cbWrittenTotal, strSrcFile.c_str(), rc));
    396394            break;
    397395        }
     
    401399        {
    402400            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    403                                 Utf8StrFmt(GuestSession::tr("Writing %RU32 bytes to file on host failed: %Rrc"), cbRead, rc));
     401                                Utf8StrFmt(GuestSession::tr("Writing %RU32 bytes to host file \"%s\" failed: %Rrc"),
     402                                           cbRead, strDstFile.c_str(), rc));
    404403            break;
    405404        }
     
    439438         * to the destination -> access denied. */
    440439        setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    441                             Utf8StrFmt(GuestSession::tr("Writing guest file to host failed: Access denied")));
     440                            Utf8StrFmt(GuestSession::tr("Writing guest file \"%s\" to host file \"%s\" failed: Access denied"),
     441                                       strSrcFile.c_str(), strDstFile.c_str()));
    442442        rc = VERR_ACCESS_DENIED;
    443443    }
     
    446446        /* If we did not copy all let the user know. */
    447447        setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    448                             Utf8StrFmt(GuestSession::tr("Copying guest file to host to failed (%RU64/%RU64 bytes transfered)"),
    449                                        cbWrittenTotal, cbSize));
     448                            Utf8StrFmt(GuestSession::tr("Copying guest file \"%s\" to host file \"%s\" failed (%RU64/%RU64 bytes transfered)"),
     449                                       strSrcFile.c_str(), strDstFile.c_str(), cbWrittenTotal, cbSize));
    450450        rc = VERR_INTERRUPTED;
    451451    }
     
    463463 * @param  fFileCopyFlags       File copy flags.
    464464 */
    465 int GuestSessionTask::fileCopyFromGuest(const Utf8Str &strSource, const Utf8Str &strDest, FileCopyFlag_T fFileCopyFlags)
    466 {
    467     LogFlowThisFunc(("strSource=%s, strDest=%s, enmFileCopyFlags=0x%x\n", strSource.c_str(), strDest.c_str(), fFileCopyFlags));
     465int 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));
    468468
    469469    GuestFileOpenInfo srcOpenInfo;
    470     srcOpenInfo.mFilename     = strSource;
     470    srcOpenInfo.mFilename     = strSrc;
    471471    srcOpenInfo.mOpenAction   = FileOpenAction_OpenExisting;
    472472    srcOpenInfo.mAccessMode   = FileAccessMode_ReadOnly;
     
    477477    GuestFsObjData srcObjData;
    478478    int rcGuest = VERR_IPE_UNINITIALIZED_STATUS;
    479     int rc = mSession->i_fsQueryInfo(strSource, TRUE /* fFollowSymlinks */, srcObjData, &rcGuest);
     479    int rc = mSession->i_fsQueryInfo(strSrc, TRUE /* fFollowSymlinks */, srcObjData, &rcGuest);
    480480    if (RT_FAILURE(rc))
    481481    {
    482         switch (rc)
    483         {
    484             case VERR_GSTCTL_GUEST_ERROR:
    485                 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest));
     482        if (rc == VERR_GSTCTL_GUEST_ERROR)
     483            setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Guest file lookup failed"),
     484                                GuestErrorInfo(GuestErrorInfo::Type_ToolStat, rcGuest, strSrc.c_str()));
     485        else
     486            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
     487                                Utf8StrFmt(GuestSession::tr("Guest file lookup for \"%s\" failed: %Rrc"), strSrc.c_str(), rc));
     488    }
     489    else
     490    {
     491        switch (srcObjData.mType)
     492        {
     493            case FsObjType_File:
     494                break;
     495
     496            case FsObjType_Symlink:
     497                if (!(fFileCopyFlags & FileCopyFlag_FollowLinks))
     498                {
     499                    setProgressErrorMsg(VBOX_E_IPRT_ERROR,
     500                                        Utf8StrFmt(GuestSession::tr("Guest file \"%s\" is a symbolic link"),
     501                                                   strSrc.c_str()));
     502                    rc = VERR_IS_A_SYMLINK;
     503                }
    486504                break;
    487505
    488506            default:
    489507                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    490                                     Utf8StrFmt(GuestSession::tr("Source file lookup for \"%s\" failed: %Rrc"),
    491                                                strSource.c_str(), rc));
    492                 break;
    493         }
    494     }
    495     else
    496     {
    497         switch (srcObjData.mType)
    498         {
    499             case FsObjType_File:
    500                 break;
    501 
    502             case FsObjType_Symlink:
    503                 if (!(fFileCopyFlags & FileCopyFlag_FollowLinks))
    504                 {
    505                     setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    506                                         Utf8StrFmt(GuestSession::tr("Source file \"%s\" is a symbolic link"),
    507                                                    strSource.c_str(), rc));
    508                     rc = VERR_IS_A_SYMLINK;
    509                 }
    510                 break;
    511 
    512             default:
    513                 setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    514                                     Utf8StrFmt(GuestSession::tr("Source element \"%s\" is not a file"), strSource.c_str()));
     508                                    Utf8StrFmt(GuestSession::tr("Guest object \"%s\" is not a file"), strSrc.c_str()));
    515509                rc = VERR_NOT_A_FILE;
    516510                break;
     
    524518    if (RT_FAILURE(rc))
    525519    {
    526         switch (rc)
    527         {
    528             case VERR_GSTCTL_GUEST_ERROR:
    529                 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest));
    530                 break;
    531 
    532             default:
    533                 setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    534                                     Utf8StrFmt(GuestSession::tr("Source file \"%s\" could not be opened: %Rrc"),
    535                                                strSource.c_str(), rc));
    536                 break;
    537         }
     520        if (rc == VERR_GSTCTL_GUEST_ERROR)
     521            setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Guest file could not be opened"),
     522                                GuestErrorInfo(GuestErrorInfo::Type_File, rcGuest, strSrc.c_str()));
     523        else
     524            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
     525                                Utf8StrFmt(GuestSession::tr("Guest file \"%s\" could not be opened: %Rrc"), strSrc.c_str(), rc));
    538526    }
    539527
     
    555543            {
    556544                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    557                                     Utf8StrFmt(GuestSession::tr("Destination file \"%s\" already exists"), strDest.c_str()));
     545                                    Utf8StrFmt(GuestSession::tr("Host file \"%s\" already exists"), strDest.c_str()));
    558546                rc = VERR_ALREADY_EXISTS;
    559547            }
     
    566554                {
    567555                    setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    568                                         Utf8StrFmt(GuestSession::tr("Destination file \"%s\" has same or newer modification date"),
     556                                        Utf8StrFmt(GuestSession::tr("Host file \"%s\" has same or newer modification date"),
    569557                                                   strDest.c_str()));
    570558                    fSkip = true;
     
    576564            if (rc != VERR_FILE_NOT_FOUND) /* Destination file does not exist (yet)? */
    577565                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    578                                     Utf8StrFmt(GuestSession::tr("Destination file lookup for \"%s\" failed: %Rrc"),
     566                                    Utf8StrFmt(GuestSession::tr("Host file lookup for \"%s\" failed: %Rrc"),
    579567                                               strDest.c_str(), rc));
    580568        }
     
    595583            {
    596584                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    597                                     Utf8StrFmt(GuestSession::tr("Destination file \"%s\" already exists"),
    598                                                strDest.c_str(), rc));
     585                                    Utf8StrFmt(GuestSession::tr("Host file \"%s\" already exists"), strDest.c_str()));
    599586                rc = VERR_ALREADY_EXISTS;
    600587            }
     
    612599                RTPathAppend(szDstPath, sizeof(szDstPath), "/"); /* IPRT can handle / on all hosts. */
    613600
    614             RTPathAppend(szDstPath, sizeof(szDstPath), RTPathFilenameEx(strSource.c_str(), mfPathStyle));
     601            RTPathAppend(szDstPath, sizeof(szDstPath), RTPathFilenameEx(strSrc.c_str(), mfPathStyle));
    615602
    616603            pszDstFile = RTStrDup(szDstPath);
     
    621608            {
    622609                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    623                                     Utf8StrFmt(GuestSession::tr("Destination file \"%s\" is a symbolic link"),
    624                                                strDest.c_str(), rc));
     610                                    Utf8StrFmt(GuestSession::tr("Host file \"%s\" is a symbolic link"),
     611                                               strDest.c_str()));
    625612                rc = VERR_IS_A_SYMLINK;
    626613            }
     
    652639            if (RT_SUCCESS(rc))
    653640            {
    654                 LogFlowThisFunc(("Copying '%s' to '%s' (%RI64 bytes) ...\n", strSource.c_str(), pszDstFile, srcObjData.mObjectSize));
    655 
    656                 rc = fileCopyFromGuestInner(srcFile, &hDstFile, fFileCopyFlags, 0 /* Offset, unused */, (uint64_t)srcObjData.mObjectSize);
     641                LogFlowThisFunc(("Copying '%s' to '%s' (%RI64 bytes) ...\n",
     642                                 strSrc.c_str(), pszDstFile, srcObjData.mObjectSize));
     643
     644                rc = fileCopyFromGuestInner(strSrc, srcFile, pszDstFile, &hDstFile, fFileCopyFlags,
     645                                            0 /* Offset, unused */, (uint64_t)srcObjData.mObjectSize);
    657646
    658647                int rc2 = RTFileClose(hDstFile);
     
    661650            else
    662651                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    663                                     Utf8StrFmt(GuestSession::tr("Opening/creating destination file \"%s\" failed: %Rrc"),
     652                                    Utf8StrFmt(GuestSession::tr("Opening/creating host file \"%s\" failed: %Rrc"),
    664653                                               pszDstFile, rc));
    665654        }
     
    679668 *
    680669 * @return VBox status code.
     670 * @param  strSrcFile         Full path of source file on the host to copy.
    681671 * @param  hVfsFile           The VFS file handle to read from.
    682  * @param  dstFile            Guest file (destination) to copy to the guest. Must be in opened and ready state already.
     672 * @param  strDstFile         Full destination path and file name (guest style) to copy file to.
     673 * @param  fileDst            Guest file (destination) to copy to the guest. Must be in opened and ready state already.
    683674 * @param  fFileCopyFlags     File copy flags.
    684675 * @param  offCopy            Offset (in bytes) where to start copying the source file.
    685676 * @param  cbSize             Size (in bytes) to copy from the source file.
    686677 */
    687 int GuestSessionTask::fileCopyToGuestInner(RTVFSFILE hVfsFile, ComObjPtr<GuestFile> &dstFile, FileCopyFlag_T fFileCopyFlags,
    688                                            uint64_t offCopy, uint64_t cbSize)
     678int GuestSessionTask::fileCopyToGuestInner(const Utf8Str &strSrcFile, RTVFSFILE hVfsFile,
     679                                           const Utf8Str &strDstFile, ComObjPtr<GuestFile> &fileDst,
     680                                           FileCopyFlag_T fFileCopyFlags, uint64_t offCopy, uint64_t cbSize)
    689681{
    690682    RT_NOREF(fFileCopyFlags);
     
    705697        {
    706698            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    707                                 Utf8StrFmt(GuestSession::tr("Seeking to offset %RU64 failed: %Rrc"), offCopy, rc));
     699                                Utf8StrFmt(GuestSession::tr("Seeking to offset %RU64 of host file \"%s\" failed: %Rrc"),
     700                                           offCopy, strSrcFile.c_str(), rc));
    708701            return rc;
    709702        }
     
    719712        {
    720713            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    721                                 Utf8StrFmt(GuestSession::tr("Reading %RU32 bytes @ %RU64 from host failed: %Rrc"), cbChunk, cbWrittenTotal, rc));
     714                                Utf8StrFmt(GuestSession::tr("Reading %RU32 bytes @ %RU64 from host file \"%s\" failed: %Rrc"),
     715                                           cbChunk, cbWrittenTotal, strSrcFile.c_str(), rc));
    722716            break;
    723717        }
    724718
    725         rc = dstFile->i_writeData(uTimeoutMs, byBuf, (uint32_t)cbRead, NULL /* No partial writes */);
     719        rc = fileDst->i_writeData(uTimeoutMs, byBuf, (uint32_t)cbRead, NULL /* No partial writes */);
    726720        if (RT_FAILURE(rc))
    727721        {
    728722            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    729                                 Utf8StrFmt(GuestSession::tr("Writing %zu bytes to file on guest failed: %Rrc"), cbRead, rc));
     723                                Utf8StrFmt(GuestSession::tr("Writing %zu bytes to guest file \"%s\" failed: %Rrc"),
     724                                           cbRead, strDstFile.c_str(), rc));
    730725            break;
    731726        }
     
    761756         * to the destination -> access denied. */
    762757        setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    763                             Utf8StrFmt(GuestSession::tr("Writing to destination file failed: Access denied")));
     758                            Utf8StrFmt(GuestSession::tr("Writing to guest file \"%s\" failed: Access denied"),
     759                                       strDstFile.c_str()));
    764760        rc = VERR_ACCESS_DENIED;
    765761    }
     
    768764        /* If we did not copy all let the user know. */
    769765        setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    770                             Utf8StrFmt(GuestSession::tr("Copying to destination failed (%RU64/%RU64 bytes transfered)"),
    771                                        cbWrittenTotal, cbSize));
     766                            Utf8StrFmt(GuestSession::tr("Copying to guest file \"%s\" failed (%RU64/%RU64 bytes transfered)"),
     767                                       strDstFile.c_str(), cbWrittenTotal, cbSize));
    772768        rc = VERR_INTERRUPTED;
    773769    }
     
    805801    if (RT_FAILURE(rc))
    806802    {
    807         setProgressErrorMsg(VBOX_E_IPRT_ERROR, rc == VERR_GSTCTL_GUEST_ERROR ? rcGuest : rc,
    808                             GuestSession::tr("Destination file \"%s\" could not be opened: %Rrc"),
    809                             strDstFinal.c_str(), rc == VERR_GSTCTL_GUEST_ERROR ? rcGuest : rc);
     803        if (rc == VERR_GSTCTL_GUEST_ERROR)
     804            setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Guest file could not be opened"),
     805                                GuestErrorInfo(GuestErrorInfo::Type_File, rcGuest, strSrc.c_str()));
     806        else
     807            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
     808                                Utf8StrFmt(GuestSession::tr("Guest file \"%s\" could not be opened: %Rrc"), strSrc.c_str(), rc));
    810809        return rc;
    811810    }
     
    824823        {
    825824            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    826                                 Utf8StrFmt(GuestSession::tr("Source path lookup for \"%s\" failed: %Rrc"),
     825                                Utf8StrFmt(GuestSession::tr("Host path lookup for file \"%s\" failed: %Rrc"),
    827826                                           strSrc.c_str(), rc));
    828827        }
     
    843842                        if (RTTimeSpecCompare(&dstModificationTimeTS, &srcObjInfo.ModificationTime) <= 0)
    844843                        {
    845                             LogRel2(("Guest Control: Destination file \"%s\" has same or newer modification date, skipping",
     844                            LogRel2(("Guest Control: Guest file \"%s\" has same or newer modification date, skipping",
    846845                                     strDstFinal.c_str()));
    847846                            fSkip = true;
     
    875874            {
    876875                setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    877                                     Utf8StrFmt(GuestSession::tr("Source file lookup for \"%s\" failed: %Rrc"),
     876                                    Utf8StrFmt(GuestSession::tr("Host file lookup for \"%s\" failed: %Rrc"),
    878877                                               szSrcReal, rc));
    879878            }
     
    897896                             szSrcReal, strDstFinal.c_str(), srcObjInfo.cbObject));
    898897
    899             rc = fileCopyToGuestInner(hSrcFile, dstFile, fFileCopyFlags, 0 /* Offset, unused */, srcObjInfo.cbObject);
     898            rc = fileCopyToGuestInner(szSrcReal, hSrcFile, strDstFinal, dstFile,
     899                                      fFileCopyFlags, 0 /* Offset, unused */, srcObjInfo.cbObject);
    900900
    901901            int rc2 = RTVfsFileRelease(hSrcFile);
     
    904904        else
    905905            setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    906                                 Utf8StrFmt(GuestSession::tr("Opening source file \"%s\" failed: %Rrc"),
     906                                Utf8StrFmt(GuestSession::tr("Opening host file \"%s\" failed: %Rrc"),
    907907                                           szSrcReal, rc));
    908908    }
     
    15311531        if (strErrorInfo.isEmpty())
    15321532            strErrorInfo = Utf8StrFmt(GuestSession::tr("Failed with %Rrc"), vrc);
    1533         setProgressErrorMsg(VBOX_E_IPRT_ERROR, vrc, "%s", strErrorInfo.c_str());
     1533        setProgressErrorMsg(VBOX_E_IPRT_ERROR, strErrorInfo);
    15341534    }
    15351535
     
    20302030
    20312031int GuestSessionTaskUpdateAdditions::copyFileToGuest(GuestSession *pSession, RTVFS hVfsIso,
    2032                                                      Utf8Str const &strFileSource, const Utf8Str &strFileDest,
     2032                                                     Utf8Str const &strFileSrc, const Utf8Str &strFileDst,
    20332033                                                     bool fOptional)
    20342034{
     
    20372037
    20382038    RTVFSFILE hVfsFile = NIL_RTVFSFILE;
    2039     int rc = RTVfsFileOpen(hVfsIso, strFileSource.c_str(),
     2039    int rc = RTVfsFileOpen(hVfsIso, strFileSrc.c_str(),
    20402040                           RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, & hVfsFile);
    20412041    if (RT_SUCCESS(rc))
     
    20462046        {
    20472047            LogRel(("Copying Guest Additions installer file \"%s\" to \"%s\" on guest ...\n",
    2048                     strFileSource.c_str(), strFileDest.c_str()));
     2048                    strFileSrc.c_str(), strFileDst.c_str()));
    20492049
    20502050            GuestFileOpenInfo dstOpenInfo;
    2051             dstOpenInfo.mFilename    = strFileDest;
     2051            dstOpenInfo.mFilename    = strFileDst;
    20522052            dstOpenInfo.mOpenAction  = FileOpenAction_CreateOrReplace;
    20532053            dstOpenInfo.mAccessMode  = FileAccessMode_WriteOnly;
     
    20622062                {
    20632063                    case VERR_GSTCTL_GUEST_ERROR:
    2064                         setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest));
     2064                        setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestFile::i_guestErrorToString(rcGuest, strFileDst.c_str()));
    20652065                        break;
    20662066
    20672067                    default:
    20682068                        setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2069                                             Utf8StrFmt(GuestSession::tr("Destination file \"%s\" could not be opened: %Rrc"),
    2070                                                        strFileDest.c_str(), rc));
     2069                                            Utf8StrFmt(GuestSession::tr("Guest file \"%s\" could not be opened: %Rrc"),
     2070                                                       strFileDst.c_str(), rc));
    20712071                        break;
    20722072                }
     
    20742074            else
    20752075            {
    2076                 rc = fileCopyToGuestInner(hVfsFile, dstFile, FileCopyFlag_None, 0 /*cbOffset*/, cbSrcSize);
     2076                rc = fileCopyToGuestInner(strFileSrc, hVfsFile, strFileDst, dstFile,
     2077                                          FileCopyFlag_None, 0 /*cbOffset*/, cbSrcSize);
    20772078
    20782079                int rc2 = dstFile->i_closeFile(&rcGuest);
     
    21242125
    21252126            case VERR_GSTCTL_GUEST_ERROR:
    2126                 setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestProcess::i_guestErrorToString(rcGuest));
     2127                setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Running update file on guest failed"),
     2128                                    GuestErrorInfo(GuestErrorInfo::Type_Process, rcGuest, procInfo.mExecutable.c_str()));
    21272129                break;
    21282130
     
    23882390                        {
    23892391                            case VERR_GSTCTL_GUEST_ERROR:
    2390                                 hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestProcess::i_guestErrorToString(rcGuest));
     2392                                hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR, GuestSession::tr("Creating installation directory on guest failed"),
     2393                                                         GuestErrorInfo(GuestErrorInfo::Type_Directory, rcGuest, strUpdateDir.c_str()));
    23912394                                break;
    23922395
    23932396                            default:
    23942397                                hr = setProgressErrorMsg(VBOX_E_IPRT_ERROR,
    2395                                                          Utf8StrFmt(GuestSession::tr("Error creating installation directory \"%s\" on the guest: %Rrc"),
     2398                                                         Utf8StrFmt(GuestSession::tr("Creating installation directory \"%s\" on guest failed: %Rrc"),
    23962399                                                                    strUpdateDir.c_str(), rc));
    23972400                                break;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette