From nobody Tue Feb 10 04:15:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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=1586208488; cv=none; d=zohomail.com; s=zohoarc; b=d+RL4uFjWo3a8/MrN8gqU5YShPrcV8cpcpFTI8HxD/5SuTv0NoD6OYhgyOTL8ZEKC0xK4kaONTfsr1w+huf0FqA9xN0mfOJsHTBX52iXvs6y8n9SaRCArohrKR4Z1NK40g3HQSUoak2DyuCxGgbsgNJwGjeFp44oWjmc1JZjro0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586208488; 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=6ch4/4wW8DCADmMuD/ywjtaeWb3fFbuQbKCAxu5+XME=; b=LzG0b78ZaC3kP538B9hcvDjNkikQIyAM1EDR418DLO/9lE5nUYDGXTmHYknC6loO+yNvuD3dS163Sv1+Kvm++L3Ud58t+Bw7HNukkqbx+pM8yO9yBY0+8UFb79aubdNokdiVwqbfu1vYynlwn0mqYneC89G9OHJVlOEaruMK3SU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.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 [207.211.31.120]) by mx.zohomail.com with SMTPS id 158620848821227.091896779742342; Mon, 6 Apr 2020 14:28:08 -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-57-sju6xjocOLuPDZwFZgaypA-1; Mon, 06 Apr 2020 17:28:03 -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 0094D149C1; Mon, 6 Apr 2020 21:27:58 +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 CEAD75DA81; Mon, 6 Apr 2020 21:27:57 +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 8436593A70; Mon, 6 Apr 2020 21:27:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 036LRuPh015750 for ; Mon, 6 Apr 2020 17:27:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0B1D5DA81; Mon, 6 Apr 2020 21:27:56 +0000 (UTC) Received: from localhost (unknown [10.36.110.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 90D4D5DA82; Mon, 6 Apr 2020 21:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586208487; 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=6ch4/4wW8DCADmMuD/ywjtaeWb3fFbuQbKCAxu5+XME=; b=Ea8BO7tGzLvE+goreVOlVN11W+9MplCJfWtGrORP4whL1e5VleAnnPWikBmZopJIdJipsm BtYzyKScZCGxVjVWWWrcGq+I2n2RO0Ya4BbhTGJ5u92sbbhqR4DbKpFyZ9u/WZOBKmyz8D CDrIG4X7uUySlvqtM1kKwfC9Xf4Kv+w= X-MC-Unique: sju6xjocOLuPDZwFZgaypA-1 From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Subject: [libvirt PATCH 07/15] dbus: rename virDBusIs* -> virDBusSystemIs* Date: Mon, 6 Apr 2020 23:27:04 +0200 Message-Id: <20200406212712.1315604-8-marcandre.lureau@redhat.com> In-Reply-To: <20200406212712.1315604-1-marcandre.lureau@redhat.com> References: <20200406212712.1315604-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , phrdina@redhat.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.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" From: Marc-Andr=C3=A9 Lureau Those functions talk to system bus and have a special handling of system bus missing. Signed-off-by: Marc-Andr=C3=A9 Lureau --- src/util/virdbus.c | 12 ++++++------ src/util/virdbus.h | 4 ++-- src/util/virfirewalld.c | 2 +- src/util/virsystemd.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/util/virdbus.c b/src/util/virdbus.c index 77691cd2b0..858291e2ba 100644 --- a/src/util/virdbus.c +++ b/src/util/virdbus.c @@ -1700,12 +1700,12 @@ static int virDBusIsServiceInList(const char *listM= ethod, const char *name) } =20 /** - * virDBusIsServiceEnabled: + * virDBusSystemIsServiceEnabled: * @name: service name * * Returns 0 if service is available, -1 on fatal error, or -2 if service = is not available */ -int virDBusIsServiceEnabled(const char *name) +int virDBusSystemIsServiceEnabled(const char *name) { int ret =3D virDBusIsServiceInList("ListActivatableNames", name); =20 @@ -1715,12 +1715,12 @@ int virDBusIsServiceEnabled(const char *name) } =20 /** - * virDBusIsServiceRegistered + * virDBusSystemIsServiceRegistered * @name: service name * * Returns 0 if service is registered, -1 on fatal error, or -2 if service= is not registered */ -int virDBusIsServiceRegistered(const char *name) +int virDBusSystemIsServiceRegistered(const char *name) { int ret =3D virDBusIsServiceInList("ListNames", name); =20 @@ -1843,13 +1843,13 @@ int virDBusMessageDecode(DBusMessage* msg G_GNUC_UN= USED, return -1; } =20 -int virDBusIsServiceEnabled(const char *name G_GNUC_UNUSED) +int virDBusSystemIsServiceEnabled(const char *name G_GNUC_UNUSED) { VIR_DEBUG("DBus support not compiled into this binary"); return -2; } =20 -int virDBusIsServiceRegistered(const char *name G_GNUC_UNUSED) +int virDBusSystemIsServiceRegistered(const char *name G_GNUC_UNUSED) { VIR_DEBUG("DBus support not compiled into this binary"); return -2; diff --git a/src/util/virdbus.h b/src/util/virdbus.h index 083c074d59..b3b0260a4e 100644 --- a/src/util/virdbus.h +++ b/src/util/virdbus.h @@ -70,7 +70,7 @@ int virDBusMessageDecode(DBusMessage *msg, const char *types, ...); void virDBusMessageUnref(DBusMessage *msg); =20 -int virDBusIsServiceEnabled(const char *name); -int virDBusIsServiceRegistered(const char *name); +int virDBusSystemIsServiceEnabled(const char *name); +int virDBusSystemIsServiceRegistered(const char *name); =20 bool virDBusErrorIsUnknownMethod(virErrorPtr err); diff --git a/src/util/virfirewalld.c b/src/util/virfirewalld.c index c14a6b6e65..499f925b7e 100644 --- a/src/util/virfirewalld.c +++ b/src/util/virfirewalld.c @@ -66,7 +66,7 @@ VIR_ENUM_IMPL(virFirewallDBackend, int virFirewallDIsRegistered(void) { - return virDBusIsServiceRegistered(VIR_FIREWALL_FIREWALLD_SERVICE); + return virDBusSystemIsServiceRegistered(VIR_FIREWALL_FIREWALLD_SERVICE= ); } =20 /** diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 1d41ed34f7..9a659dad84 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -157,13 +157,13 @@ virSystemdHasMachined(void) if (val !=3D -1) return val; =20 - if ((ret =3D virDBusIsServiceEnabled("org.freedesktop.machine1")) < 0)= { + if ((ret =3D virDBusSystemIsServiceEnabled("org.freedesktop.machine1")= ) < 0) { if (ret =3D=3D -2) g_atomic_int_set(&virSystemdHasMachinedCachedValue, -2); return ret; } =20 - if ((ret =3D virDBusIsServiceRegistered("org.freedesktop.systemd1")) = =3D=3D -1) + if ((ret =3D virDBusSystemIsServiceRegistered("org.freedesktop.systemd= 1")) =3D=3D -1) return ret; g_atomic_int_set(&virSystemdHasMachinedCachedValue, ret); return ret; @@ -179,14 +179,14 @@ virSystemdHasLogind(void) if (val !=3D -1) return val; =20 - ret =3D virDBusIsServiceEnabled("org.freedesktop.login1"); + ret =3D virDBusSystemIsServiceEnabled("org.freedesktop.login1"); if (ret < 0) { if (ret =3D=3D -2) g_atomic_int_set(&virSystemdHasLogindCachedValue, -2); return ret; } =20 - if ((ret =3D virDBusIsServiceRegistered("org.freedesktop.login1")) =3D= =3D -1) + if ((ret =3D virDBusSystemIsServiceRegistered("org.freedesktop.login1"= )) =3D=3D -1) return ret; =20 g_atomic_int_set(&virSystemdHasLogindCachedValue, ret); --=20 2.26.0.rc2.42.g98cedd0233