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