VirtualBox

Ignore:
Timestamp:
Sep 17, 2007 3:45:24 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
24579
Message:

Activated the full backdoor logger in release builds of the Linux Guest Additions kernel modules

Location:
trunk/src/VBox/Additions/linux/sharedfolders
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/sharedfolders/dirops.c

    r4822 r4860  
    4242
    4343        if (!sf_d) {
    44                 LogRelPrintFunc("could not allocate directory info for");
    45                 LogRelPrint(sf_i->path->String.utf8);
    46                 LogRelPrint("\n");
     44                LogRelFunc(("could not allocate directory info for %s\n",
     45                            sf_i->path->String.utf8));
    4746                return -ENOMEM;
    4847        }
     
    211210                fake_ino = sanity;
    212211                if (sanity - fake_ino) {
    213                         LogRelPrintFunc("can not compute ino\n");
     212                        LogRelFunc(("can not compute ino\n"));
    214213                        return -EINVAL;
    215214                }
     
    286285                sf_new_i = kmalloc (sizeof (*sf_new_i), GFP_KERNEL);
    287286                if (!sf_new_i) {
    288                         LogRelPrintFunc("could not allocate memory for new inode info\n");
     287                        LogRelFunc(("could not allocate memory for new inode info\n"));
    289288                        err = -ENOMEM;
    290289                        goto fail1;
     
    337336        sf_new_i = kmalloc (sizeof (*sf_new_i), GFP_KERNEL);
    338337        if (!sf_new_i) {
    339                 LogRelPrintFunc("could not allocate inode info.  caller=");
    340                 LogRelPrint(caller);
    341                 LogRelPrint("\n");
     338                LogRelFunc(("could not allocate inode info.  caller=%s\n", caller));
    342339                err = -ENOMEM;
    343340                goto fail0;
  • trunk/src/VBox/Additions/linux/sharedfolders/regops.c

    r4743 r4860  
    6565        tmp = kmalloc (CHUNK_SIZE, GFP_KERNEL);
    6666        if (!tmp) {
    67                 LogRelPrintFunc("could not allocate bounce buffer memory ");
    68                 LogRelPrintQuote(CHUNK_SIZE);
    69                 LogRelPrint(" bytes\n");
     67                LogRelFunc(("could not allocate bounce buffer memory %d bytes\n", CHUNK_SIZE));
    7068                return -ENOMEM;
    7169        }
     
    137135        tmp = kmalloc (CHUNK_SIZE, GFP_KERNEL);
    138136        if (!tmp) {
    139                 LogRelPrintFunc("could not allocate bounce buffer memory ");
    140                 LogRelPrintQuote(CHUNK_SIZE);
    141                 LogRelPrint("bytes\n");
     137                LogRelFunc(("could not allocate bounce buffer memory %d\n", CHUNK_SIZE));
    142138                return -ENOMEM;
    143139        }
     
    205201        sf_r = kmalloc (sizeof (*sf_r), GFP_KERNEL);
    206202        if (!sf_r) {
    207                 LogRelPrintFunc("could not allocate reg info\n");
     203                LogRelFunc(("could not allocate reg info\n"));
    208204                return -ENOMEM;
    209205        }
     
    223219                /* We ignore O_EXCL, as the Linux kernel seems to call create
    224220                   beforehand itself, so O_EXCL should always fail. */
    225 //                if (file->f_flags & O_EXCL) {
    226 //                        LogFunc(("O_EXCL set\n"));
    227 //                        params.CreateFlags |= SHFL_CF_ACT_FAIL_IF_EXISTS;
    228 //                }
    229 //                else {
    230                         /* O_TRUNC combined with O_EXCL is undefined. */
    231                         if (file->f_flags & O_TRUNC) {
    232                                 LogFunc(("O_TRUNC set\n"));
    233                                 params.CreateFlags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS;
    234                         }
    235                         else {
    236                                 params.CreateFlags |= SHFL_CF_ACT_OPEN_IF_EXISTS;
    237                         }
    238 //                }
     221                if (file->f_flags & O_TRUNC) {
     222                        LogFunc(("O_TRUNC set\n"));
     223                        params.CreateFlags |= SHFL_CF_ACT_OVERWRITE_IF_EXISTS;
     224                }
     225                else {
     226                        params.CreateFlags |= SHFL_CF_ACT_OPEN_IF_EXISTS;
     227                }
    239228        }
    240229        else {
     
    248237        if (!(params.CreateFlags & SHFL_CF_ACCESS_READWRITE)) {
    249238                switch (file->f_flags & O_ACCMODE) {
    250                         case O_RDONLY:
    251                                 params.CreateFlags |= SHFL_CF_ACCESS_READ;
    252                                 break;
    253 
    254                         case O_WRONLY:
    255                                 params.CreateFlags |= SHFL_CF_ACCESS_WRITE;
    256                                 break;
    257 
    258                         case O_RDWR:
    259                                 params.CreateFlags |= SHFL_CF_ACCESS_READWRITE;
    260                                 break;
    261 
    262                         default:
    263                                 BUG ();
     239                case O_RDONLY:
     240                        params.CreateFlags |= SHFL_CF_ACCESS_READ;
     241                        break;
     242
     243                case O_WRONLY:
     244                        params.CreateFlags |= SHFL_CF_ACCESS_WRITE;
     245                        break;
     246
     247                case O_RDWR:
     248                        params.CreateFlags |= SHFL_CF_ACCESS_READWRITE;
     249                        break;
     250
     251                default:
     252                        BUG ();
    264253                }
    265254        }
     
    273262                         file->f_flags, params.CreateFlags, rc));
    274263                kfree (sf_r);
    275                 return -EPROTO;
     264                return -RTErrConvertToErrno(rc);
    276265        }
    277266
     
    347336        page = alloc_page (GFP_HIGHUSER);
    348337        if (!page) {
    349                 LogRelPrintFunc("failed to allocate page\n");
     338                LogRelFunc(("failed to allocate page\n"));
    350339                SET_TYPE (VM_FAULT_OOM);
    351340                return NOPAGE_OOM;
  • trunk/src/VBox/Additions/linux/sharedfolders/utils.c

    r4822 r4860  
    251251        tmp = kmalloc (shflstring_len, GFP_KERNEL);
    252252        if (!tmp) {
    253                 LogRelPrintFunc("kmalloc failed, caller=");
    254                 LogRelPrint(caller);
     253                LogRelFunc(("kmalloc failed, caller=%s\n", caller));
    255254                return -ENOMEM;
    256255        }
     
    419418        b = kmalloc (sizeof (*b), GFP_KERNEL);
    420419        if (!b) {
    421                 LogRelPrintFunc("could not alloc directory buffer\n");
     420                LogRelFunc(("could not alloc directory buffer\n"));
    422421                return NULL;
    423422        }
     
    430429        if (!b->buf) {
    431430                kfree (b);
    432                 LogRelPrintFunc("could not alloc directory buffer storage\n");
     431                LogRelFunc(("could not alloc directory buffer storage\n"));
    433432                return NULL;
    434433        }
     
    480479        p = kmalloc (sizeof (*p), GFP_KERNEL);
    481480        if (!p) {
    482                 LogRelPrintFunc("could not alloc directory info\n");
     481                LogRelFunc(("could not alloc directory info\n"));
    483482                return NULL;
    484483        }
     
    536535                        if (!b) {
    537536                                err = -ENOMEM;
    538                                 LogRelPrintFunc("could not alloc directory buffer\n");
     537                                LogRelFunc(("could not alloc directory buffer\n"));
    539538                                goto fail1;
    540539                        }
  • trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.c

    r4743 r4860  
    7373        if (!sf_g) {
    7474                err = -ENOMEM;
    75                 LogRelPrintFunc("could not allocate memory for global info\n");
     75                LogRelFunc(("could not allocate memory for global info\n"));
    7676                goto fail0;
    7777        }
     
    9191        if (!str_name) {
    9292                err = -ENOMEM;
    93                 LogRelPrintFunc("could not allocate memory for host name\n");
     93                LogRelFunc(("could not allocate memory for host name\n"));
    9494                goto fail1;
    9595        }
     
    196196        if (!sf_i) {
    197197                err = -ENOMEM;
    198                 LogRelPrintFunc ("could not allocate memory for root inode info\n");
     198                LogRelFunc (("could not allocate memory for root inode info\n"));
    199199                goto fail1;
    200200        }
     
    203203        if (!sf_i->path) {
    204204                err = -ENOMEM;
    205                 LogRelPrintFunc ("could not allocate memory for root inode path\n");
     205                LogRelFunc (("could not allocate memory for root inode path\n"));
    206206                goto fail2;
    207207        }
     
    418418        rc = vboxInit ();
    419419        if (VBOX_FAILURE (rc)) {
    420                 LogRelPrintFunc ("vboxInit failed\n");
    421                 Log (("rc=%d\n", rc));
     420                LogRelFunc (("vboxInit failed, rc=%d\n", rc));
    422421                goto fail0;
    423422        }
     
    425424        rc = vboxConnect (&client_handle);
    426425        if (VBOX_FAILURE (rc)) {
    427                 LogRelPrintFunc ("vboxConnect failed\n");
    428                 Log (("rc=%d\n", rc));
     426                LogRelFunc (("vboxConnect failed, rc=%d\n", rc));
    429427                goto fail1;
    430428        }
     
    432430        rc = vboxCallSetUtf8 (&client_handle);
    433431        if (VBOX_FAILURE (rc)) {
    434                 LogRelPrintFunc ("vboxCallSetUtf8 failed\n");
    435                 Log (("rc=%d\n", rc));
     432                LogRelFunc (("vboxCallSetUtf8 failed, rc=%d\n", rc));
    436433                goto fail2;
    437434        }
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