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