Changeset 15468 in vbox
- Timestamp:
- Dec 14, 2008 3:54:21 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40922
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/HostHardwareLinux.h
r15465 r15468 36 36 37 37 /** 38 * Class for probing and returning information about host DVD and floppy drives 38 * Class for probing and returning information about host DVD and floppy 39 * drives. To use this class, create an instance, call one of the update 40 * methods to do the actual probing and use the iterator methods to get the 41 * result of the probe. 39 42 */ 40 43 class VBoxMainDriveInfo … … 69 72 /** 70 73 * Search for host floppy drives and rebuild the list, which remains empty 71 * until the first time itis called.74 * until the first time this method is called. 72 75 * @returns iprt status code 73 76 */ … … 76 79 /** 77 80 * Search for host DVD drives and rebuild the list, which remains empty 78 * until the first time itis called.81 * until the first time this method is called. 79 82 * @returns iprt status code 80 83 */ … … 111 114 }; 112 115 116 /** Convenience typedef. */ 113 117 typedef VBoxMainDriveInfo::DriveInfoList DriveInfoList; 118 /** Convenience typedef. */ 114 119 typedef VBoxMainDriveInfo::DriveInfo DriveInfo; 115 120 116 121 /** 117 * Class for probing and returning information about host USB devices 122 * Class for probing and returning information about host USB devices. 123 * To use this class, create an instance, call the update methods to do the 124 * actual probing and use the iterator methods to get the result of the probe. 118 125 */ 119 126 class VBoxMainUSBDeviceInfo … … 143 150 /** 144 151 * Search for host USB devices and rebuild the list, which remains empty 145 * until the first time itis called.152 * until the first time this method is called. 146 153 * @returns iprt status code 147 154 */ … … 165 172 }; 166 173 174 /** Convenience typedef. */ 167 175 typedef VBoxMainUSBDeviceInfo::DeviceInfoList USBDeviceInfoList; 176 /** Convenience typedef. */ 168 177 typedef VBoxMainUSBDeviceInfo::USBDeviceInfo USBDeviceInfo; 178 /** Convenience typedef. */ 169 179 typedef VBoxMainUSBDeviceInfo::USBDeviceInfo::InterfaceList USBInterfaceList; 170 180 181 /** 182 * Class for waiting for a hotplug event. To use this class, create an 183 * instance and call the @a Wait() method, which blocks until an event or a 184 * user-triggered interruption occurs. Call @a Interrupt() to interrupt the 185 * wait before an event occurs. 186 */ 171 187 class VBoxMainHotplugWaiter 172 188 { … … 193 209 */ 194 210 int Wait (unsigned cMillies); 195 /** Interrupts an active wait. */ 211 /** 212 * Interrupts an active wait. In the current implementation, the wait 213 * may not return until up to two seconds after calling this method. 214 */ 196 215 void Interrupt (void); 197 216 }; -
trunk/src/VBox/Main/include/vbox-dbus.h
r15465 r15468 35 35 const char *name; 36 36 const char *message; 37 unsigned int dummy1 : 1; /**< placeholder */38 unsigned int dummy2 : 1; /**< placeholder */39 unsigned int dummy3 : 1; /**< placeholder */40 unsigned int dummy4 : 1; /**< placeholder */41 unsigned int dummy5 : 1; /**< placeholder */42 void *padding1; /**< placeholder */37 unsigned int dummy1 : 1; 38 unsigned int dummy2 : 1; 39 unsigned int dummy3 : 1; 40 unsigned int dummy4 : 1; 41 unsigned int dummy5 : 1; 42 void *padding1; 43 43 }; 44 44 struct DBusConnection; … … 51 51 struct DBusMessageIter 52 52 { 53 void *dummy1; /**< Don't use this */54 void *dummy2; /**< Don't use this */55 dbus_uint32_t dummy3; /**< Don't use this */56 int dummy4; /**< Don't use this */57 int dummy5; /**< Don't use this */58 int dummy6; /**< Don't use this */59 int dummy7; /**< Don't use this */60 int dummy8; /**< Don't use this */61 int dummy9; /**< Don't use this */62 int dummy10; /**< Don't use this */63 int dummy11; /**< Don't use this */64 int pad1; /**< Don't use this */65 int pad2; /**< Don't use this */66 void *pad3; /**< Don't use this */53 void *dummy1; 54 void *dummy2; 55 dbus_uint32_t dummy3; 56 int dummy4; 57 int dummy5; 58 int dummy6; 59 int dummy7; 60 int dummy8; 61 int dummy9; 62 int dummy10; 63 int dummy11; 64 int pad1; 65 int pad2; 66 void *pad3; 67 67 }; 68 68 typedef struct DBusMessageIter DBusMessageIter; … … 75 75 typedef enum 76 76 { 77 DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need 78 to run more handlers. */ 79 DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see 80 if other handlers want it. */ 81 DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return 82 #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try 83 again later with more memory. */ 77 DBUS_HANDLER_RESULT_HANDLED, 78 DBUS_HANDLER_RESULT_NOT_YET_HANDLED, 79 DBUS_HANDLER_RESULT_NEED_MEMORY 84 80 } DBusHandlerResult; 85 81 … … 123 119 extern DBusMessage *(*dbus_connection_pop_message)(DBusConnection *); 124 120 121 /** 122 * Checks whether libdbus is present and if so loads all symbols we need. This 123 * should be called before making any calls to libdbus if that library is being 124 * loaded at runtime. 125 * @returns true if libdbus was found, false otherwise. 126 */ 125 127 extern bool VBoxDBusCheckPresence(void); 128 /** Wrapper around dbus_connection_unref. We need this to use it as a free 129 * function in auto pointers, as a function pointer won't wash here. */ 126 130 extern void VBoxDBusConnectionUnref(DBusConnection *pConnection); 131 /** Wrapper around dbus_message_unref. We need this to use it as a free 132 * function in auto pointers, as a function pointer won't wash here. */ 127 133 extern void VBoxDBusMessageUnref(DBusMessage *pMessage); 128 134 -
trunk/src/VBox/Main/linux/HostHardwareLinux.cpp
r15465 r15468 65 65 *******************************************************************************/ 66 66 67 /** When waiting for hotplug events, we currently restart the wait after at 68 * most this many milliseconds. */ 67 69 enum { DBUS_POLL_TIMEOUT = 2000 /* ms */ }; 68 70 … … 73 75 static int getDVDInfoFromMTab(char *mountTable, DriveInfoList *pList); 74 76 #ifdef VBOX_WITH_DBUS 75 /* These must be extern to be us edin the RTMemAutoPtr template */77 /* These must be extern to be usable in the RTMemAutoPtr template */ 76 78 extern void halShutdown (DBusConnection *pConnection); 77 79 extern void halShutdownPrivate (DBusConnection *pConnection); … … 95 97 #endif /* VBOX_WITH_DBUS */ 96 98 97 /**98 * Updates the list of host DVD drives.99 *100 * @returns iprt status code101 */102 99 int VBoxMainDriveInfo::updateDVDs () 103 100 { … … 145 142 } 146 143 147 /**148 * Updates the list of host floppy drives.149 *150 * @returns iprt status code151 */152 144 int VBoxMainDriveInfo::updateFloppies () 153 145 { … … 192 184 } 193 185 194 /**195 * Updates the list of host USB devices.196 *197 * @returns iprt status code198 */199 186 int VBoxMainUSBDeviceInfo::UpdateDevices () 200 187 { … … 233 220 }; 234 221 235 /** Constructor */ 222 /* This constructor sets up a private connection to the DBus daemon, connects 223 * to the hal service and installs a filter which sets the mTriggered flag in 224 * the Context structure when a device (not necessarily USB) is added or 225 * removed. */ 236 226 VBoxMainHotplugWaiter::VBoxMainHotplugWaiter () 237 227 { … … 263 253 } 264 254 265 /* *Destructor */255 /* Destructor */ 266 256 VBoxMainHotplugWaiter::~VBoxMainHotplugWaiter () 267 257 { … … 274 264 } 275 265 266 /* Currently this is implemented using a timed out wait on our private DBus 267 * connection. Because the connection is private we don't have to worry about 268 * blocking other users. */ 276 269 int VBoxMainHotplugWaiter::Wait(unsigned cMillies) 277 270 { … … 304 297 } 305 298 299 /* Set a flag to tell the Wait not to resume next time it times out. */ 306 300 void VBoxMainHotplugWaiter::Interrupt() 307 301 { … … 519 513 520 514 #if defined(RT_OS_LINUX) && defined(VBOX_WITH_DBUS) 521 /* Linux, load libdbus statically */522 523 515 /** Wrapper class around DBusError for automatic cleanup */ 524 516 class autoDBusError … … 551 543 552 544 /** 553 * Helper function for setting up a connection to hal 545 * Helper function for setting up a connection to the DBus daemon and 546 * registering with the hal service. 547 * 548 * @note If libdbus is being loaded at runtime then be sure to call 549 * VBoxDBusCheckPresence before calling this. 554 550 * @returns iprt status code 555 551 * @param ppConnection where to store the connection handle … … 594 590 595 591 /** 596 * Helper function for setting up a private connection to hal 592 * Helper function for setting up a private connection to the DBus daemon and 593 * registering with the hal service. Private connections are considered 594 * unsociable and should not be used unnecessarily (as per the DBus API docs). 595 * 596 * @note If libdbus is being loaded at runtime then be sure to call 597 * VBoxDBusCheckPresence before calling this. 597 598 * @returns iprt status code 598 599 * @param pConnection where to store the connection handle … … 637 638 638 639 /** 639 * Helper function for shutting down a connection to hal640 * Helper function for shutting down a connection to DBus and hal. 640 641 * @param pConnection the connection handle 641 642 */ … … 659 660 660 661 /** 661 * Helper function for shutting down a connection to hal662 * Helper function for shutting down a private connection to DBus and hal. 662 663 * @param pConnection the connection handle 663 664 */
Note:
See TracChangeset
for help on using the changeset viewer.