From nobody Sun Apr 28 08:15:57 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150637252879894.34230739843974; Mon, 25 Sep 2017 13:48:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 35E137F772; Mon, 25 Sep 2017 20:48:47 +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 50BDD6031E; Mon, 25 Sep 2017 20:48:45 +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 E2BF0410B2; Mon, 25 Sep 2017 20:48:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8PKboXg030504 for ; Mon, 25 Sep 2017 16:37:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 15F6469719; Mon, 25 Sep 2017 20:37:50 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FF306971C; Mon, 25 Sep 2017 20:37:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 35E137F772 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 25 Sep 2017 22:37:40 +0200 Message-Id: <7ebdaa52abb13b24826f90c25ae43d96dc2eb9f3.1506371847.git.pkrempa@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH] qemu: hotplug: Ignore cgroup errors when hot-unplugging vcpus 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 25 Sep 2017 20:48:47 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When the vcpu is successfully removed libvirt would remove the cgroup. In cases when removal of the cgroup fails libvirt would report an error. This does not make much sense, since the vcpu was removed and we can't really do anything with the cgroup. This patch silences the errors from cgroup removal. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1462092 Reviewed-by: John Ferlan --- src/qemu/qemu_hotplug.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 7592049ea..4913e18e6 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5322,6 +5322,7 @@ qemuDomainRemoveVcpu(virQEMUDriverPtr driver, qemuDomainVcpuPrivatePtr vcpupriv =3D QEMU_DOMAIN_VCPU_PRIVATE(vcpuinf= o); int oldvcpus =3D virDomainDefGetVcpus(vm->def); unsigned int nvcpus =3D vcpupriv->vcpus; + virErrorPtr save_error =3D NULL; size_t i; if (qemuDomainRefreshVcpuInfo(driver, vm, QEMU_ASYNC_JOB_NONE, false) = < 0) @@ -5346,11 +5347,12 @@ qemuDomainRemoveVcpu(virQEMUDriverPtr driver, virDomainAuditVcpu(vm, oldvcpus, oldvcpus - nvcpus, "update", true); - for (i =3D vcpu; i < vcpu + nvcpus; i++) { - vcpuinfo =3D virDomainDefGetVcpu(vm->def, i); - if (virCgroupDelThread(priv->cgroup, VIR_CGROUP_THREAD_VCPU, i) < = 0) - return -1; - } + virErrorPreserveLast(&save_error); + + for (i =3D vcpu; i < vcpu + nvcpus; i++) + ignore_value(virCgroupDelThread(priv->cgroup, VIR_CGROUP_THREAD_VC= PU, i)); + + virErrorRestore(&save_error); return 0; } --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list