VirtualBox

Changeset 44970 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 11, 2013 9:59:05 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
84190
Message:

Main/VirtualBoxClient: add method to perform VM error checking which simplifies client code
com/ErrorInfo: small bugfix (the object where the error information originated was always lost), added a way to inject whole error object structures which needed the bugfix
Frontends/VBoxSDL: sample code how to use the new method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r44528 r44970  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    14461446        else
    14471447        {
    1448             RTPrintf("Error: machine with the given ID not found!\n");
     1448            RTPrintf("Error: machine with the given name not found!\n");
     1449            RTPrintf("Check if this VM has been corrupted and is now inaccessible.");
    14491450            goto leave;
    14501451        }
     
    14541455    vrc = RTSemEventCreate(&g_EventSemSDLEvents);
    14551456    AssertReleaseRC(vrc);
     1457
     1458    rc = pVirtualBoxClient->CheckMachineError(pMachine);
     1459    if (FAILED(rc))
     1460    {
     1461        com::ErrorInfo info;
     1462        if (info.isFullAvailable())
     1463            PrintError("The VM has errors",
     1464                       info.getText().raw(), info.getComponent().raw());
     1465        else
     1466            RTPrintf("Failed to check for VM errors! No error information available (rc=%Rhrc).\n", rc);
     1467        goto leave;
     1468    }
    14561469
    14571470    rc = pMachine->LockMachine(pSession, LockType_VM);
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