On 20.02.2015 12:39, Ján Tomko wrote:
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.
+ *
I don't think we want to advertise this. Users are required to pass full
device XML. If we use only a part of that information to find the
device, it's our internal implementation. Not a green light for users to
pass minimized XMLs.
Same applies for (partly) inconsistent XMLs (inconsistent to domain
XML). If we now teach users it's okay to pass XML that differs to its
domain counterpart, we are stuck with it forever. I'd await plenty of
bug reports that we broke somebody's flow just because he was passing
altered XML and we suddenly needed to change the set of attributes that
are checked.
NACK, sorry.
Michal