Changeset 100772 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 1, 2023 5:34:48 PM (18 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r100737 r100772 7431 7431 <attribute name="USBProxyAvailable" type="boolean" readonly="yes"> 7432 7432 <desc> 7433 Returns whether there is a nUSB proxy available.7433 Returns whether there is a USB proxy available. 7434 7434 </desc> 7435 7435 </attribute> … … 10955 10955 <rest request="post" path="/vms/{vmid}/configuration/"/> 10956 10956 <desc> 10957 Detaches a nUSB device with the given UUID from the USB controller10957 Detaches a USB device with the given UUID from the USB controller 10958 10958 of the virtual machine. 10959 10959 … … 23083 23083 > 23084 23084 <desc> 23085 The IUSBDeviceFilter interface represents a nUSB device filter used23086 to perform actions on a group ofUSB devices.23087 23088 This type of filters isused by running virtual machines to23085 The IUSBDeviceFilter interface represents a USB device filter used 23086 to perform actions on one or more USB devices. 23087 23088 USB device filters are used by running virtual machines to 23089 23089 automatically capture selected USB devices once they are physically 23090 23090 attached to the host computer. 23091 23091 23092 A USB device is matched to the given device filter if and only if all 23093 attributes of the device match the corresponding attributes of the 23094 filter (that is, attributes are joined together using the logical AND 23095 operation). On the other hand, all together, filters in the list of 23096 filters carry the semantics of the logical OR operation. So if it is 23097 desirable to create a match like "this vendor id OR this product id", 23098 one needs to create two filters and specify "any match" (see below) 23099 for unused attributes. 23100 23101 All filter attributes used for matching are strings. Each string 23102 is an expression representing a set of values of the corresponding 23103 device attribute, that will match the given filter. Currently, the 23104 following filtering expressions are supported: 23092 A USB device is matched to a specific device filter if and only if all 23093 attributes of the device filter match the corresponding attributes of the 23094 device (that is, attributes are joined together using a logical AND 23095 operation). On the other hand filter attributes in separate USB 23096 device filters are applied as a logical OR operation. So if one 23097 would like to create a match such as "this vendor id OR this product id", 23098 then one would need to create two filters and specify "any match" (see below) 23099 for the other unused attributes. 23100 23101 All filter attributes used for matching are strings. The following 23102 filtering expressions are currently supported: 23105 23103 23106 23104 <ul> 23107 23105 <li><i>Interval filters</i>. Used to specify valid intervals for 23108 integer device attributes (Vendor ID, Product ID and Revision).23106 integer device attributes (Vendor ID, Product ID, Revision and Port). 23109 23107 The format of the string is: 23110 23108 … … 23112 23110 23113 23111 where <tt>m</tt> and <tt>n</tt> are integer numbers, either in octal 23114 (starting from <tt>0</tt>), hexadecimal (starting from<tt>0x</tt>)23115 or decimal (otherwise) form, so that <tt>m < n</tt>. If <tt>m</tt>23112 (starting with <tt>0</tt>), hexadecimal (starting with <tt>0x</tt>) 23113 or decimal (otherwise), so that <tt>m < n</tt>. If <tt>m</tt> 23116 23114 is omitted before a dash (<tt>-</tt>), the minimum possible integer 23117 23115 is assumed; if <tt>n</tt> is omitted after a dash, the maximum … … 23126 23124 <li><i>Exact match</i>. Used to specify a single value for the given 23127 23125 device attribute. Any string that doesn't start with <tt>int:</tt> 23128 represents theexact match. String device attributes are compared to23129 this string in cluding case of symbols. Integer attributes are first23126 represents an exact match. String device attributes are compared to 23127 this string in a case-sensitive manner. Integer attributes are first 23130 23128 converted to a string (see individual filter attributes) and then 23131 compared i gnoring case.23129 compared in a case-insensitive manner. 23132 23130 23133 23131 </li> … … 23140 23138 23141 23139 <note> 23142 On the Windows host platform, interval filters are not currently23143 available.Also all string filter attributes23140 On Windows hosts, interval filters are not currently available. 23141 Also all string filter attributes 23144 23142 (<link to="#manufacturer"/>, <link to="#product"/>, 23145 23143 <link to="#serialNumber"/>) are ignored, so they behave as -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r100108 r100772 217 217 218 218 #ifdef VBOX_WITH_USB 219 USBDeviceFilterList llChildren; // all USB device filters219 USBDeviceFilterList llChildren; // all global USB device filters 220 220 USBDeviceFilterList llUSBDeviceFilters; // USB device filters in use by the USB proxy service 221 221 … … 535 535 536 536 #ifdef VBOX_WITH_USB 537 /* uninit all USB device filters still referenced by clients 538 * Note! HostUSBDeviceFilter::uninit() will modify llChildren. 539 * This list should be already empty, but better be safe than sorry. */ 540 while (!m->llChildren.empty()) 541 { 542 ComObjPtr<HostUSBDeviceFilter> &pChild = m->llChildren.front(); 543 pChild->uninit(); 544 m->llChildren.pop_front(); 537 /* Clean up the list of global USB device filters. */ 538 if (!m->llChildren.empty()) 539 { 540 /* 541 * i_removeChild() modifies llChildren so we make a copy to traverse here. The 542 * removal of a global USB device filter from the llChildren list at this point 543 * in Host:uninit() will trigger HostUSBDeviceFilter::FinalRelease() -> 544 * HostUSBDeviceFilter::uninit() which will complete the remainder of the clean-up 545 * for each global USB device filter and thus we don't need to call 546 * HostUSBDeviceFilter::uninit() directly here ourselves. 547 */ 548 USBDeviceFilterList llChildrenCopy(m->llChildren); 549 for (USBDeviceFilterList::iterator it = llChildrenCopy.begin(); 550 it != llChildrenCopy.end(); 551 ++it) 552 i_removeChild(*it); 545 553 } 546 554 -
trunk/src/VBox/Main/src-server/USBDeviceFilterImpl.cpp
r98292 r100772 976 976 bd.free(); 977 977 978 mParent->i_removeChild(this);979 980 978 unconst(mParent) = NULL; 981 979 }
Note:
See TracChangeset
for help on using the changeset viewer.