From d833bb0223548ce00f5118d795664974cc791a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Fri, 20 Mar 2015 10:25:13 +0100 Subject: [PATCH] Document that USB hostdevs do not need nodeDettach MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The virNodeDeviceDettach API only works on PCI devices. Originally added by commit 10d3272e, but the API never supported USB devices. Reported by: Martin Polednik (cherry picked from commit e600a37d276dddf6f5b674328b94b30e10716a99) Signed-off-by: Ján Tomko --- docs/formatdomain.html.in | 19 +++++++++---------- tools/virsh.pod | 17 ++++++++--------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0786a4959b..12172a468b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2962,21 +2962,20 @@ with additional attributes noted.
usb
-
For USB devices, the user is responsible to call - virNodeDeviceDettach (or - virsh nodedev-detach) before starting the guest - or hot-plugging the device and virNodeDeviceReAttach - (or virsh nodedev-reattach) after hot-unplug or - stopping the guest. +
USB devices are detached from the host on guest startup + and reattached after the guest exits or the device is + hot-unplugged.
pci
For PCI devices, when managed is "yes" it is detached from the host before being passed on to the guest and reattached to the host after the guest exits. If - managed is omitted or "no", follow the steps - described for a USB device to detach before starting the - guest or hot-plugging and reattach after stopping the guest - or hot-unplug. + managed is omitted or "no", the user is + responsible to call virNodeDeviceDetachFlags + (or virsh nodedev-detach before starting the guest + or hot-plugging the device and virNodeDeviceReAttach + (or virsh nodedev-reattach) after hot-unplug or + stopping the guest.
scsi
For SCSI devices, user is responsible to make sure the device diff --git a/tools/virsh.pod b/tools/virsh.pod index eae91957e2..c879981b65 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -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 within an existing device; consider using B for this usage. For passthrough host devices, see also B, -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<--config> is specified, affect the next startup of a persistent domain. @@ -2532,15 +2532,14 @@ L. Passthrough devices cannot be simultaneously used by the host and its guest domains, nor by multiple active guests at once. If the - description includes the attribute B, and the -hypervisor driver supports it, then the device is in managed mode, and + description of a PCI device includes the attribute B, +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 automatically behave as if B (guest start, device hot-plug) and B (guest stop, device hot-unplug) were -called at the right points (currently, qemu does this for PCI devices, -but not USB). If a device is not marked as managed, then it must -manually be detached before guests can use it, and manually reattached -to be returned to the host. Also, if a device is manually detached, +called at the right points. If a PCI device is not marked as managed, +then it must manually be detached before guests can use it, and manually +reattached 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 reattach, even if the guests use the device in managed mode. @@ -2598,8 +2597,8 @@ I and I<--tree> are mutually exclusive. Declare that I is no longer in use by any guests, and that the host can resume normal use of the device. This is done -automatically for devices in managed mode, but must be done explicitly -to match any explicit B. +automatically for PCI devices in managed mode and USB devices, but +must be done explicitly to match any explicit B. =item B I -- GitLab