VirtualBox

Changeset 54970 in vbox


Ignore:
Timestamp:
Mar 26, 2015 3:57:35 PM (10 years ago)
Author:
vboxsync
Message:

AsyncCompletion: Better error message if I/O manager could not be created due to insufficient host limits

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/err.h

    r54408 r54970  
    10171017/** Not all requests could be submitted due to resource shortage. */
    10181018#define VERR_FILE_AIO_INSUFFICIENT_RESSOURCES (-137)
     1019/** There are not enough events available on the host to create the I/O context.
     1020 * This exact meaning is host platform dependent. */
     1021#define VERR_FILE_AIO_INSUFFICIENT_EVENTS   (-138)
    10191022/** Device or resource is busy. */
    1020 #define VERR_RESOURCE_BUSY                  (-138)
     1023#define VERR_RESOURCE_BUSY                  (-139)
    10211024/** A file operation was attempted on a non-file object. */
    1022 #define VERR_NOT_A_FILE                     (-139)
     1025#define VERR_NOT_A_FILE                     (-140)
    10231026/** A non-file operation was attempted on a file object. */
    1024 #define VERR_IS_A_FILE                      (-140)
     1027#define VERR_IS_A_FILE                      (-141)
    10251028/** Unexpected filesystem object type. */
    1026 #define VERR_UNEXPECTED_FS_OBJ_TYPE         (-141)
     1029#define VERR_UNEXPECTED_FS_OBJ_TYPE         (-142)
    10271030/** A path does not start with a root specification. */
    1028 #define VERR_PATH_DOES_NOT_START_WITH_ROOT  (-142)
     1031#define VERR_PATH_DOES_NOT_START_WITH_ROOT  (-143)
    10291032/** A path is relative, expected an absolute path. */
    1030 #define VERR_PATH_IS_RELATIVE               (-143)
     1033#define VERR_PATH_IS_RELATIVE               (-144)
    10311034/** A path is not relative (start with root), expected an relative path. */
    1032 #define VERR_PATH_IS_NOT_RELATIVE           (-144)
     1035#define VERR_PATH_IS_NOT_RELATIVE           (-145)
    10331036/** Zero length path. */
    1034 #define VERR_PATH_ZERO_LENGTH               (-145)
     1037#define VERR_PATH_ZERO_LENGTH               (-146)
    10351038/** @} */
    10361039
  • trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp

    r45678 r54970  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    231231    int rc = syscall(__NR_io_setup, cEvents, pAioContext);
    232232    if (RT_UNLIKELY(rc == -1))
    233         return RTErrConvertFromErrno(errno);
     233    {
     234        if (errno == EAGAIN)
     235            return VERR_FILE_AIO_INSUFFICIENT_EVENTS;
     236        else
     237            return RTErrConvertFromErrno(errno);
     238    }
    234239
    235240    return VINF_SUCCESS;
  • trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp

    r54965 r54970  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    590590}
    591591
    592 /**
    593  * Get the size of the given file.
    594  * Works for block devices too.
    595  *
    596  * @returns VBox status code.
    597  * @param   hFile    The file handle.
    598  * @param   pcbSize  Where to store the size of the file on success.
    599  */
    600 static int pdmacFileEpNativeGetSize(RTFILE hFile, uint64_t *pcbSize)
    601 {
    602     uint64_t cbFile;
    603     int rc = RTFileGetSize(hFile, &cbFile);
    604     if (RT_SUCCESS(rc))
    605         *pcbSize = cbFile;
    606 
    607     return rc;
    608 }
    609 
    610592#ifdef VBOX_WITH_DEBUGGER
    611593
     
    964946            uint64_t cbSize;
    965947
    966             rc = pdmacFileEpNativeGetSize(hFile, &cbSize);
     948            rc = RTFileGetSize(hFile, &cbSize);
    967949
    968950            if (RT_SUCCESS(rc) && ((cbSize % 512) == 0))
     
    10221004        pEpFile->fFlags = fFileFlags;
    10231005
    1024         rc = pdmacFileEpNativeGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile);
     1006        rc = RTFileGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile);
    10251007        if (RT_SUCCESS(rc))
    10261008        {
     
    10841066                        }
    10851067                    }
     1068                }
     1069                else if (rc == VERR_FILE_AIO_INSUFFICIENT_EVENTS)
     1070                {
     1071                    PUVM pUVM = VMR3GetUVM(pEpClassFile->Core.pVM);
     1072#if defined(RT_OS_LINUX)
     1073                    rc = VMR3SetError(pUVM, rc, RT_SRC_POS,
     1074                                      N_("Failed to create I/O manager for VM due to insufficient resources on the host. "
     1075                                         "Either increase the amount of allowed events in /proc/sys/fs/aio-max-nr or enable "
     1076                                         "the host I/O cache"));
     1077#else
     1078                    rc = VMR3SetError(pUVM, rc, RT_SRC_POS,
     1079                                      N_("Failed to create I/O manager for VM due to insufficient resources on the host. "
     1080                                         "Enable the host I/O cache"));
     1081#endif
     1082                }
     1083                else
     1084                {
     1085                    PUVM pUVM = VMR3GetUVM(pEpClassFile->Core.pVM);
     1086                    rc = VMR3SetError(pUVM, rc, RT_SRC_POS,
     1087                                      N_("Failed to create I/O manager for VM due to an unknown error"));
    10861088                }
    10871089            }
  • trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp

    r45678 r54970  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3333#define PDMACEPFILEMGR_LOAD_UPDATE_PERIOD   1000
    3434/** Maximum number of requests a manager will handle. */
    35 #define PDMACEPFILEMGR_REQS_STEP            512
     35#define PDMACEPFILEMGR_REQS_STEP              64
    3636
    3737
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