[libvirt] [PATCH] Clarify behavior or virDomainDetachDevice

Ján Tomko jtomko at redhat.com
Fri Feb 20 11:39:58 UTC 2015


Doucment that not all attributes are used for matching.

https://bugzilla.redhat.com/show_bug.cgi?id=872028
---
 src/libvirt-domain.c | 5 +++++
 tools/virsh.pod      | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 492e90a..a95c096 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -8341,6 +8341,11 @@ virDomainDetachDevice(virDomainPtr domain, const char *xml)
  * into S4 state (also known as hibernation) unless you also modify the
  * persistent domain definition.
  *
+ * Note that not all attributes from the XML definition are checked.
+ * For example, if the mac address and the pci address specified in the XML
+ * match an existing interface, but source and interface type do not,
+ * the existing interface will be detached.
+ *
  * Returns 0 in case of success, -1 in case of failure.
  */
 int
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 50de32c..2c584d3 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -2441,7 +2441,9 @@ the device does not use managed mode.
 
 B<Note>: using of partial device definition XML files may lead to unexpected
 results as some fields may be autogenerated and thus match devices other than
-expected.
+expected. Not every device attribute is checked when matching the device.
+For example a network interface can be detatched if the mac and PCI addresses
+match, even if the type does not.
 
 If I<--live> is specified, affect a running domain.
 If I<--config> is specified, affect the next startup of a persistent domain.
-- 
2.0.5




More information about the libvir-list mailing list