Changeset 4996 in vbox
- Timestamp:
- Sep 24, 2007 9:31:35 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/module/hgcmcall.c
r4071 r4996 43 43 if (!hgcmR3) 44 44 { 45 elog("IOCTL_VBOXGUEST_HGCM_CALL: cannot allocate memory!\n"); 46 Log(("IOCTL_VBOXGUEST_HGCM_CALL: cannot allocate memory!\n")); 45 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: cannot allocate memory!\n")); 47 46 return -ENOMEM; 48 47 } … … 50 49 if (copy_from_user(hgcmR3, pUser, sizeof(*hgcmR3) + cParms * sizeof(HGCMFunctionParameter))) 51 50 { 52 elog("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n"); 53 Log(("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n")); 51 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n")); 54 52 kfree(hgcmR3); 55 53 return -EFAULT; … … 83 81 if (!hgcmR0) 84 82 { 85 elog("IOCTL_VBOXGUEST_HGCM_CALL: cannot allocate memory!\n"); 86 Log(("IOCTL_VBOXGUEST_HGCM_CALL: cannot allocate memory!\n")); 83 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: cannot allocate memory!\n")); 87 84 return -ENOMEM; 88 85 } … … 105 102 break; 106 103 default: 107 elog("IOCTL_VBOXGUEST_HGCM_CALL: unsupported or unknown parameter type\n"); 108 Log(("IOCTL_VBOXGUEST_HGCM_CALL: unsupported or unknown parameter type\n")); 104 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: unsupported or unknown parameter type\n")); 109 105 kfree(hgcmR0); 110 106 return -EINVAL; … … 115 111 if (pu8PointerData == NULL) 116 112 { 117 elog("IOCTL_VBOXGUEST_HGCM_CALL: out of memory allocating %d bytes for pointer data\n", 118 cbPointerData); 119 Log(("IOCTL_VBOXGUEST_HGCM_CALL: out of memory allocating %d bytes for pointer data\n", 113 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: out of memory allocating %d bytes for pointer data\n", 120 114 cbPointerData)); 121 115 kfree(hgcmR0); … … 140 134 VBOXGUEST_HGCM_CALL_PARMS(hgcmR3)[i].u.Pointer.size)) 141 135 { 142 elog("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n"); 143 Log(("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n")); 136 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n")); 144 137 kfree(hgcmR0); 145 138 kfree(pu8PointerData); … … 175 168 176 169 /** 177 * Dump the contents of an hgcm call info structure to the system log and to the back door logger 178 * if it is active. 170 * Dump the contents of an hgcm call info structure to the back door logger 179 171 * 180 172 * @param hgcmR0 The structure to dump. … … 190 182 { 191 183 case VMMDevHGCMParmType_32bit: 192 elog("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type 32bit: %u\n",193 i, VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.value32);194 184 Log(("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type 32bit: %u\n", 195 185 i, VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.value32)); 196 186 break; 197 187 case VMMDevHGCMParmType_64bit: 198 elog("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type 64bit: %lu\n",199 i, VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.value64);200 188 Log(("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type 64bit: %lu\n", 201 189 i, VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.value64)); 202 190 break; 203 191 case VMMDevHGCMParmType_LinAddr: 204 elog("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type LinAddr, size %u: %.*s...\n",205 i,206 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size > 10 ?207 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size : 10,208 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.u.linearAddr,209 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size);210 192 Log(("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type LinAddr, size %u: %.*s...\n", 211 193 i, … … 216 198 break; 217 199 case VMMDevHGCMParmType_LinAddr_In: 218 elog("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type LinAddr_In, size %u: %.*s...\n",219 i,220 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size > 10 ?221 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size : 10,222 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.u.linearAddr,223 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size);224 200 Log(("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type LinAddr_In, size %u: %.*s...\n", 225 201 i, … … 230 206 break; 231 207 case VMMDevHGCMParmType_LinAddr_Out: 232 elog("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type LinAddr_Out, size %u: %.*s...\n",233 i,234 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size > 10 ?235 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size : 10,236 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.u.linearAddr,237 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size);238 208 Log(("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of type LinAddr_Out, size %u: %.*s...\n", 239 209 i, … … 244 214 break; 245 215 default: 246 elog("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of unknown type!", i);247 216 Log(("IOCTL_VBOXGUEST_HGCM_CALL: parameter %d is of unknown type!", i)); 248 217 } … … 279 248 VBOXGUEST_HGCM_CALL_PARMS(hgcmR0)[i].u.Pointer.size)) 280 249 { 281 elog("IOCTL_VBOXGUEST_HGCM_CALL: copy_to_user failed!\n"); 282 Log(("IOCTL_VBOXGUEST_HGCM_CALL: copy_to_user failed!\n")); 250 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: copy_to_user failed!\n")); 283 251 return -EFAULT; 284 252 } … … 298 266 sizeof(*hgcmR3) + hgcmR3->cParms * sizeof(HGCMFunctionParameter))) 299 267 { 300 elog("IOCTL_VBOXGUEST_HGCM_CALL: copy_to_user failed!\n"); 301 Log(("IOCTL_VBOXGUEST_HGCM_CALL: copy_to_user failed!\n")); 268 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: copy_to_user failed!\n")); 302 269 return -EFAULT; 303 270 } … … 327 294 if (copy_from_user(&callHeader, (void*)arg, sizeof(callHeader))) 328 295 { 329 elog("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n"); 330 Log(("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n")); 296 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: copy_from_user failed!\n")); 331 297 return -EFAULT; 332 298 } … … 352 318 if (VBOX_FAILURE(rc)) 353 319 { 354 elog("IOCTL_VBOXGUEST_HGCM_CALL: internal ioctl call failed, rc=%d\n", rc); 355 Log(("IOCTL_VBOXGUEST_HGCM_CALL: internal ioctl call failed, rc=%d\n", rc)); 356 /** @todo We need a function to convert VBox error codes back to Linux. */ 357 rc = -EINVAL; 320 LogRel(("IOCTL_VBOXGUEST_HGCM_CALL: internal ioctl call failed, rc=%Vrc\n", rc)); 321 rc = -RTErrConvertToErrno(rc); 358 322 } 359 323 else
Note:
See TracChangeset
for help on using the changeset viewer.