From Fedora Project Wiki

(Created page with '{{QA/Test_Case |description= |setup=Prepare a machine to support vt-d, e.g. Dell 755. |actions= # Start a VM using virt-manager. # Check device using lspci, here we will hotplug ...')
 
(Drop outdates bug reference)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{QA/Test_Case
{{QA/Test_Case
|description=
|description=
|setup=Prepare a machine to support vt-d, e.g. Dell 755.
Attach a physical USB device to your guest.
 
|setup=
Functioning Fedora host and a VM of any OS. More VM OS and USB devices the merrier!
 
|actions=
|actions=
# Start a VM using virt-manager.
 
# Check device using lspci, here we will hotplug network from host to guest:
=== Attach the host USB device ===
#: <pre>#lsusb
==== Using virt-manager ====
#: ...
 
#: Bus 002 Device 002: ID 0781:5151 SanDisk Corp. Cruzer Micro Flash Drive
# Start the VM
#: ...
# Add Hardware->USB Host Device
#: </pre>
# Choose the device you want to assign from the list, like: <code>009:002 SanDisk Extreme</code>
# Open a Virtual Machine->show details->''Add Hardware''->select 'USB Host Device' in hardware type list->select 002:002 in device list to assign the usb device to a vm.
# Click ''Finish''
# In guest,  issue ''lsusb''.
# Verify that the guest shows up in 'lsusb' output in the guest.
# Verify the device's functionality in the guest (this will be device specific)
# Select the device in virt-manager, and click 'Remove'.
# Verify the device again appears in the host, and is functional on the host.
 
==== Using virt-xml ====
 
* Find the device you want to attach in the output of <code>lsusb</code>, copy the ID string, something like <code>0781:5406</code>
* Attach the device to running VM 'test-day-vm' using virt-xml:
  sudo virt-xml test-day-vm --update --add-device --host-device 0781:5406
* Verify the device is usable in the VM
* Remove the device from the running VM 'test-day-vm':
  sudo virt-xml test-day-vm --update --remove-device --host-device 0781:5406
* Verify the device is visible and functioning on the host machine
 
|results=
|results=
# After step 4, <code>#lsusb</code> can find the hotpluged usb device
No obvious errors occur.
}}
}}


[[Category:Virtualization Hotplug Test Cases]]
[[Category:Virtualization Test Cases]]

Latest revision as of 01:05, 14 April 2015

Description

Attach a physical USB device to your guest.

Setup

Functioning Fedora host and a VM of any OS. More VM OS and USB devices the merrier!

How to test

Attach the host USB device

Using virt-manager

  1. Start the VM
  2. Add Hardware->USB Host Device
  3. Choose the device you want to assign from the list, like: 009:002 SanDisk Extreme
  4. Click Finish
  5. Verify that the guest shows up in 'lsusb' output in the guest.
  6. Verify the device's functionality in the guest (this will be device specific)
  7. Select the device in virt-manager, and click 'Remove'.
  8. Verify the device again appears in the host, and is functional on the host.

Using virt-xml

  • Find the device you want to attach in the output of lsusb, copy the ID string, something like 0781:5406
  • Attach the device to running VM 'test-day-vm' using virt-xml:
 sudo virt-xml test-day-vm --update --add-device --host-device 0781:5406
  • Verify the device is usable in the VM
  • Remove the device from the running VM 'test-day-vm':
 sudo virt-xml test-day-vm --update --remove-device --host-device 0781:5406
  • Verify the device is visible and functioning on the host machine

Expected Results

No obvious errors occur.