- 积分
- 16840
在线时间 小时
最后登录1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
首先安装usb
$ h& p2 P3 K2 m' \1 Wrpm -ivh usbutils-007-5.el7.x86_64.rpm + Z' z% K; }, t2 g
使用lsusb命令查看:
/ B S: A) m/ l5 d(nova-libvirt)[root@compute07 /]# lsusb -v
1 W; W2 Q; i: S( ?
3 `, M3 b! O& z# ?, M4 v* qBus 002 Device 003: ID 0781:5588 SanDisk Corp.
. ]( U3 q# {2 ~" d5 JDevice Descriptor:; U, B% ?5 X$ {3 d+ ?0 |, ^' c3 g' v
bLength 18
6 [1 d* y9 l, ]4 _8 S bDescriptorType 1
- c; A/ \$ K! K$ F0 n" y bcdUSB 2.10
U$ V& {/ e. k* X7 _& U bDeviceClass 0 (Defined at Interface level)
; O- `- G% W4 M1 e0 W bDeviceSubClass 0
4 W: d$ @% i) f6 f* \ bDeviceProtocol 0 ) ~0 N. c- y; g" o, ~
bMaxPacketSize0 64/ ~. `8 q3 [4 s; H+ \$ a9 f
idVendor 0x0781 SanDisk Corp.5 x/ p0 t& U1 c
idProduct 0x5588
* t6 L* I& y" B$ o8 q. X% S- E6 \ bcdDevice 1.00! W w( s6 Q. h# \+ g7 ^
iManufacturer 2 SanDisk2 b, A7 v. o+ M! b- b9 f
iProduct 3 USB Extreme Pro9 E3 E. R7 Y: J6 }; ]" Y- p
iSerial 1 00000000000000000000+ @! ~; ?, x7 ]9 c% o2 a2 d
bNumConfigurations 1
) j l- o# T2 j6 t( i9 D9 K0 h( A1 @ Configuration Descriptor:3 S5 I3 C% n2 t) _# f5 I3 ?0 t
bLength 9
% ]0 Z; @1 X4 L bDescriptorType 2
% C; K. I# b" ^. E4 o wTotalLength 32
7 _9 V# R+ b; u) P; P bNumInterfaces 1. v3 t7 P3 \8 U; A$ ?. [$ H( a2 |
bConfigurationValue 1
& @+ A2 K. H8 W iConfiguration 0 : v' d$ S6 |* s7 e# J5 j) k
bmAttributes 0xc0; p; f& h/ S9 V9 q
Self Powered
- ?4 B- E/ d$ F" m! a5 ?8 d MaxPower 0mA, _; q, Q9 i, y
Interface Descriptor:
/ g/ d! G- u. N+ E bLength 9. T- B4 {1 t2 s) K4 M
bDescriptorType 4
! [' V' Y, @# b' j9 D+ \3 z bInterfaceNumber 0
# E6 F* O% D% p8 s bAlternateSetting 0) r, Z, y# z$ Y$ c8 b
bNumEndpoints 2# b7 P- R4 }2 m
bInterfaceClass 8 Mass Storage
4 T. v( C9 |7 T5 y& z bInterfaceSubClass 6 SCSI5 T5 }/ {8 G/ ?$ e- f
bInterfaceProtocol 80 Bulk-Only, Q. U" ], S, X2 U! A( Y
iInterface 0
) u) S# q/ l8 R$ o Endpoint Descriptor:; H7 ]6 F& ~9 I' m$ m7 ?5 I! q
bLength 7
. x D9 g$ p& s1 e bDescriptorType 5$ p: Z% S; z+ |( X$ ^& y
bEndpointAddress 0x81 EP 1 IN* V( J; A6 e z1 A! A
bmAttributes 2
7 w% i1 C& h& K3 Z Transfer Type Bulk4 l$ ]0 n+ n( k6 \# T) V4 x
Synch Type None
" O% t. D9 S' w& z5 n% N( [ Usage Type Data H& [. j0 X3 y. |4 y, W3 T D2 R
wMaxPacketSize 0x0200 1x 512 bytes1 s6 G5 u C& O2 z- G
bInterval 05 f0 ?" X4 H1 ]4 i
Endpoint Descriptor:
* `- N8 C2 k& R, h1 E/ l bLength 7- G" ^, g. a0 F; @
bDescriptorType 53 {9 ?, C, W" h }! M' t. P5 D6 u8 f
bEndpointAddress 0x02 EP 2 OUT- I# t4 g+ I8 q4 G/ j
bmAttributes 2
, w _" w2 k- w/ G1 e( Y6 S. g Transfer Type Bulk, Q: Q8 M5 Y: C6 T+ P' d
Synch Type None
& E* D# o6 A0 y# v1 B Usage Type Data
* E% j- x; F" E2 s. f" [ wMaxPacketSize 0x0200 1x 512 bytes! b" Y; m! j; v/ k
bInterval 02 f9 n4 \& Z0 ]
Binary Object Store Descriptor:
, s. y! a* u; _; g# t0 F bLength 5
. [" U- ~2 c4 l7 F K. o! t bDescriptorType 15% W+ \. l8 T! Y& o t8 X9 P
wTotalLength 22/ r. s1 C( Z) L9 ^
bNumDeviceCaps 2/ l2 I, E9 s& f* B. s
USB 2.0 Extension Device Capability:
7 {6 r4 I# Q) H- u5 A6 x1 R bLength 7! S) M Z3 m$ L, W
bDescriptorType 16
2 f2 j% q4 Z1 n) m, V( B. L bDevCapabilityType 23 B# H; s( i2 J6 t* T7 I
bmAttributes 0x0000f41e
- b* {5 v6 o5 ]: L3 T& ^4 v Link Power Management (LPM) Supported% ]" h7 Q$ y5 ?7 C+ \* c/ F6 @( e/ r
SuperSpeed USB Device Capability:
7 `5 G$ a( u. _% b, r bLength 10 F3 C! o# r, ]
bDescriptorType 16
4 U" _ [: t$ O2 F+ G5 v bDevCapabilityType 3
: O6 `& ]9 Q% M- h; \ X) e, k bmAttributes 0x00
0 l5 t6 Y2 n4 W6 w- }- I* l wSpeedsSupported 0x000e8 t+ t% B6 }, _) y* F A
Device can operate at Full Speed (12Mbps)
. ?0 Z$ k1 [9 A2 J& M: ? Device can operate at High Speed (480Mbps)& [9 G$ v2 J* i, }- U) e$ @' ^7 _
Device can operate at SuperSpeed (5Gbps)' a; x/ Z# P, e/ B0 x
bFunctionalitySupport 1
3 P4 G1 q9 ?* ^; J1 N9 q1 g Lowest fully-functional device speed is Full Speed (12Mbps)
* ~2 u$ {& n' w2 |* x) T5 y% `5 l bU1DevExitLat 10 micro seconds8 q& T$ b |/ s+ q8 K
bU2DevExitLat 2047 micro seconds
6 ?. }3 B8 V0 }) EDevice Status: 0x0001: [' `( [* a9 Y" j; m( R
Self Powered" x, {( T6 j" A! I) O0 t9 _
7 c) O& N5 \1 @$ K4 b
编辑xml文件:% ]0 f6 O% R$ V* T: \' i
M) T. t- h# `, k: o(nova-libvirt)[root@compute07 /]# vim usb.xml + v/ f1 I" E4 x( M% ?5 z7 h
<hostdev mode='subsystem' type='usb'>
( v, G8 v' D$ b) O<source startupPolicy='optional'>$ J5 A* `; n6 _6 Q( I5 ]# w) _
<vendor id='0x0781'/>/ p3 |; y( W; i6 N, h% w
<product id='0x5588'/>
+ U! f8 o% T1 w</source>
" I5 M1 r4 m: H( o</hostdev>
- X# Z( C# F, y) H$ I7 o* @$ z8 k5 Z, X
添加usb到虚机
2 B0 i) ^2 S( C3 V+ h# B
0 x7 `* |$ y* _! t' t8 r(nova-libvirt)[root@compute07 /]# virsh attach-device instance-00000162 usb.xml0 H4 q& C) @4 u4 X. w
Device attached successfully
6 }# O. Q" z" Z- u" Y# j0 t! W/ Z$ P$ E6 _5 j$ Y) v
(nova-libvirt)[root@compute07 /]# virsh detach-device instance-00000162 usb.xml & w. f; Q5 C7 v8 P i" R" C
Device detached successfully
' a( t& B) b& ]7 f- R3 G" E
# C' J4 c6 Y2 ^/ @1 v. z/ Z' q5 X- F6 O, @
; r1 r3 `; a" I3 h) [: L. Y& X. ~ `8 ` m
$ a6 P6 v q4 s6 n+ Z* u# ?. Z
4 f: a# d$ G Q0 F
|
|