From nobody Sat Apr 27 09:09:17 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1588317026; cv=none; d=zohomail.com; s=zohoarc; b=gMas+Yk4MS3BZOC3GCs2lckGbZwD0Yn6rBQs6s0sia7P9H3og6y4IowMegAIctBschSmBXm3Es13/fW4vYEhi6KWJrQxsBRj8N2Yn4Agje9V8FylJ801FBzs1tIFQLqlS4lPC1JUeBzpQGVMZWwkblswzXmkK+8KSml3+l2NHw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588317026; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=m8rTS6NKS6DDKnD2ZxrK0b3+CtYOPHiLrXa1bx9MuKU=; b=g79P9RBYjub7FyzZAm8cJLX9Y+UteVLU+dxRaaWhGxfyQvWNk5ysFZdzEhrRhMX4XnX02nT0Hj3RuVfHirHawMDUIBepPdkcqD1234ehyMdSHLOKQkMbvHpsPyoWjVB4DZpkvIPzhMvrUQDXhwlY7g0zXG05dmUXnIrVqy2p1As= 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 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1588317026834778.410165311767; Fri, 1 May 2020 00:10:26 -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-296-sgmikBD4MZOOGEngP3i33g-1; Fri, 01 May 2020 03:10:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A1729107ACF8; Fri, 1 May 2020 07:10:15 +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 0E0CE5D9CA; Fri, 1 May 2020 07:10:12 +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 6E6D11809543; Fri, 1 May 2020 07:10:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0417A4xc012285 for ; Fri, 1 May 2020 03:10:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 117AD2156A3A; Fri, 1 May 2020 07:10:04 +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 0CB252166BA4 for ; Fri, 1 May 2020 07:10:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 B533E8007DB for ; Fri, 1 May 2020 07:10:01 +0000 (UTC) Received: from obrelay04.is.kks.yahoo.co.jp (obrelay04.is.kks.yahoo.co.jp [114.111.94.245]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-35-CXJVammTNrKdDs7AUdsCwQ-1; Fri, 01 May 2020 03:09:58 -0400 Received: from corp-ob05.is.ssk.ynwp.yahoo.co.jp (corp-ob05.is.ssk.ynwp.yahoo.co.jp [182.22.89.22]) by obrelay04.is.kks.yahoo.co.jp (Mailer-Daemon) with ESMTP id 04179sEL032524 for ; Fri, 1 May 2020 16:09:54 +0900 Received: from yjwex2cas01.yjoffice.local (yjwex2cas01.is.bbt.yahoo.co.jp [172.22.15.53]) by corp-ob05.is.ssk.ynwp.yahoo.co.jp (Postfix) with ESMTP id 3F96C12004D for ; Fri, 1 May 2020 16:09:54 +0900 (JST) Received: from yjwex2cas01.yjoffice.local (172.22.15.53) by yjwex2cas01.yjoffice.local (172.22.15.53) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 1 May 2020 16:09:54 +0900 Received: from yjwex2edge03.yjoffice.local (103.2.245.143) by yjwex2cas01.yjoffice.local (172.22.15.52) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Fri, 1 May 2020 16:09:54 +0900 Received: from JPN01-TY1-obe.outbound.protection.outlook.com (104.47.93.57) by yjwex2edge03.yahoo-corp.jp (103.2.245.143) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 1 May 2020 16:09:05 +0900 Received: from TYXPR01MB1648.jpnprd01.prod.outlook.com (52.133.166.19) by TYXPR01MB1871.jpnprd01.prod.outlook.com (52.133.166.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Fri, 1 May 2020 07:09:53 +0000 Received: from TYXPR01MB1648.jpnprd01.prod.outlook.com ([fe80::4da5:19d6:fd6b:f9c8]) by TYXPR01MB1648.jpnprd01.prod.outlook.com ([fe80::4da5:19d6:fd6b:f9c8%4]) with mapi id 15.20.2937.028; Fri, 1 May 2020 07:09:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588317025; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=m8rTS6NKS6DDKnD2ZxrK0b3+CtYOPHiLrXa1bx9MuKU=; b=Mp6vG2TVkDRjUZvSnflZM7e1Wbk+Gv0C/S6b1EZiUhidL7pKPyAGU6gNalJ6Pa5HQiNxJP bVMjyO658FmHYl/tB9zGJkW2qv7sEu0+TBhHobfq3dfAE4yMr8TrOJAr1TQSfOa72hFcU8 X2aJyqmLOd+cxdQ59zp2QdLE/OZ4s3Y= X-MC-Unique: sgmikBD4MZOOGEngP3i33g-1 X-MC-Unique: CXJVammTNrKdDs7AUdsCwQ-1 From: MIKI Nobuhiro To: Subject: [PATCH] conf: Add qemu_job_wait_time option Date: Fri, 1 May 2020 16:09:04 +0900 Message-ID: <1588316944-11240-1-git-send-email-nmiki@yahoo-corp.jp> X-Originating-IP: [211.14.8.234] X-ClientProxiedBy: TY2PR02CA0016.apcprd02.prod.outlook.com (2603:1096:404:56::28) To TYXPR01MB1648.jpnprd01.prod.outlook.com (2603:1096:403:c::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10e70e12-0d18-49f0-f38e-08d7ed9ea57a X-MS-TrafficTypeDiagnostic: TYXPR01MB1871: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0390DB4BDA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYXPR01MB1648.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(366004)(39860400002)(396003)(346002)(376002)(86362001)(186003)(36756003)(8676002)(6666004)(107886003)(6506007)(316002)(2906002)(478600001)(6486002)(6916009)(66946007)(2616005)(6512007)(52116002)(66476007)(66556008)(5660300002)(4326008)(26005)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cw2OeOFhaSSp+Q0omGSJcAv46J7DfRU+0kBXXYH1B3qi3cH1HoswEyoVDkveh1yy0OjDzF2Yw5Xh41vD5vI5K7HtpRMcm0Bj4aKJSGtTPOqOa5PRwyzHECnn0Tsqs3VldWghyTc54jULfAg5UjcZtdo9Z6CL1jF9NgHZVdKJ5eQrqyRrkeekZ99PO2gWrd25N7sKvcAulJmbZxTXtUjNdHCxk1Q8NioJEzfGX3aM08DDJYoZ4e+POHF2qz0bKFDk62bRfJxjugCDyfLQU5bprkjXR9qhXWJ36PsmxxHvdZZXtTaR/j0P55R9WPlfqCKSa1OnPcfCl6fhB9by7CnoWj2g7KomNyN5Nzwv5QhDcQPT6UW9JC4BfvF9nDdlf1yBKPyXr1RxYLfkP2v7eKv/6Q7kzrdk0d2F4IKlnU4D71qK3RYWhf01mnBirr1Bp4tF X-MS-Exchange-AntiSpam-MessageData: IztT0loCZajpH4dsxB+KzOqhoi0NXmLmV5MqDUHFeXVLGkpYbcJGSJMJzBlQSbbBKmrZdDv3QzlFcRTq+XYR84cAI2K+Aqw8GpWFoLcivRo6SXSPWOj4okBVH/j5fdKAdwu960vEzFVYXwZLW/JS7fBKsqen6BXze+tVwiO1Ez5r5rrP4enquOSDQ4SOEhUn3w5EZtkVKDlZRDao9F1OQwY25ej3kKex+0vLuoQ1n5c5tGkzFD38rVwOJMdVpZG9FXTM5RYhvo1ZdOYXgOi9i1jVstEH3c790zpLohS/kCH4BXw3wzakrqeG4TT42RxJUcTRfFYvyX+yKlF+CCI52xzauTYCUIJgt9EZQl3q4Lpw3c1tor6y615jvyKa3ssY5rcAQzr4oMC34H2TPWsoh9YboF/qBf/TUeKcDryjuECKhzVpb9mOBAfvdny4b428Jz7F7BT7M7ZY0ucEdcNJeO5Q1ZAqK0n71snYbGUnWgIl8OxD4eWMCLpAGjT1doYGhlrcBU5u/DkPeQJsxeWGYeegRNCrc7jK5jDy8tH+op1swAh5lEdya6anbtlHEhVZaZQ6uK/uZuk3OpdQoC0q/jHiSkuJJzQE2YSu1Z2ndO1ZXjtPHD1lo0Zsa4Ze6WBWdqrv8nzlrvdELE/I57Ztx/MzxEQsRpHHI6DEVy0QBRVkl5w7QioEd4/dqlRtYBlfGrt2AB0EXuEo5QSlA0hDwhT2qFUFLfcHUkjxez5NcRUR9XofrqZnvHaJ8smiNBlXFhqgynr7cTmgtDOlAujAsMvAQdf8cK2PGQ8jH7Opz9I= X-MS-Exchange-CrossTenant-Network-Message-Id: 10e70e12-0d18-49f0-f38e-08d7ed9ea57a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2020 07:09:53.4078 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a208d369-cd4e-4f87-b119-98eaf31df2c3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s5/C8MfYMSsaw/pbzTd42vf8JyzYLWpL92D7mZE4DBaWaSz4EaJO53X3RT/LiAd9Aa+Z0F9kpY0oRLELK0nHDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYXPR01MB1871 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0417A4xc012285 X-loop: libvir-list@redhat.com Cc: MIKI Nobuhiro 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.14 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" The waiting time to acquire the lock times out, which leads to a segment fa= ult. In essence we should make improvements around locks, but as a workaround we will change the timeout to allow the user to increase it. This value was defined as 30 seconds, so use it as the default value. The logs are as follows: ``` Timed out during operation: cannot acquire state change lock \ (held by monitor=3DremoteDispatchDomainCreateWithFlags) libvirtd.service: main process exited, code=3Dkilled,status=3D11/SEGV ``` Signed-off-by: MIKI Nobuhiro --- docs/news.xml | 9 +++++++++ src/qemu/libvirtd_qemu.aug | 1 + src/qemu/qemu.conf | 3 +++ src/qemu/qemu_conf.c | 3 +++ src/qemu/qemu_conf.h | 2 ++ src/qemu/qemu_domain.c | 7 ++----- src/qemu/test_libvirtd_qemu.aug.in | 1 + 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/news.xml b/docs/news.xml index 80819ae..3755c49 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -119,6 +119,15 @@ Bounds Checking) and IBS (Indirect Branch Speculation). + + + conf: Add job wait time setting to qemu.conf + + + How many seconds the new job waits for the existing job to finis= h. + This only affects if you are using qemu as driver. + +
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index 404498b..76c896e 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -97,6 +97,7 @@ module Libvirtd_qemu =3D | bool_entry "dump_guest_core" | str_entry "stdio_handler" | int_entry "max_threads_per_process" + | int_entry "qemu_job_wait_time" =20 let device_entry =3D bool_entry "mac_filter" | bool_entry "relaxed_acs_check" diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf index abdbf07..a05aaa5 100644 --- a/src/qemu/qemu.conf +++ b/src/qemu/qemu.conf @@ -612,6 +612,9 @@ # #max_threads_per_process =3D 0 =20 +# How many seconds the new job waits for the existing job to finish. +#qemu_job_wait_time =3D 30 + # If max_core is set to a non-zero integer, then QEMU will be # permitted to create core dumps when it crashes, provided its # RAM size is smaller than the limit set. diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index c598240..34d29ec 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -272,6 +272,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged, cfg->keepAliveInterval =3D 5; cfg->keepAliveCount =3D 5; cfg->seccompSandbox =3D -1; + cfg->qemuJobWaitTime =3D 30; =20 cfg->logTimestamp =3D true; cfg->glusterDebugLevel =3D 4; @@ -655,6 +656,8 @@ virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfig= Ptr cfg, return -1; if (virConfGetValueUInt(conf, "max_threads_per_process", &cfg->maxThre= adsPerProc) < 0) return -1; + if (virConfGetValueUInt(conf, "qemu_job_wait_time", &cfg->qemuJobWaitT= ime) < 0) + return -1; =20 if (virConfGetValueType(conf, "max_core") =3D=3D VIR_CONF_STRING) { if (virConfGetValueString(conf, "max_core", &corestr) < 0) diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index b9ef455..49dd7b6 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -218,6 +218,8 @@ struct _virQEMUDriverConfig { gid_t swtpm_group; =20 char **capabilityfilters; + + unsigned int qemuJobWaitTime; }; =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUDriverConfig, virObjectUnref); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d63ec23..4badc0f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6212,9 +6212,6 @@ qemuDomainObjCanSetJob(qemuDomainObjPrivatePtr priv, priv->job.agentActive =3D=3D QEMU_AGENT_JOB_NONE)); } =20 -/* Give up waiting for mutex after 30 seconds */ -#define QEMU_JOB_WAIT_TIME (1000ull * 30) - /** * qemuDomainObjBeginJobInternal: * @driver: qemu driver @@ -6225,7 +6222,7 @@ qemuDomainObjCanSetJob(qemuDomainObjPrivatePtr priv, * * Acquires job for a domain object which must be locked before * calling. If there's already a job running waits up to - * QEMU_JOB_WAIT_TIME after which the functions fails reporting + * cfg->qemuJobWaitTime after which the functions fails reporting * an error unless @nowait is set. * * If @nowait is true this function tries to acquire job and if @@ -6272,7 +6269,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, return -1; =20 priv->jobs_queued++; - then =3D now + QEMU_JOB_WAIT_TIME; + then =3D now + 1000ull * cfg->qemuJobWaitTime; =20 retry: if ((!async && job !=3D QEMU_JOB_DESTROY) && diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qe= mu.aug.in index 19da591..b2886df 100644 --- a/src/qemu/test_libvirtd_qemu.aug.in +++ b/src/qemu/test_libvirtd_qemu.aug.in @@ -76,6 +76,7 @@ module Test_libvirtd_qemu =3D { "max_processes" =3D "0" } { "max_files" =3D "0" } { "max_threads_per_process" =3D "0" } +{ "qemu_job_wait_time" =3D "30" } { "max_core" =3D "unlimited" } { "dump_guest_core" =3D "1" } { "mac_filter" =3D "1" } --=20 1.8.3.1