VirtualBox

Changeset 6834 in vbox for trunk/include


Ignore:
Timestamp:
Feb 6, 2008 7:57:32 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27953
Message:

Added VM_ASSERT_STATE[_RETURN].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vm.h

    r6819 r6834  
    205205#endif
    206206
    207 
    208207/** @def VM_ASSERT_EMT_RETURN
    209208 * Asserts that the current thread IS the emulation thread (EMT) and returns if it isn't.
     
    220219#endif
    221220
    222 
    223221/**
    224222 * Asserts that the current thread is NOT the emulation thread.
     
    226224#define VM_ASSERT_OTHER_THREAD(pVM) \
    227225    AssertMsg(!VM_IS_EMT(pVM), ("Not other thread!!\n"))
     226
     227
     228/** @def VM_ASSERT_STATE_RETURN
     229 * Asserts a certain VM state.
     230 */
     231#define VM_ASSERT_STATE(pVM, _enmState) \
     232        AssertMsg((pVM)->enmVMState == (_enmState), \
     233                  ("state %s, expected %s\n", VMGetStateName(pVM->enmVMState), VMGetStateName(_enmState)))
     234
     235/** @def VM_ASSERT_STATE_RETURN
     236 * Asserts a certain VM state and returns if it doesn't match.
     237 */
     238#define VM_ASSERT_STATE_RETURN(pVM, _enmState, rc) \
     239        AssertMsgReturn((pVM)->enmVMState == (_enmState), \
     240                        ("state %s, expected %s\n", VMGetStateName(pVM->enmVMState), VMGetStateName(_enmState)), \
     241                        (rc))
     242
    228243
    229244
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