VirtualBox

Changeset 5895 in vbox


Ignore:
Timestamp:
Nov 30, 2007 3:36:56 PM (17 years ago)
Author:
vboxsync
Message:

Implement commands to load and unload the driver

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp

    r5204 r5895  
    4040
    4141#include <VBox/VBoxHDD.h>
     42#include <VBox/sup.h>
    4243
    4344#include "VBoxManage.h"
     
    6263             "Commands:\n"
    6364             "\n"
    64              "%s%s%s%s%s"
     65             "%s%s%s%s%s%s%s"
    6566             "WARNING: This is a development tool and shall only be used to analyse\n"
    6667             "         problems. It is completely unsupported and will change in\n"
     
    105106                "       The necessary partition numbers can be queried with\n"
    106107                "         VBoxManage internalcommands listpartitions\n"
     108                "\n"
     109                : "",
     110            (u64Cmd & USAGE_MODINSTALL) ?
     111                "  modinstall\n"
     112                "       Installs the neccessary driver for the host OS\n"
     113                "\n"
     114                : "",
     115            (u64Cmd & USAGE_MODUNINSTALL) ?
     116                "  moduninstall\n"
     117                "       Deinstalls the driver\n"
    107118                "\n"
    108119                : ""
     
    395406
    396407/**
     408 * Unloads the neccessary driver.
     409 *
     410 * @returns VBox status code
     411 */
     412int CmdModUninstall(void)
     413{
     414    int rc = SUPUninstall();
     415
     416    rc = SUPInstall();
     417    if (VBOX_SUCCESS(rc))
     418        return 0;
     419    else if (rc == VERR_NOT_IMPLEMENTED)
     420        return 0;
     421    else
     422        return E_FAIL;
     423}
     424
     425/**
     426 * Loads the neccessary driver.
     427 *
     428 * @returns VBox status code
     429 */
     430int CmdModInstall(void)
     431{
     432    int rc = SUPInstall();
     433
     434    rc = SUPInstall();
     435    if (VBOX_SUCCESS(rc))
     436        return 0;
     437    else if (rc == VERR_NOT_IMPLEMENTED)
     438        return 0;
     439    else
     440        return E_FAIL;
     441}
     442
     443/**
    397444 * Wrapper for handling internal commands
    398445 */
     
    423470#endif /* !VBOX_OSE */
    424471
     472    if (!strcmp(pszCmd, "modinstall"))
     473        return CmdModInstall();
     474    if (!strcmp(pszCmd, "moduninstall"))
     475        return CmdModUninstall();
     476
    425477    /* default: */
    426478    return errorSyntax(USAGE_ALL, "Invalid command '%s'", Utf8Str(argv[0]).raw());
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r5605 r5895  
    6969#define USAGE_VM_STATISTICS         RT_BIT_64(35)
    7070#define USAGE_ADOPTSTATE            RT_BIT_64(36)
     71#define USAGE_MODINSTALL            RT_BIT_64(37)
     72#define USAGE_MODUNINSTALL          RT_BIT_64(38)
    7173#define USAGE_ALL                   (~(uint64_t)0)
    7274/** @} */
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