From nobody Sun Feb 8 23:25:58 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=1676375534; cv=none; d=zohomail.com; s=zohoarc; b=DV9BGtgzk6bOYnQd2XuLOdLZNGkIcPaehebqmTBgXmmMxwTgBY28tlaiW6qxLPbZ/nLPX0yT8C4tvfBkN04vJkK9VKr6TtCqTQSjI7ghiCqVzhu+x9jgqs9pWzouGvZALoscq2C22Un+8QU3zOI2zjvWALtcwWKD9YWodsjXV7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676375534; 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=lIW8SBkzl10f26p2Zp9/SS6Bo6iv16l6yctgTW/oXFQ=; b=jcxrt6sQ49yqKGiy3kaoIhsGP2m4cgh7s5encxcO5XgwNrgRMcYMv8ADiETuAt37stCPLZtfZiorBjeLaK1g7iXrfXFz6uscVPpaRio/5nH6Taf4j5xNU8fMDCwF4xd4EgigSmL4CIZVXKA+cNPsE+wwD/rzLuctLuWpTdzYcDE= 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 1676375534170925.7147423516614; Tue, 14 Feb 2023 03:52:14 -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-321-SDxF2DPJNay0Eh2BYqRjMg-1; Tue, 14 Feb 2023 06:51:32 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 30C9718E0056; Tue, 14 Feb 2023 11:51:29 +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 17BA04051E44; Tue, 14 Feb 2023 11:51:29 +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 EB81E194658C; Tue, 14 Feb 2023 11:51:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 85ADB19465B3 for ; Tue, 14 Feb 2023 11:51:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7695D141510F; Tue, 14 Feb 2023 11:51:27 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA9E01415108; Tue, 14 Feb 2023 11:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676375533; 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=lIW8SBkzl10f26p2Zp9/SS6Bo6iv16l6yctgTW/oXFQ=; b=DgGeJhZLTbZm/IOE/vE4Ybl+UFwqYDSfNdtQ185d0iHigXq94bM/MCVzAmr0bqolGP6ZgB KK0lPeL+JGJsragPwRNLxFcjqFgKnsuQkq7y/R94biN/0ZQf0xwkEROmW+Ccq/Dc3ianBK Df9SbyD/nUOQL2027yJM+y+2RyBBb4k= X-MC-Unique: SDxF2DPJNay0Eh2BYqRjMg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] qemu_passt: Report error when getting passt PID failed Date: Tue, 14 Feb 2023 12:51:21 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: , Cc: sbrivio@redhat.com, passt-dev@passt.top Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1676375535974100001 Content-Type: text/plain; charset="utf-8"; x-default="true" If qemuPasstGetPid() fails, or the passt's PID is -1 then qemuPasstSetupCgroup() returns early without any error message set. Report an appropriate error. Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump --- src/qemu/qemu_passt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index 0f09bf3db8..78830fdc26 100644 --- a/src/qemu/qemu_passt.c +++ b/src/qemu/qemu_passt.c @@ -125,8 +125,11 @@ qemuPasstSetupCgroup(virDomainObj *vm, { pid_t pid =3D (pid_t) -1; =20 - if (qemuPasstGetPid(vm, net, &pid) < 0 || pid <=3D 0) + if (qemuPasstGetPid(vm, net, &pid) < 0 || pid <=3D 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Could not get process ID of passt")); return -1; + } =20 return virCgroupAddProcess(cgroup, pid); } --=20 2.39.1