From nobody Sat May 30 15:28:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1779723264; cv=none; d=zohomail.com; s=zohoarc; b=icKAKYLdfsvWQNUEvgwt/JzcakrYxfGATXBviJ9IxebNJpIaB+Lkrvdw/TA5K0AeKVg1F48VbPa/TQiktlBVnRQY5yLaWfl3Eu+DyqXCG07fshUV1QPU7x2K05+x7XVlUy78Gi2kiUzyxE+cXXVbLKP+9I+XgvmuFm6onqQgntg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779723264; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=DupIytylJW35d/WdkOqIlEzBJJYvOor2YT2aJ2rWFVA=; b=OayXYuRmbbtp2xYMZMc7bC+98CiV8GJky+7399NtHsTRCG7GH2SHWXDSIZZTQPmG373x+j2/0pf/i+lHb4kmPu7cUw80CxL7Iw/AHtmoeQRX+QUbfrWM4BJ1CdV2wRrov95LCTqc3GdD6w8rQwfyOOx+04NK5UL/IjF6jywvUv0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1779723264555771.3080024526693; Mon, 25 May 2026 08:34:24 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id E8F0541B98; Mon, 25 May 2026 11:34:23 -0400 (EDT) Received: from [172.19.199.9] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 011C741B6C; Mon, 25 May 2026 11:32:13 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8641B41ADD; Mon, 25 May 2026 11:31:58 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 6E6B9419CA for ; Mon, 25 May 2026 11:31:57 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-246-d-9VlIudPYitS7zHCxqYgA-1; Mon, 25 May 2026 11:31:55 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D123C1956095 for ; Mon, 25 May 2026 15:31:54 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.44.22.11]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2AD84180034E for ; Mon, 25 May 2026 15:31:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_PASS autolearn=no autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779723117; h=from:from: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; bh=DupIytylJW35d/WdkOqIlEzBJJYvOor2YT2aJ2rWFVA=; b=RfUU7zFrlYTqUc7pPeIEA2iB//A6mk/Y/X+GnpY8SpSZc0YhZRFDXDyS+388C0IQY+MLwY xw6NqKi3uSvGdJQO2EIXZOOo6WyCoa3B72cHZTYteCj1kdJqFsfyGPfZ2VJCFoA4rSJhp1 MNeSA84mSRW7TTU6NVprMe5sugKs12k= X-MC-Unique: d-9VlIudPYitS7zHCxqYgA-1 X-Mimecast-MFC-AGG-ID: d-9VlIudPYitS7zHCxqYgA_1779723115 To: devel@lists.libvirt.org Subject: [PATCH 1/2] syntax-check: Add warning about implications of G_REGEX_OPTIMIZE Date: Mon, 25 May 2026 17:31:50 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rgPHL78RDZHcKSwQIvjRQ6g4NAEw8so38-a-SvZn-p0_1779723115 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JUGIZZU6V2MF6N4NZTKRZCS46WZFDACE X-Message-ID-Hash: JUGIZZU6V2MF6N4NZTKRZCS46WZFDACE X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1779723266094154100 Content-Type: text/plain; charset="utf-8" From: Peter Krempa glib's G_REGEX_OPTIMIZE flag for regex operations implies the use of pcre's JIT optimizer for regexes which requires writable executable memory for the optimized code. Security frameworks such as SELinux can restrict program's access to writable executable memory to harden the code. glib's implementation of the regex functions handles downgrade to interpreted evaluation of regexes gracefully if writable executable memory is unavailable, but that is non-obvious and has a performance penalty. Add a syntax check which requires all uses of G_REGEX_OPTIMIZE to be annotated so that the reader of the code can be hinted to why G_REGEX_OPTIMIZE should perhaps be avoided. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- build-aux/syntax-check.mk | 12 ++++++++++++ src/conf/domain_event.c | 2 +- src/util/vircommand.c | 2 +- src/util/virlog.c | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 6e22212944..4ad2a53779 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1387,6 +1387,15 @@ sc_prohibit_inline_functions: halt=3D'avoid inline functions in .c files' \ $(_sc_search_regexp) +# glib's G_REGEX_OPTIMIZE instructs the PCRE library to use JIT optimizati= on +# of the regexes, which requires executable memory to work. Security mecha= nisms +# such as SELinux may disallow it. glib gracefully falls back to un-optimi= zed +# code. This check serves as a warning to not rely on G_REGEX_OPTIMIZE: +sc_G_REGEX_OPTIMIZE: + @prohibit=3D'G_REGEX_OPTIMIZE' \ + exclude=3D'see sc_G_REGEX_OPTIMIZE' \ + halt=3D'Optimizations may not work everywhere. Read the warning in build-= aux/syntax-check.mk' \ + $(_sc_search_regexp) ## ---------- ## ## Exceptions ## @@ -1550,6 +1559,9 @@ exclude_file_name_regexp--sc_spacing-check =3D \ exclude_file_name_regexp--sc_prohibit_inline_functions =3D \ ^src/storage_file/storage_source.*.c$$ +exclude_file_name_regexp--sc_G_REGEX_OPTIMIZE =3D \ + ^build-aux/syntax-check\.mk$$ + ## -------------- ## ## Implementation ## ## -------------- ## diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index a6bf9735aa..434401a5ef 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -2643,7 +2643,7 @@ virDomainQemuMonitorEventStateRegisterID(virConnectPt= r conn, data->flags =3D flags; if (event && flags !=3D -1) { if (flags & VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX) { - int cflags =3D G_REGEX_OPTIMIZE; + int cflags =3D G_REGEX_OPTIMIZE; /* see sc_G_REGEX_OPTIMIZE */ g_autoptr(GError) err =3D NULL; if (flags & VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOC= ASE) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 1a9875fc87..84d4d9c218 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -3270,7 +3270,7 @@ virCommandRunRegex(virCommand *cmd, for (i =3D 0; i < nregex; i++) { g_autoptr(GError) err =3D NULL; - reg[i] =3D g_regex_new(regex[i], G_REGEX_OPTIMIZE, 0, &err); + reg[i] =3D g_regex_new(regex[i], G_REGEX_OPTIMIZE, 0, &err); /* se= e sc_G_REGEX_OPTIMIZE */ if (!reg[i]) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to compile regex %1$s"), err->message= ); diff --git a/src/util/virlog.c b/src/util/virlog.c index 02b8dd1385..8a6cb939bc 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -253,7 +253,7 @@ virLogOnceInit(void) virLogLock(); virLogDefaultPriority =3D VIR_LOG_DEFAULT; - virLogRegex =3D g_regex_new(VIR_LOG_REGEX, G_REGEX_OPTIMIZE, 0, NULL); + virLogRegex =3D g_regex_new(VIR_LOG_REGEX, G_REGEX_OPTIMIZE, 0, NULL);= /* see sc_G_REGEX_OPTIMIZE */ /* GLib caches the hostname using a one time thread initializer. * We want to prime this cache early though, because at later time --=20 2.54.0 From nobody Sat May 30 15:28:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1779723331; cv=none; d=zohomail.com; s=zohoarc; b=ZGNxXI86+XAXRKL1JGCQlmZevIm7x2KCAhqOl7HUHAwxTnUpB9NoXZ+nMydDSMh/Xnmd5Vd8Z5ziRU1V+rfmgqF2MEdVCoMvJDVcv3WIhLNQ+tvz/DTP5aRhEWJpqbOZY3D5KjBgEnQ8FXS7QM1iw9IT5NNwaKstMdL6RjW5tk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779723331; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=Ojw4zMCf1MxHrb7SxjxREcgWBD5Wde3VyIEqxUGMES8=; b=mVMQEW0KvgZ4gx7RufaJw6WqiV8Kv6e30jDoCguoB9vTaAMCO/QyKAy5NgLiF4xycVi1n46I2EfnVKGssVUNZqbRzizcyvylbNGSKyvfTmseLp7mSeMsl53q1CCmwLg4SsokNHDOCeZAASJwEUUWlJnVeFkM4iVvLsbAeuJdIIU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1779723331432923.6832346410165; Mon, 25 May 2026 08:35:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 472F541AFD; Mon, 25 May 2026 11:35:30 -0400 (EDT) Received: from [172.19.199.9] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id D181841CF8; Mon, 25 May 2026 11:32:18 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 705A73F30E; Mon, 25 May 2026 11:31:59 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7C5114197C for ; Mon, 25 May 2026 11:31:58 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-sUHTJMbtMVWgZm5KXESbFA-1; Mon, 25 May 2026 11:31:56 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E9332180034C for ; Mon, 25 May 2026 15:31:55 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.44.22.11]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 43DE01800465 for ; Mon, 25 May 2026 15:31:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779723118; h=from:from: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; bh=Ojw4zMCf1MxHrb7SxjxREcgWBD5Wde3VyIEqxUGMES8=; b=AFew2DzbxxWLdndcz7Kg3bNE43xAj/gN2m9I3HAYCnlQOaitts3AxuvhrXlYUl4GkqFUY6 jYnKOD/zX0FRJ1iY0MyDs4C7xa0Np4p4JzDi13rX79D5ipP7Xi+weljxUhMC9MFxGQxo9b v1F8c2GtjR6o9tZgaIuak/yixunZqGo= X-MC-Unique: sUHTJMbtMVWgZm5KXESbFA-1 X-Mimecast-MFC-AGG-ID: sUHTJMbtMVWgZm5KXESbFA_1779723116 To: devel@lists.libvirt.org Subject: [PATCH 2/2] Avoid use of glib's G_REGEX_OPTIMIZE flag Date: Mon, 25 May 2026 17:31:51 +0200 Message-ID: <4e66b19e6577972ae934c3e55232df6d51af2bcc.1779722846.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: RF8vzIsFYHbuPF38E457nfqUtgmVCZwE1Lq7Nramnxg_1779723116 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7B5ZMWLP7WIPCNSTWFRFZSRV5WRTYXKZ X-Message-ID-Hash: 7B5ZMWLP7WIPCNSTWFRFZSRV5WRTYXKZ X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1779723332155158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa glib's G_REGEX_OPTIMIZE invokes pcre's JIT optimizer which requires writable executable memory. On hosts with SELinux this by default caused AVC denials to be logged. The solution in Fedora's SELinux policy was to allow execmem for e.g. virtqemud, but e.g. virtlogd or libvirt_leaseshelper on the other hand got a 'dontaudit' rule. Now the optimizer itself does have a substantial effect; I've measured around 3x speedup when matching VIR_LOG_REGEX against a sample of a qemu VM log file. On the other hand, only 3 out of 10 uses of 'g_regex_new' used the flag and also none of the regexes which used 'G_REGEX_OPTIMIZE' are on a hot path: - virDomainQemuMonitorEventStateRegisterID Used only when custom qemu monitor event callback is registered, which resides in libvirt_qemu.so so noone will actually use this in production. - virCommandRunRegex Used in: - virStorageBackendFileSystemNetFindNFSPoolSources Invoked only via API on output of 'showmount'. Unlikely to ever see lots of data. - virStorageBackendLogicalFindLVs - virStorageBackendLogicalGetPoolSources - virStorageBackendLogicalRefreshPool Invoked on output of lvs/pvs/vgs. Neither of them are likely to ever see lots of output to match. - virISCSIGetSession - virISCSIScanTargetsInternal Invoked on output of iscsiadm, unlikely to see lots of data. - virLogProbablyLogMessage - virLXCProcessIgnorableLogLine - domainLogContextReadFiltered Both of the above are used on code paths processing log output when failure to startup a VM process or one of the helper processes for devices for a qemu domain. Thus they are not invoked on success and the processed buffer is capped to 1k of data. Since none of the above are on anything resembling a hot path and thus likely to substantially benefit from the optimizer, and we do have plenty of other uses without optimization, drop the optimizations everywhere and add a note to sc_G_REGEX_OPTIMIZE that we're currently avoiding the use of this flag. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- build-aux/syntax-check.mk | 3 ++- src/conf/domain_event.c | 2 +- src/util/vircommand.c | 2 +- src/util/virlog.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 4ad2a53779..a049c47ea7 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1390,7 +1390,8 @@ sc_prohibit_inline_functions: # glib's G_REGEX_OPTIMIZE instructs the PCRE library to use JIT optimizati= on # of the regexes, which requires executable memory to work. Security mecha= nisms # such as SELinux may disallow it. glib gracefully falls back to un-optimi= zed -# code. This check serves as a warning to not rely on G_REGEX_OPTIMIZE: +# code. This check serves as a warning to not rely on G_REGEX_OPTIMIZE. +# Currently we avoid use of G_REGEX_OPTIMIZE anywhere. sc_G_REGEX_OPTIMIZE: @prohibit=3D'G_REGEX_OPTIMIZE' \ exclude=3D'see sc_G_REGEX_OPTIMIZE' \ diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index 434401a5ef..1d9796a1aa 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -2643,7 +2643,7 @@ virDomainQemuMonitorEventStateRegisterID(virConnectPt= r conn, data->flags =3D flags; if (event && flags !=3D -1) { if (flags & VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX) { - int cflags =3D G_REGEX_OPTIMIZE; /* see sc_G_REGEX_OPTIMIZE */ + int cflags =3D 0; g_autoptr(GError) err =3D NULL; if (flags & VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOC= ASE) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 84d4d9c218..984481c613 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -3270,7 +3270,7 @@ virCommandRunRegex(virCommand *cmd, for (i =3D 0; i < nregex; i++) { g_autoptr(GError) err =3D NULL; - reg[i] =3D g_regex_new(regex[i], G_REGEX_OPTIMIZE, 0, &err); /* se= e sc_G_REGEX_OPTIMIZE */ + reg[i] =3D g_regex_new(regex[i], 0, 0, &err); if (!reg[i]) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to compile regex %1$s"), err->message= ); diff --git a/src/util/virlog.c b/src/util/virlog.c index 8a6cb939bc..7e767e8424 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -253,7 +253,7 @@ virLogOnceInit(void) virLogLock(); virLogDefaultPriority =3D VIR_LOG_DEFAULT; - virLogRegex =3D g_regex_new(VIR_LOG_REGEX, G_REGEX_OPTIMIZE, 0, NULL);= /* see sc_G_REGEX_OPTIMIZE */ + virLogRegex =3D g_regex_new(VIR_LOG_REGEX, 0, 0, NULL); /* GLib caches the hostname using a one time thread initializer. * We want to prime this cache early though, because at later time --=20 2.54.0