HostHardwareLinux.h revision 6c6531128b39093daeac902a8705c0bdf15b31cc
6c6531128b39093daeac902a8705c0bdf15b31ccvboxsync * VirtualBox Main - Classes for handling hardware detection under Linux.
f7b81dcd1a01325f5ca2806c2694b8f1d3b9eb4cvboxsync * Please feel free to expand these to work for other systems (Solaris!) or to
f7b81dcd1a01325f5ca2806c2694b8f1d3b9eb4cvboxsync * add new ones for other systems.
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * Copyright (C) 2008-2009 Oracle Corporation
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * available from http://www.virtualbox.org. This file is free software;
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * you can redistribute it and/or modify it under the terms of the GNU
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * General Public License (GPL) as published by the Free Software
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
b4b896baff58dad1f81179386beed73197bf59bevboxsync * Class for probing and returning information about host DVD and floppy
b4b896baff58dad1f81179386beed73197bf59bevboxsync * drives. To use this class, create an instance, call one of the update
b4b896baff58dad1f81179386beed73197bf59bevboxsync * methods to do the actual probing and use the iterator methods to get the
b4b896baff58dad1f81179386beed73197bf59bevboxsync * result of the probe.
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** Structure describing a host drive */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** The device node of the drive. */
c0704390ccf86cde88ad1e69dedf77d3e57aa15avboxsync /** A unique identifier for the device, if available. This should be
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync * kept consistent across different probing methods of a given
c0704390ccf86cde88ad1e69dedf77d3e57aa15avboxsync * platform if at all possible. */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** A textual description of the drive. */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** Constructors */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** List (resp vector) holding drive information */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * Search for host floppy drives and rebuild the list, which remains empty
b4b896baff58dad1f81179386beed73197bf59bevboxsync * until the first time this method is called.
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * @returns iprt status code
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * Search for host DVD drives and rebuild the list, which remains empty
b4b896baff58dad1f81179386beed73197bf59bevboxsync * until the first time this method is called.
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync * @returns iprt status code
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** Get the first element in the list of floppy drives. */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** Get the last element in the list of floppy drives. */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** Get the first element in the list of DVD drives. */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** Get the last element in the list of DVD drives. */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** The list of currently available floppy drives */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsync /** The list of currently available DVD drives */
b4b896baff58dad1f81179386beed73197bf59bevboxsync/** Convenience typedef. */
f74e35c55b43bdbc2d2ac21d61ac77ab764deadcvboxsynctypedef VBoxMainDriveInfo::DriveInfoList DriveInfoList;
b4b896baff58dad1f81179386beed73197bf59bevboxsync/** Convenience typedef. */
c0704390ccf86cde88ad1e69dedf77d3e57aa15avboxsync/** Implementation of the hotplug waiter class below */
c0704390ccf86cde88ad1e69dedf77d3e57aa15avboxsync /** @copydoc VBoxMainHotplugWaiter::Wait */
c0704390ccf86cde88ad1e69dedf77d3e57aa15avboxsync /** @copydoc VBoxMainHotplugWaiter::Interrupt */
978580e1feeb8eb42df0b6366b9c8bebbb9fb02cvboxsync /** @copydoc VBoxMainHotplugWaiter::getStatus */
b4b896baff58dad1f81179386beed73197bf59bevboxsync * Class for waiting for a hotplug event. To use this class, create an
b4b896baff58dad1f81179386beed73197bf59bevboxsync * instance and call the @a Wait() method, which blocks until an event or a
b4b896baff58dad1f81179386beed73197bf59bevboxsync * user-triggered interruption occurs. Call @a Interrupt() to interrupt the
b4b896baff58dad1f81179386beed73197bf59bevboxsync * wait before an event occurs.
c0704390ccf86cde88ad1e69dedf77d3e57aa15avboxsync /** Class implementation. */
c0704390ccf86cde88ad1e69dedf77d3e57aa15avboxsync /** Constructor. Responsible for selecting the implementation. */
dff7b61dd3fdc4026a02236298516db1d8ac6516vboxsync VBoxMainHotplugWaiter(const char *pcszDevicesRoot);
ebb998c68d059fb28283dd5631df33cbca044519vboxsync /** Destructor. */
ebb998c68d059fb28283dd5631df33cbca044519vboxsync * Wait for a hotplug event.
ebb998c68d059fb28283dd5631df33cbca044519vboxsync * @returns VINF_SUCCESS if an event occurred or if Interrupt() was called.
ebb998c68d059fb28283dd5631df33cbca044519vboxsync * @returns VERR_TRY_AGAIN if the wait failed but this might (!) be a
ebb998c68d059fb28283dd5631df33cbca044519vboxsync * temporary failure.
ebb998c68d059fb28283dd5631df33cbca044519vboxsync * @returns VERR_NOT_SUPPORTED if the wait failed and will definitely not
ebb998c68d059fb28283dd5631df33cbca044519vboxsync * succeed if retried.
ebb998c68d059fb28283dd5631df33cbca044519vboxsync * @returns Possibly other iprt status codes otherwise.
18456bfb9f30d08e5347aa108a2fef0c49c0ab0bvboxsync * @param cMillies How long to wait for at most.
b4b896baff58dad1f81179386beed73197bf59bevboxsync * Interrupts an active wait. In the current implementation, the wait
b4b896baff58dad1f81179386beed73197bf59bevboxsync * may not return until up to two seconds after calling this method.
978580e1feeb8eb42df0b6366b9c8bebbb9fb02cvboxsync return mImpl ? mImpl->getStatus() : VERR_NO_MEMORY;
ebb998c68d059fb28283dd5631df33cbca044519vboxsync#endif /* ____H_HOSTHARDWARELINUX */
5e3a885d489b1c99d79d576813f8f321bae46927vboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */