From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id DB9A35A005E for ; Wed, 15 Feb 2023 08:24:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676445859; h=from:from: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; bh=RB98Hu1OCMovCAq4Xu0/Ha5t+B7rBy+B9LSMgQsjTvY=; b=ZlsyBV2Y3Vz5vENvcy3eOA5p8IlDlnABmmIhpcvnRAf/fxlkuyj/KgYbHCp7hxDvpqAyj6 jpkraraOmn3sJCAs0Me5oA0ATj317Q+E2GYqatJ1mFKz3PHY0kkGHhdxG8ee8248xKVKDE CbmhwCFpCoo8s5BzCDU2Jx07DhVsg+s= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-190-wPeDsIq_Nye-87VjUBj7Eg-1; Wed, 15 Feb 2023 02:24:17 -0500 X-MC-Unique: wPeDsIq_Nye-87VjUBj7Eg-1 Received: by mail-qv1-f72.google.com with SMTP id f6-20020a0cc306000000b0056e96f4fd64so7619979qvi.15 for ; Tue, 14 Feb 2023 23:24:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RB98Hu1OCMovCAq4Xu0/Ha5t+B7rBy+B9LSMgQsjTvY=; b=oCnJGWtJweBBw2TPlXxoBxnwNQOqmKShsaP2UVvUrw9oetCTlC22IyjdjrbaVkmpzv 8Xflf8Tei1kEMCBWvOqbg3KSePdP771tV7zxjBtEqorFHyt1Z9MDMP18l2hMQlrzKzz7 +VxuKTOwqrIhxSGWIWub+gsIo21kv64flwY/7uyFJMilTDkPr8MJ/DOF3wJI5YE/JrFN YgQ2QdKXMcxi6KkVyG6n+JmMuA9v6onIYiMkoEkPGvWJp9yhPrdWC7aCQGsAu2oqYsU5 NgDxXh9XinBgzP9tgYSU3cDeirdxrJmcda+9Vx+5yvjhO5HORwGgv5RVyjSh4q5IPlsA iQcA== X-Gm-Message-State: AO0yUKVCKQxXpT0DTseXW0oVGW3sdK1dLO4VNVVPfD6fruCT2CZpaz7c YhaxuQTICQCq0PyDEnf7lUqByw+d5vOEV0FFKnaVbpPBO95byjuIC0hF90dRoEDTClarUt0lyxx McWysdUq4KvOt X-Received: by 2002:a05:622a:148:b0:3b9:a51f:8988 with SMTP id v8-20020a05622a014800b003b9a51f8988mr1910536qtw.31.1676445857404; Tue, 14 Feb 2023 23:24:17 -0800 (PST) X-Google-Smtp-Source: AK7set+mb8KsfjMMg7PPeF4EwhzAHM+4QZ/T7voxGoWLXVvspAukaBmWStGxY2u3y3sEdlM/FsTDEg== X-Received: by 2002:a05:622a:148:b0:3b9:a51f:8988 with SMTP id v8-20020a05622a014800b003b9a51f8988mr1910522qtw.31.1676445857168; Tue, 14 Feb 2023 23:24:17 -0800 (PST) Received: from ?IPV6:2600:8805:3a00:3:3b4f:6d3c:92c4:a5c7? ([2600:8805:3a00:3:3b4f:6d3c:92c4:a5c7]) by smtp.gmail.com with ESMTPSA id x129-20020a376387000000b006bb82221013sm13556078qkb.0.2023.02.14.23.24.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Feb 2023 23:24:16 -0800 (PST) Message-ID: <1ba3a0ad-853d-510a-a15b-1da03bac3e40@redhat.com> Date: Wed, 15 Feb 2023 02:24:16 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 3/4] qemu_passt: Report error when getting passt PID failed To: libvir-list@redhat.com References: From: Laine Stump Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: IJYWUIOM4HRGDMAUCYAFEPVVU42R2PRP X-Message-ID-Hash: IJYWUIOM4HRGDMAUCYAFEPVVU42R2PRP X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: sbrivio@redhat.com, passt-dev@passt.top, Michal Privoznik X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2/14/23 6:51 AM, Michal Privoznik wrote: > 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 = (pid_t) -1; > > - if (qemuPasstGetPid(vm, net, &pid) < 0 || pid <= 0) > + if (qemuPasstGetPid(vm, net, &pid) < 0 || pid <= 0) { > + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > + _("Could not get process ID of passt")); > return -1; > + } > > return virCgroupAddProcess(cgroup, pid); > }