render / rpms / libvirt

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