提交 d833bb02 编写于 作者: J Ján Tomko

Document that USB hostdevs do not need nodeDettach

The virNodeDeviceDettach API only works on PCI devices.

Originally added by commit 10d3272e, but the API never
supported USB devices.

Reported by: Martin Polednik <mpolednik@redhat.com>

(cherry picked from commit e600a37d)
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 5b08842d
...@@ -2962,21 +2962,20 @@ ...@@ -2962,21 +2962,20 @@
with additional attributes noted. with additional attributes noted.
<dl> <dl>
<dt>usb</dt> <dt>usb</dt>
<dd>For USB devices, the user is responsible to call <dd>USB devices are detached from the host on guest startup
<code>virNodeDeviceDettach</code> (or and reattached after the guest exits or the device is
<code>virsh nodedev-detach</code>) before starting the guest hot-unplugged.
or hot-plugging the device and <code>virNodeDeviceReAttach</code>
(or <code>virsh nodedev-reattach</code>) after hot-unplug or
stopping the guest.
</dd> </dd>
<dt>pci</dt> <dt>pci</dt>
<dd>For PCI devices, when <code>managed</code> is "yes" it is <dd>For PCI devices, when <code>managed</code> is "yes" it is
detached from the host before being passed on to the guest detached from the host before being passed on to the guest
and reattached to the host after the guest exits. If and reattached to the host after the guest exits. If
<code>managed</code> is omitted or "no", follow the steps <code>managed</code> is omitted or "no", the user is
described for a USB device to detach before starting the responsible to call <code>virNodeDeviceDetachFlags</code>
guest or hot-plugging and reattach after stopping the guest (or <code>virsh nodedev-detach</code> before starting the guest
or hot-unplug. or hot-plugging the device and <code>virNodeDeviceReAttach</code>
(or <code>virsh nodedev-reattach</code>) after hot-unplug or
stopping the guest.
</dd> </dd>
<dt>scsi</dt> <dt>scsi</dt>
<dd>For SCSI devices, user is responsible to make sure the device <dd>For SCSI devices, user is responsible to make sure the device
......
...@@ -2282,7 +2282,7 @@ attach taking effect the next time libvirt starts the domain. ...@@ -2282,7 +2282,7 @@ attach taking effect the next time libvirt starts the domain.
For cdrom and floppy devices, this command only replaces the media For cdrom and floppy devices, this command only replaces the media
within an existing device; consider using B<update-device> for this within an existing device; consider using B<update-device> for this
usage. For passthrough host devices, see also B<nodedev-detach>, usage. For passthrough host devices, see also B<nodedev-detach>,
needed if the device does not use managed mode. needed if the PCI device does not use managed mode.
If I<--live> is specified, affect a running domain. If I<--live> is specified, affect a running domain.
If I<--config> is specified, affect the next startup of a persistent domain. If I<--config> is specified, affect the next startup of a persistent domain.
...@@ -2532,15 +2532,14 @@ L<http://libvirt.org/formatnode.html>. ...@@ -2532,15 +2532,14 @@ L<http://libvirt.org/formatnode.html>.
Passthrough devices cannot be simultaneously used by the host and its Passthrough devices cannot be simultaneously used by the host and its
guest domains, nor by multiple active guests at once. If the guest domains, nor by multiple active guests at once. If the
<hostdev> description includes the attribute B<managed='yes'>, and the <hostdev> description of a PCI device includes the attribute B<managed='yes'>,
hypervisor driver supports it, then the device is in managed mode, and and the hypervisor driver supports it, then the device is in managed mode, and
attempts to use that passthrough device in an active guest will attempts to use that passthrough device in an active guest will
automatically behave as if B<nodedev-detach> (guest start, device automatically behave as if B<nodedev-detach> (guest start, device
hot-plug) and B<nodedev-reattach> (guest stop, device hot-unplug) were hot-plug) and B<nodedev-reattach> (guest stop, device hot-unplug) were
called at the right points (currently, qemu does this for PCI devices, called at the right points. If a PCI device is not marked as managed,
but not USB). If a device is not marked as managed, then it must then it must manually be detached before guests can use it, and manually
manually be detached before guests can use it, and manually reattached reattached to be returned to the host. Also, if a device is manually detached,
to be returned to the host. Also, if a device is manually detached,
then the host does not regain control of the device without a matching then the host does not regain control of the device without a matching
reattach, even if the guests use the device in managed mode. reattach, even if the guests use the device in managed mode.
...@@ -2598,8 +2597,8 @@ I<cap> and I<--tree> are mutually exclusive. ...@@ -2598,8 +2597,8 @@ I<cap> and I<--tree> are mutually exclusive.
Declare that I<nodedev> is no longer in use by any guests, and that Declare that I<nodedev> is no longer in use by any guests, and that
the host can resume normal use of the device. This is done the host can resume normal use of the device. This is done
automatically for devices in managed mode, but must be done explicitly automatically for PCI devices in managed mode and USB devices, but
to match any explicit B<nodedev-detach>. must be done explicitly to match any explicit B<nodedev-detach>.
=item B<nodedev-reset> I<nodedev> =item B<nodedev-reset> I<nodedev>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册