VBoxManageList.cpp revision 07bf154df97af02974bb89d4f1ad36afa2b45443
/* $Id$ */
/** @file
* VBoxManage - The 'list' command.
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef VBOX_ONLY_DOCS
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "VBoxManage.h"
using namespace com;
#ifdef VBOX_WITH_HOSTNETIF_API
{
switch (enmType)
{
case HostNetworkInterfaceType_Ethernet: return "Ethernet";
case HostNetworkInterfaceType_PPP: return "PPP";
case HostNetworkInterfaceType_SLIP: return "SLIP";
}
return "Unknown";
}
{
switch (enmStatus)
{
case HostNetworkInterfaceStatus_Up: return "Up";
case HostNetworkInterfaceStatus_Down: return "Down";
}
return "Unknown";
}
#endif
int handleList(HandlerArg *a)
{
/* exactly one option: the object */
if (a->argc != 1)
/* which object? */
{
/*
* Get the list of all registered VMs
*/
{
/*
* Iterate through the collection
*/
{
if (machines [i])
}
}
}
else
{
/*
* Get the list of all _running_ VMs
*/
{
/*
* Iterate through the collection
*/
{
if (machines [i])
{
{
switch (machineState)
{
case MachineState_Running:
case MachineState_Paused:
{
break;
}
}
}
}
}
}
}
else
{
{
{
}
}
}
else
{
{
{
}
}
}
else
{
{
{
}
}
}
else
{
{
#ifndef VBOX_WITH_HOSTNETIF_API
#else /* VBOX_WITH_HOSTNETIF_API */
RTPrintf("IPAddress: %d.%d.%d.%d\n",
RTPrintf("NetworkMask: %d.%d.%d.%d\n",
((uint8_t*)&NetworkMask)[0],
#endif
}
}
else
{
RTPrintf("Host Information:\n\n");
char pszTime[30] = {0};
ULONG processorCount = 0;
ULONG processorSpeed = 0;
for (ULONG i = 0; i < processorCount; i++)
{
if (processorSpeed)
else
#if 0 /* not yet implemented in Main */
#endif
}
#if 0 /* not yet implemented in Main */
ULONG memorySize = 0;
ULONG memoryAvailable = 0;
#endif
}
else
{
RTPrintf("Supported hard disk backends:\n\n");
{
/* General information */
RTPrintf("Backend %u: id='%ls' description='%ls' capabilities=%#06x extensions='",
/* File extensions */
{
RTPrintf (",");
}
RTPrintf ("'");
/* Configuration keys */
RTPrintf (" properties=(");
if (propertyNames.size() > 0)
{
{
RTPrintf ("\n name='%ls' desc='%ls' type=",
switch (propertyTypes [a])
{
}
RTPrintf (", ");
}
}
RTPrintf (")\n");
}
}
else
{
{
/// @todo NEWMEDIA check accessibility of all parents
/// @todo NEWMEDIA print the full state value
{
RTPrintf("%s%lS (UUID: %RTuuid)\n",
j == 0 ? "Usage: " : " ",
}
/// @todo NEWMEDIA check usage in snapshots too
/// @todo NEWMEDIA also list children and say 'differencing' for
/// hard disks with the parent or 'base' otherwise.
RTPrintf("\n");
}
}
else
{
{
/** @todo usage */
RTPrintf("\n");
}
}
else
{
{
/** @todo usage */
RTPrintf("\n");
}
}
else
{
RTPrintf("Host USB Devices:\n\n");
return rc;
if (!fMore)
{
RTPrintf("<none>\n\n");
}
else
while (fMore)
{
return rc;
/* Query info. */
RTPrintf("UUID: %S\n"
"VendorId: 0x%04x (%04X)\n"
"ProductId: 0x%04x (%04X)\n"
"Revision: %u.%u (%02u%02u)\n",
/* optional stuff. */
/* current state */
const char *pszState = "?";
switch (state)
{
pszState = "Not supported"; break;
pszState = "Unavailable"; break;
case USBDeviceState_Busy:
pszState = "Busy"; break;
case USBDeviceState_Available:
pszState = "Available"; break;
case USBDeviceState_Held:
pszState = "Held"; break;
case USBDeviceState_Captured:
pszState = "Captured"; break;
default:
ASSERT (false);
break;
}
return rc;
}
}
else
{
RTPrintf("Global USB Device Filters:\n\n");
return rc;
if (!more)
{
RTPrintf("<none>\n\n");
}
else
while (more)
{
return rc;
/* Query info. */
const char *pszAction = "<invalid>";
switch (action)
{
pszAction = "Ignore";
break;
pszAction = "Hold";
break;
default:
break;
}
return rc;
index ++;
}
}
{
}
else
}
#endif /* !VBOX_ONLY_DOCS */