From nobody Thu May 2 18:06:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1604940013; cv=none; d=zohomail.com; s=zohoarc; b=BRVeBE+yjRiO9veoZ8WaKtCSJklho6zmql0pvb06/50XxWxpftpVP8aVFw0cdJwamelg/hPkoZ5+nZUCDWG87BGKfc0NBpM5mrSpBF4enIVBZpclxpaX9QkpMhpkf76SK7RQK1nbJ+iH2Hq4ljv03kZMitJ4PI+DKTEtSdznY1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604940013; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=dfuj2M8jqD4bbgAMmuY8B9AwDfDKuZkJglr4MxkyuRo=; b=JqZyS/y7HurrnC4nI/Dzbiw0msN2ZkCSmDLMwXZc7NXpFi58cq7dx7/evSVQSSDLuolmsw59MBWZHBaLJ92iiKu8FumBl/XgfyFCQLC8v5/a1lbOWEgCwsIFN17YhAUOOi++G3LHruS/bIlOdgntTlmYvkMBHkrnJGIv1AsfI2g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 160494001360084.95656799318294; Mon, 9 Nov 2020 08:40:13 -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-242-b-aPKNCqP-CcboOt4y5b9g-1; Mon, 09 Nov 2020 11:40:10 -0500 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 793651899422; Mon, 9 Nov 2020 16:40:04 +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 50FB55D9DD; Mon, 9 Nov 2020 16:40:04 +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 14BC2CF62; Mon, 9 Nov 2020 16:40:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A9Ge2NG016877 for ; Mon, 9 Nov 2020 11:40:02 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5DFC41002C11; Mon, 9 Nov 2020 16:40:02 +0000 (UTC) Received: from antique-work.redhat.com (ovpn-114-242.ams2.redhat.com [10.36.114.242]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD3C91002C14 for ; Mon, 9 Nov 2020 16:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604940012; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dfuj2M8jqD4bbgAMmuY8B9AwDfDKuZkJglr4MxkyuRo=; b=gwESFGGZx2NLh8Mh4mQVVe91AtdG4v9+Ph+YpevidpvyW//Ax37DBrLQcetYlXU2cyH4uG EUPUYHGnvlfdf3r8sJpKVZhzkwgZCUNlrWdzVnKIqjSyuvOQ8y8G1p+VFbzqr6QZLdrMbu C97PElQcz7kykBclM0zdcMR0B5C+/dc= X-MC-Unique: b-aPKNCqP-CcboOt4y5b9g-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH] virgdbus: fix getting non-shared DBus connection Date: Mon, 9 Nov 2020 17:39:57 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" We need to pass some flags in order to properly initialize the connection otherwise it will not work. This copies what GLib does for g_bus_get_sync() internally. This fixes an issue with LXC driver where libvirt was not able to register any VM with machined. Reported-by: Matthias Maier Signed-off-by: Pavel Hrdina Reviewed-by: J=C3=A1n Tomko --- src/util/virgdbus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/virgdbus.c b/src/util/virgdbus.c index 19fd7e2fe4..4ad1a5c842 100644 --- a/src/util/virgdbus.c +++ b/src/util/virgdbus.c @@ -54,11 +54,15 @@ virGDBusBusInit(GBusType type, GError **error) if (sharedBus) { return g_bus_get_sync(type, NULL, error); } else { + GDBusConnectionFlags dbusFlags =3D + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT | + G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION; + address =3D g_dbus_address_get_for_bus_sync(type, NULL, error); if (*error) return NULL; return g_dbus_connection_new_for_address_sync(address, - G_DBUS_CONNECTION_FL= AGS_NONE, + dbusFlags, NULL, NULL, error); --=20 2.26.2