From nobody Tue Feb 10 01:35:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1586208514; cv=none; d=zohomail.com; s=zohoarc; b=IJk63bxgwnsf0upsGdFClB9Cp5eJR/615O96lnvont3BjUNo+YAjiC6YagXjHv7Bt8+R6MvEeEkLAmtUOl+VIXjcJLUx1mtLDG6ATuQ9zs1Rj0yjoml/r55gomVEYC8/Ly5Ru2IXX1AIjI1i0n2sxlWyXEnVCY8rjhFrXxsGHdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586208514; 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=qVKypYAhQyk5UzAWt/ERnejN7r5X8JHHW4/h5dgPbNY=; b=WgiqgKJROpgEmgnQKhTQ8r1sxCxBJ43yqLBUYF3h3YJNIwbNxkFLeCyEUlfGqE55F6fo0NtPfr3h+56P4oagau5MPqeU/IlamOZl63tElwfGKlvFo3m+IjOsJd10hgVIVInlq55XWri/xvQvnmguYUSXatjvA38KBAcq5RVPaPM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 1586208514558986.6859671401862; Mon, 6 Apr 2020 14:28:34 -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-16-eMqEfWqgMdGL2aYwpPtfpg-1; Mon, 06 Apr 2020 17:28:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7C3B4149C0; Mon, 6 Apr 2020 21:28:25 +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 4F0CB1036D12; Mon, 6 Apr 2020 21:28:25 +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 06B1E93A74; Mon, 6 Apr 2020 21:28:25 +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 036LSOfk015822 for ; Mon, 6 Apr 2020 17:28:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0257C118F4F; Mon, 6 Apr 2020 21:28:24 +0000 (UTC) Received: from localhost (unknown [10.36.110.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0D5C118F51; Mon, 6 Apr 2020 21:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586208513; 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=qVKypYAhQyk5UzAWt/ERnejN7r5X8JHHW4/h5dgPbNY=; b=Mn+A5HTso0VNPOm5WjKscrca4sz73yVlh3Nqhen8hYf6/FkIc7B3CHCSMFFrr9knb0PLHP Rh1wGgpN5+j9pOVbIISKPqQX0/xw4WoeOgxfjbjFfnjsJARE78NFGZZel6AmSa+3h96WfT OCraM6bhaIQp9MW+tDq9+zo+PdCIW5k= X-MC-Unique: eMqEfWqgMdGL2aYwpPtfpg-1 From: marcandre.lureau@redhat.com To: libvir-list@redhat.com Subject: [libvirt PATCH 10/15] systemd: only check for activitable machine1 service Date: Mon, 6 Apr 2020 23:27:07 +0200 Message-Id: <20200406212712.1315604-11-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.11 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.84 on 10.5.11.22 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 The service is started on demand, checking if it's already registered on the bus defeat this purpose. Note: the same is probably true for login1, but I don't intent to look at the code path yet. Signed-off-by: Marc-Andr=C3=A9 Lureau --- src/util/virsystemd.c | 2 -- tests/virsystemdtest.c | 35 ----------------------------------- 2 files changed, 37 deletions(-) diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 74d0d15ca7..14d680532f 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -163,8 +163,6 @@ virSystemdHasMachined(void) return ret; } =20 - if ((ret =3D virDBusSystemIsServiceRegistered("org.freedesktop.machine= 1")) =3D=3D -1) - return ret; g_atomic_int_set(&virSystemdHasMachinedCachedValue, ret); return ret; } diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index 050941dce8..8518805f82 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -260,40 +260,6 @@ static int testCreateNoSystemd(const void *opaque G_GN= UC_UNUSED) return 0; } =20 -static int testCreateSystemdNotRunning(const void *opaque G_GNUC_UNUSED) -{ - unsigned char uuid[VIR_UUID_BUFLEN] =3D { - 1, 1, 1, 1, - 2, 2, 2, 2, - 3, 3, 3, 3, - 4, 4, 4, 4 - }; - int rv; - - g_setenv("FAIL_NOT_REGISTERED", "1", TRUE); - - if ((rv =3D virSystemdCreateMachine("demo", - "qemu", - uuid, - NULL, - 123, - false, - 0, NULL, - NULL, 0)) =3D=3D 0) { - g_unsetenv("FAIL_NOT_REGISTERED"); - fprintf(stderr, "%s", "Unexpected create machine success\n"); - return -1; - } - g_unsetenv("FAIL_NOT_REGISTERED"); - - if (rv !=3D -2) { - fprintf(stderr, "%s", "Unexpected create machine error\n"); - return -1; - } - - return 0; -} - static int testCreateBadSystemd(const void *opaque G_GNUC_UNUSED) { unsigned char uuid[VIR_UUID_BUFLEN] =3D { @@ -698,7 +664,6 @@ mymain(void) DO_TEST("Test create machine ", testCreateMachine); DO_TEST("Test terminate machine ", testTerminateMachine); DO_TEST("Test create no systemd ", testCreateNoSystemd); - DO_TEST("Test create systemd not running ", testCreateSystemdNotRunnin= g); DO_TEST("Test create bad systemd ", testCreateBadSystemd); DO_TEST("Test create with network ", testCreateNetwork); DO_TEST("Test getting machine name ", testGetMachineName); --=20 2.26.0.rc2.42.g98cedd0233