From Fedora Project Wiki

(flesh out the test case)
(add bit about having to use reattach after guest shutdown)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
|description=This case verifies that a PCI device can be assigned to a KVM guest and used successfully in the guest.
|description=This case verifies that a PCI device can be assigned to a KVM guest and used successfully in the guest.
|actions=
|actions=
* Edit an existing guest's configuration using <code>virsh edit</code>
# Edit an existing guest's configuration using <code>virsh edit</code>
* In the <code>devices</code> section add a <code>hostdev</code> element describing the device using its PCI address
# In the <code>devices</code> section add a <code>hostdev</code> element describing the device using its PCI address
<pre>
#:<pre>
    <hostdev mode='subsystem' type='pci' managed='yes'>
#:<hostdev mode='subsystem' type='pci' managed='yes'>
      <source>
#:  <source>
        <address bus='0x00' slot='0x19' function='0x00'/>
#:  <address bus='0x00' slot='0x19' function='0x00'/>
      </source>
#:  </source>
    </hostdev>
#:</hostdev></pre>
</pre>
# Start the guest using <code>virsh start</code>
* Start the guest using <code>virsh start</code>
# Try using the device in the guest - e.g. if it is a NIC, bring it up and ping a remote host
* Try using the device in the guest - e.g. if it is a NIC, bring it up and ping a remote host
# Shut down the guest
* Shut down the guest
# Re-attach the device in the host using <code>virsh reattach</code> (see [[rhbug:499561|499561]]
* Check that the device can be used in the host again
# Check that the device can be used in the host again
|results=
|results=
* The guest should start without any errors
# The guest should start without any errors
* The device should be usable within the guest
# The device should be usable within the guest
* When the guest has been shut down, the device should be usable in the host
# When the guest has been shut down, the device should be usable in the host
}}
}}
[[Category:Virtualization KVM PCI Device Assignment Test Cases|libvirt]]
[[Category:Virtualization KVM PCI Device Assignment Test Cases|libvirt]]

Latest revision as of 08:14, 7 May 2009

Description

This case verifies that a PCI device can be assigned to a KVM guest and used successfully in the guest.


How to test

  1. Edit an existing guest's configuration using virsh edit
  2. In the devices section add a hostdev element describing the device using its PCI address
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
    <address bus='0x00' slot='0x19' function='0x00'/>
    </source>
    </hostdev>
  3. Start the guest using virsh start
  4. Try using the device in the guest - e.g. if it is a NIC, bring it up and ping a remote host
  5. Shut down the guest
  6. Re-attach the device in the host using virsh reattach (see 499561
  7. Check that the device can be used in the host again

Expected Results

  1. The guest should start without any errors
  2. The device should be usable within the guest
  3. When the guest has been shut down, the device should be usable in the host