From nobody Sun Feb 8 15:42:36 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1701173190194865.024249346966; Tue, 28 Nov 2023 04:06:30 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 8B2A219D0; Tue, 28 Nov 2023 07:06:29 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C445A19A0; Tue, 28 Nov 2023 07:03:10 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id C48081945; Tue, 28 Nov 2023 07:02:46 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 600081942 for ; Tue, 28 Nov 2023 07:02:45 -0500 (EST) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-itMrIw7FOG-xUhhWaUmPlg-1; Tue, 28 Nov 2023 07:02:43 -0500 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a00dd93a5f1so441698266b.2 for ; Tue, 28 Nov 2023 04:02:43 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id v13-20020a170906564d00b00a0ac350f807sm4611200ejr.212.2023.11.28.04.02.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 04:02:41 -0800 (PST) Received: from wheatley.pinto-pinecone.ts.net (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 2DF25173C3C83 for ; Tue, 28 Nov 2023 13:02:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: itMrIw7FOG-xUhhWaUmPlg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701172962; x=1701777762; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2iH88VoMYJHcRGr5nPuKApfFxSRa+KGTYCyJuWakXyQ=; b=bLrnUXhecLCHjZFwSyGVIcTssSyfGy9BtXsE8793VNvXpvYwhQtfTuyHceimE/CnaV ungM77n3DbMWSOhufHMr9HPvP1G9SjTMfYhor8kpQxOLcpXPIr8OmTAmfBeBjSvfOfW1 6Ip4NKyKswufJBnaHxTzX0dUOTRkGNsXkj/VqZDnYCn79/iv4LwM2k/96hINdn/cgdAI IlriHsu8TZ3MwXiSRMpvtFHeHi3zp5EaOgVCMVIy/Lw0PHSYMDB9EKCbNDYqVMpZHONE Zgggwm90HPpWiSW/cmCMpf79ZjBjrw2HcomjA3SNF9vBCzlTPGy5cgRFcloQNINXHfSZ UZrw== X-Gm-Message-State: AOJu0YzkjVKhOi+mJycFxgr8UQwtHZvMukQLVH4v1+06xYJyJ7tLZ97A iG8grQLiX1JKuA8mXv0tOO5BLY8npDwZEeXoXK1m31mMhAjXwXQwI5/ZV+4CrLzbeDqyxo8Q8cr r8b7yAo7q7DMe2mog4FOI9zNhZQOKZ55xXPgNuC047ZZuCWy80Ivi6t+UPUFTscOZ9nlFPstzx2 s54Q== X-Received: by 2002:a17:906:7691:b0:a04:837e:87af with SMTP id o17-20020a170906769100b00a04837e87afmr11205868ejm.33.1701172962446; Tue, 28 Nov 2023 04:02:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEIZ3YMs3B6QKvYAGUspSZjwYu56EivAhXRAi0Dx1xR4R/ldXITPvpPMEK7g3JIQETviJ+LVA== X-Received: by 2002:a17:906:7691:b0:a04:837e:87af with SMTP id o17-20020a170906769100b00a04837e87afmr11205848ejm.33.1701172962052; Tue, 28 Nov 2023 04:02:42 -0800 (PST) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 2/2] Report better error message in remoteGetUNIXSocket Date: Tue, 28 Nov 2023 13:02:40 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: ITFDIOVQUNHMIEXNNA6MAI4VXSOD5753 X-Message-ID-Hash: ITFDIOVQUNHMIEXNNA6MAI4VXSOD5753 X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1701173192111000001 Before this patch users might be confused with the error when no daemon nor systemd socket unit is running due to the error message being a bit vague when running as root with no URI: # virsh list error: failed to connect to the hypervisor error: Operation not supported: Cannot use direct socket mode if no URI is set Instead of merely suggesting to start any daemon, also give a hint as to what socket we have tried looking up: # virsh list error: failed to connect to the hypervisor error: Operation not supported: Cannot connect to '/var/run/libvirt/virtqemud-sock' and no URI is set, is any virt daemon or systemd socket unit started? Resolves: https://issues.redhat.com/browse/RHEL-700 Signed-off-by: Martin Kletzander --- src/remote/remote_sockets.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c index c21970cd31e7..0c0e31e4eb78 100644 --- a/src/remote/remote_sockets.c +++ b/src/remote/remote_sockets.c @@ -311,6 +311,7 @@ remoteGetUNIXSocket(remoteDriverTransport transport, g_autofree char *daemon_name =3D NULL; g_autofree char *direct_sock_name =3D NULL; g_autofree char *legacy_sock_name =3D NULL; + g_autofree char *default_socket =3D NULL; #ifdef REMOTE_DRIVER_AUTOSTART_DIRECT g_autofree char *guessdriver =3D NULL; #endif @@ -345,7 +346,7 @@ remoteGetUNIXSocket(remoteDriverTransport transport, } else { if (remoteProbeSystemDriverFromSocket(flags & REMOTE_DRIVER_OP= EN_RO, &guessdriver, - NULL) < 0) + &default_socket) < 0) return NULL; } driver =3D guessdriver; @@ -404,8 +405,14 @@ remoteGetUNIXSocket(remoteDriverTransport transport, } =20 if (!direct_sock_name) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("Cannot use direct socket mode if no URI is s= et")); + if (default_socket) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("Cannot connect to '%1$s' and no URI is s= et, is any virt daemon or systemd socket unit started?"), + default_socket); + } else { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("Cannot use direct socket mode if no URI = is set")); + } return NULL; } =20 --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org