From nobody Sun Feb 8 16:24:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1590009312; cv=none; d=zohomail.com; s=zohoarc; b=PYuG9kIILVSRQ6jLQJzavTYWUj5emeswa5FYlH8RL4/5pryeHhcV3zn0MC9t/vhNEtO4+pSkzKxwvyxDnErytZ+pIhrdljdxkhLdmvWm0ovv2xD6uvFslZf/cjBqzQwXX/HVBxL1XnW5nQ1S0NqvrPcI9C2ro7ADBiq+gXrKAvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590009312; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=poSdcbzQKSdRWDxOewcD2oAfw5WfKnxqJKfQxlKYPQg=; b=aMe7Bp6L1yIFJ+lnHFXhNiJTUrGAJjjP6wiT8iz5dJIuE6yGJlCpD1uNoglbpIS1dsGe03kZARZupEhlrk9uEfSX4F1Vc25DZAkLOoZ36JG7Mdh9cmRKXKEQS3GUNUkoT2ONdXcLIHEb0NhfeFboyDJjnuNR3hZXBTdNuR+gDkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1590009312067672.7780542654577; Wed, 20 May 2020 14:15:12 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-74-D9q3N3SiO3CNFhYxZIqAkA-1; Wed, 20 May 2020 17:15:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6C822A0BE0; Wed, 20 May 2020 21:15:01 +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 47EA560C84; Wed, 20 May 2020 21:15:01 +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 1950A54D01; Wed, 20 May 2020 21:15:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04KLChVS002271 for ; Wed, 20 May 2020 17:12:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9FF6463537; Wed, 20 May 2020 21:12:43 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C21A8A4C4 for ; Wed, 20 May 2020 21:12:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 846978007D0 for ; Wed, 20 May 2020 21:12:43 +0000 (UTC) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-264-UCgGj6VgNGuwkzM-2VSD-Q-1; Wed, 20 May 2020 17:12:41 -0400 Received: by mail-qk1-f195.google.com with SMTP id y22so5183758qki.3 for ; Wed, 20 May 2020 14:12:41 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:fbf2:bc5e:c314:af31:7070]) by smtp.gmail.com with ESMTPSA id z14sm2992031qki.83.2020.05.20.14.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2020 14:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590009310; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=poSdcbzQKSdRWDxOewcD2oAfw5WfKnxqJKfQxlKYPQg=; b=BTgxMeQn1xTfXIArD3LcWvYmWjwx45jhK+ae3zLg9WD2M4LQSpTyeryW4N4J2RiZAv6taE MaghY52sMQ9WsL7LlMMg9FgnB9kHr0RXGoDa44DfP9XBhEbdzE6MuTh0SjiB9Q61dmpWUq p2tD2FmFNSycqZ2mhBGF8N0ODXxw6qo= X-MC-Unique: D9q3N3SiO3CNFhYxZIqAkA-1 X-MC-Unique: UCgGj6VgNGuwkzM-2VSD-Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=poSdcbzQKSdRWDxOewcD2oAfw5WfKnxqJKfQxlKYPQg=; b=FkMoIXzFj/VcntEiaAoRVPnPvA7KQomp+LcjWnIE/BSUH6ifLcHYkN/Yts+sBb3BId 4h5C5b5IsmUcaTII9EaIyZXqmNbz1Cvje1G81SHsTDVAQz+WqpkpFppFb4vHRSisjSxb 1XIVVeCW7CIkIrxo+eEjb5Ju45KVUSAKAPxecPn/RX9ERMktPTv2TPMVsTVfhXyhjnAx jl/9qKTFV/mxM/FBhuTtoayWD81rqVGwR24ZGfsxsY5by1t/JLUi9by3TuxBmNTRkafA yUan3DDyZAMXaTR9fNgqPXVYI2lJWmrlaLP47e7Cl6rR7z+eemcgbvlr+ecG++P94cwG 2CMg== X-Gm-Message-State: AOAM532qY9vdfMdkGqW50eVpZRwQy18Cqv5mSq2gvMYnz4gjd1RnZIf3 F+hQgDA1oktuy/bVimV/ak9UC51M X-Google-Smtp-Source: ABdhPJxNMuZ1c9Tl5QZwGXIovU6jxPm57V1DRG/A5ySeLVSoYpdHooqOPOQGcHfAfPbIuVxkKvmYvA== X-Received: by 2002:a37:7603:: with SMTP id r3mr6585253qkc.243.1590009160743; Wed, 20 May 2020 14:12:40 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 17/21] qemu: hotplug: Prevent updates to multifunction device Date: Wed, 20 May 2020 18:11:39 -0300 Message-Id: <20200520211143.2980117-18-danielhb413@gmail.com> In-Reply-To: <20200520211143.2980117-1-danielhb413@gmail.com> References: <20200520211143.2980117-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , sbhat@linux.ibm.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Shivaprasad G Bhat PCI hostdevs once part of the domain can't be changed. Signed-off-by: Shivaprasad G Bhat Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3217d93a73..ce44a1455a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8889,6 +8889,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr d= om, virDomainObjPtr vm =3D NULL; qemuDomainObjPrivatePtr priv; virDomainDefPtr vmdef =3D NULL; + virDomainDeviceDefListPtr devlist; + virDomainDeviceDefListData data =3D {.xmlopt =3D driver->xmlopt}; virDomainDeviceDefPtr dev =3D NULL, dev_copy =3D NULL; bool force =3D (flags & VIR_DOMAIN_DEVICE_MODIFY_FORCE) !=3D 0; int ret =3D -1; @@ -8906,6 +8908,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr d= om, if (!(vm =3D qemuDomainObjFromDomain(dom))) goto cleanup; =20 + data.def =3D vm->def; + priv =3D vm->privateData; =20 if (virDomainUpdateDeviceFlagsEnsureACL(dom->conn, vm->def, flags) < 0) @@ -8921,12 +8925,20 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr= dom, !(flags & VIR_DOMAIN_AFFECT_LIVE)) parse_flags |=3D VIR_DOMAIN_DEF_PARSE_INACTIVE; =20 - dev =3D dev_copy =3D virDomainDeviceDefParse(xml, vm->def, - driver->xmlopt, priv->qemuCap= s, - parse_flags); - if (dev =3D=3D NULL) + + devlist =3D qemuDomainDeviceParseXMLMany(xml, &data, priv->qemuCaps, + parse_flags); + if (!devlist) goto endjob; =20 + if (devlist->count > 1) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("Update of multifunction devices is not supported= ")); + goto endjob; + } + + dev =3D dev_copy =3D devlist->devs[0]; + if (flags & VIR_DOMAIN_AFFECT_CONFIG && flags & VIR_DOMAIN_AFFECT_LIVE) { /* If we are affecting both CONFIG and LIVE --=20 2.26.2