From nobody Sat Apr 20 02:35:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573132757; cv=none; d=zoho.com; s=zohoarc; b=duntcWMouTF0px8v+knaEZ90R2hQsJNRmwO2MEcIrf1MYDYFDayjIJIPnZgreoECo3+ccTOCIcstQaqI8iC/puS2lt2rFFfjT3t6I6L41xmACcoKcm6WEmntoWg4+6HTWFfQWTV9kka7YuoeWX9ogC5CSJlaqgUyqU5TT+FRa4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573132757; h=Content-Type:Content-Transfer-Encoding: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=wBd9ZPYvAMRYa1hgXbbxv4P0dzVx4p5+OIOQ52uNsEg=; b=cLDbzYVYMHu89Km3Ay0plSvxFEivjc/fnK4vf5Cm4PdZuoZUdtOVUFqaiF//lWmEMBq8f3D2PQmPiFilbPYfCqHFkCMLWM0qIi9ii/7hOGTp3YQ1pPXud8J2pGI+jHLKh+MMIJVupBiZcbVEHDdwG++/LJEHKGbMxygOJnVnBvs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1573132757654995.488057103058; Thu, 7 Nov 2019 05:19:17 -0800 (PST) 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-331-6VgcKo1EMqqUVBYE_XwJ2A-1; Thu, 07 Nov 2019 08:19:14 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C07968017DD; Thu, 7 Nov 2019 13:19:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C52C3608B3; Thu, 7 Nov 2019 13:19:08 +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 BC85018089C8; Thu, 7 Nov 2019 13:19:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xA7DJ68A024947 for ; Thu, 7 Nov 2019 08:19:06 -0500 Received: by smtp.corp.redhat.com (Postfix) id E1BC9600D1; Thu, 7 Nov 2019 13:19:06 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AC3D600CE for ; Thu, 7 Nov 2019 13:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573132756; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=wBd9ZPYvAMRYa1hgXbbxv4P0dzVx4p5+OIOQ52uNsEg=; b=BoTnrxHusvE+ufJfZBlPEECLXozb99vbZjqNt0JClEk1plGwyz7MR9m4aigbBAjqDKbu3N 8hovob9OBJ+ZXILXXIyWVYaac/Iz5qJ+sgTkGmgIgMtROGkwlhb5AYe6PeQXxCEiF5bRnx fSWasXmWu4a3VSLmVh0Qq2c87FGGIk0= From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 7 Nov 2019 14:18:59 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: Warn on possibly incorrect usage of EnterMonitor* 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.13 X-MC-Unique: 6VgcKo1EMqqUVBYE_XwJ2A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The qemuDomainObjEnterMonitor() should not be called from without a job set. Catch this error and produce a warning message if such call occurred. Signed-off-by: Michal Privoznik Reviewed-by: Jonathon Jongsma --- src/qemu/qemu_domain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 667cc89072..4661deb027 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8682,6 +8682,11 @@ qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr d= river, } else if (priv->job.asyncOwner =3D=3D virThreadSelfID()) { VIR_WARN("This thread seems to be the async job owner; entering" " monitor without asking for a nested job is dangerous"); + } else if (priv->job.owner !=3D virThreadSelfID()) { + VIR_WARN("Entering a monitor without owning a job. " + "Job %s owner %s (%llu)", + qemuDomainJobTypeToString(priv->job.active), + priv->job.ownerAPI, priv->job.owner); } =20 VIR_DEBUG("Entering monitor (mon=3D%p vm=3D%p name=3D%s)", --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat Apr 20 02:35:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573132757; cv=none; d=zoho.com; s=zohoarc; b=ZQ57H092E0wlmonN8ue4EWtqp9YNdY8NGYKzmP5EzI2qEfD7rV5Y6RcZ45a3GvbMmkDEH1UgeiuS1yOSMSAKwDx/X363CzSnanofoRs8ymxml0CFpEbIJI576NJDaas6LDc1INfMe6EfNdODeZ9A1ytFgvwsNbenqSEZz+5r+bU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573132757; h=Content-Type:Content-Transfer-Encoding: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=F1jaKSegaKh8w6syit/wmefPjBEeZNZvRtQEEPCzO74=; b=lbl4s3gtXN2B4op75uSU7l9+ExCNwY6rNKQIw6/NLr2DrHyJODbac4qD/lH3YeNv+CUzU+4PlOIjmh6/PD7EJQb0Plaevo/y1jIkE4lkeZDT15pCr3CuubF8GchGiMCDYdQoIEOs32tWN76hjDRqrCoWnGFZaDJ5XsX+sDjhq5k= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 157313275763341.308073438482666; Thu, 7 Nov 2019 05:19:17 -0800 (PST) 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-180-Al8nnZDePZ6Rb4EA4nZLYQ-1; Thu, 07 Nov 2019 08:19:14 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E55DC1800DFB; Thu, 7 Nov 2019 13:19:09 +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 95AB3600CE; Thu, 7 Nov 2019 13:19:09 +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 082204BB5C; Thu, 7 Nov 2019 13:19:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xA7DJ7Bv024955 for ; Thu, 7 Nov 2019 08:19:07 -0500 Received: by smtp.corp.redhat.com (Postfix) id AE39B600D5; Thu, 7 Nov 2019 13:19:07 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37E79600CE for ; Thu, 7 Nov 2019 13:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573132756; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=F1jaKSegaKh8w6syit/wmefPjBEeZNZvRtQEEPCzO74=; b=K95niY/ZG1431x2PsOTdWFWEA/r41zdTPIhBky5tU6vSkeUbN2mS9ditDHyGq5bLp8SbL9 T9O+xOe0/yetJkKd6Ieq6wYc2sosgutp1vDeEl8l6Sh/ghbJC5D5mxVRexbXvwJg+zUs42 UnP/z0/G+q/bKi46ZFT5LttazpW1+5w= From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 7 Nov 2019 14:19:00 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: Check for job being set when getting iothread stats 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.11 X-MC-Unique: Al8nnZDePZ6Rb4EA4nZLYQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The qemuDomainGetStatsIOThread() accesses the monitor by calling qemuDomainGetIOThreadsMon(). And it's also marked as "need monitor" in qemuDomainGetStatsWorkers[]. However, it's not checking if acquiring job was successful. Signed-off-by: Michal Privoznik Reviewed-by: Jonathon Jongsma --- src/qemu/qemu_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d17c18705b..146b4ee319 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -21194,7 +21194,7 @@ static int qemuDomainGetStatsIOThread(virQEMUDriverPtr driver, virDomainObjPtr dom, virTypedParamListPtr params, - unsigned int privflags G_GNUC_UNUSED) + unsigned int privflags) { qemuDomainObjPrivatePtr priv =3D dom->privateData; size_t i; @@ -21202,7 +21202,7 @@ qemuDomainGetStatsIOThread(virQEMUDriverPtr driver, int niothreads; int ret =3D -1; =20 - if (!virDomainObjIsActive(dom)) + if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom)) return 0; =20 if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD)) --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list