edecca
From 37b470d6e99ba9468054ae20524ed00014e6e0bb Mon Sep 17 00:00:00 2001
edecca
Message-Id: <37b470d6e99ba9468054ae20524ed00014e6e0bb@dist-git>
edecca
From: Michal Privoznik <mprivozn@redhat.com>
edecca
Date: Tue, 4 Sep 2018 10:38:49 +0200
edecca
Subject: [PATCH] virDomainDetachDeviceFlags: Clarify update semantics
edecca
MIME-Version: 1.0
edecca
Content-Type: text/plain; charset=UTF-8
edecca
Content-Transfer-Encoding: 8bit
edecca
edecca
RHEL-7.6: https://bugzilla.redhat.com/show_bug.cgi?id=1621910
edecca
RHEL-8.0: https://bugzilla.redhat.com/show_bug.cgi?id=1603133
edecca
edecca
When users want to update a path to a CDROM they tend to
edecca
construct a very minimal XML and feed the API with it. This is
edecca
not a good practice as it breaks the assumptions the API is built
edecca
on. Most notably, leaving an element out should be treated as a
edecca
request for removal of the corresponding setting. Just like
edecca
leaving out <bandwidth/> clears out any QoS previously set.
edecca
edecca
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
edecca
Reviewed-by: Erik Skultety <eskultet@redhat.com>
edecca
(cherry picked from commit 2864b4cd1ccda9c12f0c0ceb340836c42a2a0e52)
edecca
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
edecca
Reviewed-by: Ján Tomko <jtomko@redhat.com>
edecca
---
edecca
 src/libvirt-domain.c | 8 ++++++++
edecca
 1 file changed, 8 insertions(+)
edecca
edecca
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
edecca
index ab7266dc19..ad0ded9ee3 100644
edecca
--- a/src/libvirt-domain.c
edecca
+++ b/src/libvirt-domain.c
edecca
@@ -8315,6 +8315,14 @@ virDomainDetachDeviceFlags(virDomainPtr domain,
edecca
  * media, altering the graphics configuration such as password,
edecca
  * reconfiguring the NIC device backend connectivity, etc.
edecca
  *
edecca
+ * The supplied XML description of the device should contain all
edecca
+ * the information that is found in the corresponding domain XML.
edecca
+ * Leaving out any piece of information may be treated as a
edecca
+ * request for its removal, which may be denied. For instance,
edecca
+ * when users want to change CDROM media only for live XML, they
edecca
+ * must provide live disk XML as found in the corresponding live
edecca
+ * domain XML with only the disk path changed.
edecca
+ *
edecca
  * Returns 0 in case of success, -1 in case of failure.
edecca
  */
edecca
 int
edecca
-- 
edecca
2.18.0
edecca