From nobody Fri May 3 23:44:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1535377829833453.0399297383615; Mon, 27 Aug 2018 06:50:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 98C6B5F72C; Mon, 27 Aug 2018 13:50:27 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6671C30912F4; Mon, 27 Aug 2018 13:50:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 234B34BB7F; Mon, 27 Aug 2018 13:50:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7RDoQ0Z014380 for ; Mon, 27 Aug 2018 09:50:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 806842026E03; Mon, 27 Aug 2018 13:50:26 +0000 (UTC) Received: from burns.aufun.sk (unknown [10.40.205.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0F922026DFD for ; Mon, 27 Aug 2018 13:50:23 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 27 Aug 2018 15:50:20 +0200 Message-Id: <108590841e95981914fec8bb4b899fe8cde8c82f.1535377820.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] virDomainDetachDeviceFlags: Clarify update semantics X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 27 Aug 2018 13:50:28 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1621910 When users want to update a path to a CDROM they tend to construct a very minimal XML and feed the API with it. This is not a good practice as it breaks the assumptions the API is built on. Most notably, leaving an element out should be treated as a request for removal of the corresponding setting. Just like leaving out clears out any QoS previously set. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/libvirt-domain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index ef460277f7..bd8ca6eff2 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -8318,6 +8318,14 @@ virDomainDetachDeviceFlags(virDomainPtr domain, * media, altering the graphics configuration such as password, * reconfiguring the NIC device backend connectivity, etc. * + * The supplied XML description of the device should contain all + * the information that are found in corresponding domain XML. + * Leaving out any piece of information is treated as request for + * its removal, which may be denied. For instance, when users + * want to change CDROM media only for live XML, they must + * provide live disk XML as found in corresponding live domain + * XML with only the disk path changed. + * * Returns 0 in case of success, -1 in case of failure. */ int --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list