From nobody Sun May 12 19:29:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1645610309; cv=none; d=zohomail.com; s=zohoarc; b=AGW50fOSDgUBLTYo9DUdGqKoRyqOn8gtotIAIAMRN2sD36fCap9lzioN7By+6DTAg1Do8XTH/R6ZlKbgIarxtecBtB1DeutZKflof9CRxlsTY4nEpz8yM9nWeLOgTCP8J5IMnCN9G7gGbFyB0u4ThRhpztg/ax+1AGEtoZJRJS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645610309; 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=aFShA5HWZucHzgGoE+U26IcMUguwdmcVH3jyn/JrA8Q=; b=cqwNLfMklNdo2wUkmrF9U5IzpEq4JNeIkSNRwMmiVCc8I4pyi0fmydfpPSL65evoxm9VGiWEi1XqGGxq/OXwcNxAnTLTamK5Z0cYR8yy/UZUMN6JCgax+1NKj0YnJVQ+letSMJ8zNFp2zJ8I5jab0PjIUdlAUyS3f+yGb9BWBNU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645610309342770.3447712613361; Wed, 23 Feb 2022 01:58:29 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-444-yizqTg3PP-q1JI83iXNwAw-1; Wed, 23 Feb 2022 04:58:24 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46A531091DA4; Wed, 23 Feb 2022 09:58:19 +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 D121F7B6FB; Wed, 23 Feb 2022 09:58:18 +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 00AA71809CB3; Wed, 23 Feb 2022 09:58:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21N9uFrt002340 for ; Wed, 23 Feb 2022 04:56:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6CC54492D4C; Wed, 23 Feb 2022 09:56:15 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68B1E492D4A for ; Wed, 23 Feb 2022 09:56:15 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4EAA585A5A8 for ; Wed, 23 Feb 2022 09:56:15 +0000 (UTC) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-211-eY1yjEqCNyuISjqVGsPN8w-1; Wed, 23 Feb 2022 04:56:13 -0500 Received: by mail-ed1-f70.google.com with SMTP id m12-20020a056402510c00b00413298c3c42so2124676edd.15 for ; Wed, 23 Feb 2022 01:56:13 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id nc33sm311916ejc.169.2022.02.23.01.56.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 01:56:12 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 7BADD4A56331 for ; Wed, 23 Feb 2022 10:56:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645610308; 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=aFShA5HWZucHzgGoE+U26IcMUguwdmcVH3jyn/JrA8Q=; b=PJjMItPDqEULFaWdCAuECuFvqpbUMjChO6FCol8vTzubMB2GizapkdKHLxJCXPpoCU0oWP A8huUNKyj3AojIukt4TYg1KSEp2cOuzTMbHoXN/EzGYouU9iF/DGaL9ORXd3SGXgQYSQh0 NSk0GVMOJ7pB50SBr9Z7JEi4bsHMYCQ= X-MC-Unique: yizqTg3PP-q1JI83iXNwAw-1 X-MC-Unique: eY1yjEqCNyuISjqVGsPN8w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=aFShA5HWZucHzgGoE+U26IcMUguwdmcVH3jyn/JrA8Q=; b=7Y92ABcPloi0pdHcSB6qh1ziUbBt3ZoHhrkoQLYVRlSyVMxzrFBryF832NUcK3AYSS rXveBTCrXppvIeEGyLu60now4plFP81Vk+xJWjdCqGSQffqM8Or8BgAR61jDQPnd+x2A c0HyEmnvJNgTFsJtpUWjh/VwFhLg38lZb3Mq5ujWr8/r/uJ7guWmQKYDQcRSNDEEIgzU n6GP3Ey593g8sAXDy29uP3DoSdTcSdhy5fsssBy4xDwMUvY3/Go51ixLNZmiiPHbNhrC C9UVStwo5KmcYZUG8IVThhTKe7QAaZ1Mxah/Vj0phZthGRl3XUuqtu+y0D2uxMLm3puZ ruqA== X-Gm-Message-State: AOAM533FQojz6sYDa0Z3YXae4X5AQIV1EEU6+uWX2JJ+YqVG6Au3mMTO w1Uo71B79oxRsuKVt63/vBA/4/qaVikHNpMQj9H4HKT8E4vzpe/XQBUk9CC2uMi2hl6sNfG+sSv mA4WQfbtGVW6n7wD5ro0Kw4UokfpsgrGKorqJZrXQ3pP36cpYu62GDzYkerQsckXxQMht6lE= X-Received: by 2002:a05:6402:51ca:b0:412:d1b2:496d with SMTP id r10-20020a05640251ca00b00412d1b2496dmr23184825edd.18.1645610172815; Wed, 23 Feb 2022 01:56:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBJrR/QSa3vAglsOMvfzyqlSPYuxxXS8ldcxuR8mluvV3nllypJMGZjcnxzRKoZvOtZIO+lw== X-Received: by 2002:a05:6402:51ca:b0:412:d1b2:496d with SMTP id r10-20020a05640251ca00b00412d1b2496dmr23184808edd.18.1645610172555; Wed, 23 Feb 2022 01:56:12 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [libvirt PATCH] util: Fix machined servicename Date: Wed, 23 Feb 2022 10:56:11 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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.16 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) X-ZM-MESSAGEID: 1645610311915100001 Content-Type: text/plain; charset="utf-8" Commit 4e42686adef8 wrongly assumed how g_variant_new_parsed() works and br= oke starting of domains on systems with systemd (machined). Signed-off-by: Martin Kletzander Reviewed-by: Jiri Denemark --- src/util/virsystemd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 0554884811a7..18bf2932a426 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -360,6 +360,7 @@ int virSystemdCreateMachine(const char *name, g_autofree char *creatorname =3D NULL; g_autofree char *slicename =3D NULL; g_autofree char *scopename =3D NULL; + g_autofree char *servicename =3D NULL; static int hasCreateWithNetwork =3D 1; =20 if ((rc =3D virSystemdHasMachined()) < 0) @@ -369,6 +370,7 @@ int virSystemdCreateMachine(const char *name, return -1; =20 creatorname =3D g_strdup_printf("libvirt-%s", drivername); + servicename =3D g_strdup_printf("virt%sd.service", drivername); =20 if (partition) { if (!(slicename =3D virSystemdMakeSliceName(partition))) @@ -440,11 +442,10 @@ int virSystemdCreateMachine(const char *name, gnicindexes =3D g_variant_new_fixed_array(G_VARIANT_TYPE("i"), nicindexes, nnicindexes, s= izeof(int)); gprops =3D g_variant_new_parsed("[('Slice', <%s>)," - " ('After', <['libvirtd.service']>)," - " ('After', <['virt%sd.service']>)," + " ('After', <['libvirtd.service', %s= ]>)," " ('Before', <['virt-guest-shutdown.= target']>)]", slicename, - drivername); + servicename); message =3D g_variant_new("(s@ayssus@ai@a(sv))", name, guuid, @@ -490,11 +491,10 @@ int virSystemdCreateMachine(const char *name, guuid =3D g_variant_new_fixed_array(G_VARIANT_TYPE("y"), uuid, 16, sizeof(unsigned char)); gprops =3D g_variant_new_parsed("[('Slice', <%s>)," - " ('After', <['libvirtd.service']>)," - " ('After', <['virt%sd.service']>)," + " ('After', <['libvirtd.service', %s= ]>)," " ('Before', <['virt-guest-shutdown.= target']>)]", slicename, - drivername); + servicename); message =3D g_variant_new("(s@ayssus@a(sv))", name, guuid, --=20 2.35.1