Changeset 54970 in vbox
- Timestamp:
- Mar 26, 2015 3:57:35 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
include/iprt/err.h (modified) (1 diff)
-
src/VBox/Runtime/r3/linux/fileaio-linux.cpp (modified) (2 diffs)
-
src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp (modified) (5 diffs)
-
src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/err.h
r54408 r54970 1017 1017 /** Not all requests could be submitted due to resource shortage. */ 1018 1018 #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) 1019 1022 /** Device or resource is busy. */ 1020 #define VERR_RESOURCE_BUSY (-13 8)1023 #define VERR_RESOURCE_BUSY (-139) 1021 1024 /** A file operation was attempted on a non-file object. */ 1022 #define VERR_NOT_A_FILE (-1 39)1025 #define VERR_NOT_A_FILE (-140) 1023 1026 /** A non-file operation was attempted on a file object. */ 1024 #define VERR_IS_A_FILE (-14 0)1027 #define VERR_IS_A_FILE (-141) 1025 1028 /** Unexpected filesystem object type. */ 1026 #define VERR_UNEXPECTED_FS_OBJ_TYPE (-14 1)1029 #define VERR_UNEXPECTED_FS_OBJ_TYPE (-142) 1027 1030 /** A path does not start with a root specification. */ 1028 #define VERR_PATH_DOES_NOT_START_WITH_ROOT (-14 2)1031 #define VERR_PATH_DOES_NOT_START_WITH_ROOT (-143) 1029 1032 /** A path is relative, expected an absolute path. */ 1030 #define VERR_PATH_IS_RELATIVE (-14 3)1033 #define VERR_PATH_IS_RELATIVE (-144) 1031 1034 /** A path is not relative (start with root), expected an relative path. */ 1032 #define VERR_PATH_IS_NOT_RELATIVE (-14 4)1035 #define VERR_PATH_IS_NOT_RELATIVE (-145) 1033 1036 /** Zero length path. */ 1034 #define VERR_PATH_ZERO_LENGTH (-14 5)1037 #define VERR_PATH_ZERO_LENGTH (-146) 1035 1038 /** @} */ 1036 1039 -
trunk/src/VBox/Runtime/r3/linux/fileaio-linux.cpp
r45678 r54970 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 231 231 int rc = syscall(__NR_io_setup, cEvents, pAioContext); 232 232 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 } 234 239 235 240 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
r54965 r54970 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 590 590 } 591 591 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 610 592 #ifdef VBOX_WITH_DEBUGGER 611 593 … … 964 946 uint64_t cbSize; 965 947 966 rc = pdmacFileEpNativeGetSize(hFile, &cbSize);948 rc = RTFileGetSize(hFile, &cbSize); 967 949 968 950 if (RT_SUCCESS(rc) && ((cbSize % 512) == 0)) … … 1022 1004 pEpFile->fFlags = fFileFlags; 1023 1005 1024 rc = pdmacFileEpNativeGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile);1006 rc = RTFileGetSize(pEpFile->hFile, (uint64_t *)&pEpFile->cbFile); 1025 1007 if (RT_SUCCESS(rc)) 1026 1008 { … … 1084 1066 } 1085 1067 } 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")); 1086 1088 } 1087 1089 } -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp
r45678 r54970 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 33 33 #define PDMACEPFILEMGR_LOAD_UPDATE_PERIOD 1000 34 34 /** Maximum number of requests a manager will handle. */ 35 #define PDMACEPFILEMGR_REQS_STEP 51235 #define PDMACEPFILEMGR_REQS_STEP 64 36 36 37 37
Note:
See TracChangeset
for help on using the changeset viewer.

