From nobody Sat Feb 7 08:13:48 2026 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=1674728985; cv=none; d=zohomail.com; s=zohoarc; b=BrWX+RNhB6MluyMwnHTfNQvsFVDYM+cAMSA53c2J6RpUDnbvcIMPmiDPNdNBPcBfJzTt1dHpTNakEEKQeiI+cz0D6XOFJAP4iEjlJZsDJaSgwEKi1mUYW/dIkbZVZu6xUknj1cHTy3sV0FmwHPZLLuLiDr59/ysKtIdUN7iaynA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674728985; h=Content-Type:Content-Transfer-Encoding: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=OVrimtqn5tuWehaUBJC/M9rLjDxJZrXJLazZ+8cYljw=; b=Y/9HMQwmaRNBFb2KGDQEBPzTdBuI+E2Jli/cw7FN4XYrP+4n5kTDneyPBWBG2VXHleJR590+aL7BK2U4VtQbmfeJE6FmK57rZbtceE73Q6C7m3TyF5+Qnz9+uZbK1KIZO4oT6849fsEozFS7AWTnw2Y8s+cIs5psUgmnYFEOJTI= 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 1674728985644571.1620050491451; Thu, 26 Jan 2023 02:29:45 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-284-3-m-Me_YNvO8oOtjk-i1Yg-1; Thu, 26 Jan 2023 05:29:39 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1FEF985C6E9; Thu, 26 Jan 2023 10:29:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 078AF4015312; Thu, 26 Jan 2023 10:29:37 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7FF3C1946594; Thu, 26 Jan 2023 10:29:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BE7D81946597 for ; Thu, 26 Jan 2023 10:29:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B454E492C18; Thu, 26 Jan 2023 10:29:27 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7761C492C14 for ; Thu, 26 Jan 2023 10:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674728984; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=OVrimtqn5tuWehaUBJC/M9rLjDxJZrXJLazZ+8cYljw=; b=dg1y3EN71lNetGUeM94DkFj4lZKJexGZ8nUClsU6uqSMqloIMx7nJDnKoB6YL611wu5yaY 0/XxGv1WIZvHmwBhz+NBXuvsdYCh2VVwIg09Xk2QtwJDOncpCHeNnStAbP9CuSZ+033Nmc zqh+uaVbbsydXp/L5uSOV4SObao0qpA= X-MC-Unique: 3-m-Me_YNvO8oOtjk-i1Yg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] remote: Propagate error from virDomainGetSecurityLabelList via RPC Date: Thu, 26 Jan 2023 11:29:21 +0100 Message-Id: <5a167e1ae7dbf12b622272aa9aa8a8d973bee479.1674728899.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: 1674728987050100004 Content-Type: text/plain; charset="utf-8" The daemon side of this API has been broken ever since the API was introduced in 2012. Instead of sending the error from virDomainGetSecurityLabelList via RPC so that the client can see it, the dispatcher would just send a successful reply with return value set to -1 (and an empty array of labels). The client side would propagate this return value so the client can see the API failed, but the original error would be lost. Signed-off-by: Jiri Denemark --- src/remote/remote_daemon_dispatch.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index 6c56e9ec3e..4d993afee6 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -2637,13 +2637,11 @@ remoteDispatchDomainGetSecurityLabelList(virNetServ= er *server G_GNUC_UNUSED, if (!(dom =3D get_nonnull_domain(conn, args->dom))) goto cleanup; =20 - if ((len =3D virDomainGetSecurityLabelList(dom, &seclabels)) < 0) { - ret->ret =3D len; - ret->labels.labels_len =3D 0; - ret->labels.labels_val =3D NULL; - goto done; - } + if ((len =3D virDomainGetSecurityLabelList(dom, &seclabels)) < 0) + goto cleanup; =20 + ret->ret =3D len; + ret->labels.labels_len =3D len; ret->labels.labels_val =3D g_new0(remote_domain_get_security_label_ret= , len); =20 for (i =3D 0; i < len; i++) { @@ -2653,9 +2651,7 @@ remoteDispatchDomainGetSecurityLabelList(virNetServer= *server G_GNUC_UNUSED, cur->label.label_len =3D label_len; cur->enforcing =3D seclabels[i].enforcing; } - ret->labels.labels_len =3D ret->ret =3D len; =20 - done: rv =3D 0; =20 cleanup: --=20 2.39.1