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.129.124]) by passt.top (Postfix) with ESMTP id 98A705A0268 for ; Thu, 16 Feb 2023 17:35:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676565312; 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=0DEsmKFQpr9/tZUDSCW+am4GT1VCe7NwWM4EkrA9YoA=; b=SKmMiVpmjVaWN5Opn9qNDMHhnzd7OrukzcuGJU4CVo8xB0fvDEDHvPKSZJTT4BrQECGXqH VSk4BMaCDGtgUO8jEuUTDE52cfWTvohRtE7aIz2YwA2bUkiRbT5ZhmOir+nzgForpxWC1W qcbsyUbiDCHtdoOt8PcpIoVpByMT80E= 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-543-nbl2gmHTNu2B0WTtcpIlPg-1; Thu, 16 Feb 2023 11:35:11 -0500 X-MC-Unique: nbl2gmHTNu2B0WTtcpIlPg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D31785A588 for ; Thu, 16 Feb 2023 16:35:11 +0000 (UTC) Received: from maya.cloud.tilaa.com (unknown [10.33.32.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 154EE492B0E; Thu, 16 Feb 2023 16:35:11 +0000 (UTC) Date: Thu, 16 Feb 2023 17:35:07 +0100 From: Stefano Brivio To: Michal =?UTF-8?B?UHLDrXZvem7DrWs=?= Subject: Re: [PATCH v2 3/5] qemu_passt: Make passt report errors to stderr whenever possible Message-ID: <20230216173507.1dd36685@elisabeth> In-Reply-To: References: <20230216170702.3ad76aeb@elisabeth> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LGGAQDBAN72BH43BSRE2CWI2P5BNRORK X-Message-ID-Hash: LGGAQDBAN72BH43BSRE2CWI2P5BNRORK X-MailFrom: sbrivio@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: libvir-list@redhat.com, passt-dev@passt.top 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 Thu, 16 Feb 2023 17:27:11 +0100 Michal Pr=C3=ADvozn=C3=ADk wrote: > On 2/16/23 17:07, Stefano Brivio wrote: > > On Thu, 16 Feb 2023 14:32:50 +0100 > > Michal Privoznik wrote: > > =20 > >> Passt has '--stderr' argument which makes it report error onto > >> stderr rather to system log. Unfortunately, it's currently > >> impossible to use both '--log-file' and '--stderr', so pass the > >> latter only if the former isn't passed. Then, use the stderr to > >> produce more user friendly error message on failed start. > >> > >> Signed-off-by: Michal Privoznik > >> --- > >> src/qemu/qemu_passt.c | 22 +++++++++++++++++++--- > >> 1 file changed, 19 insertions(+), 3 deletions(-) > >> > >> diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c > >> index c082c149cd..881205449b 100644 > >> --- a/src/qemu/qemu_passt.c > >> +++ b/src/qemu/qemu_passt.c > >> @@ -171,8 +171,13 @@ qemuPasstStart(virDomainObj *vm, > >> if (net->sourceDev) > >> virCommandAddArgList(cmd, "--interface", net->sourceDev, NULL= ); > >> =20 > >> - if (net->backend.logFile) > >> + if (net->backend.logFile) { > >> virCommandAddArgList(cmd, "--log-file", net->backend.logFile,= NULL); > >> + } else { > >> + /* By default, passt logs into system logger. But we are inte= rested > >> + * into errors too. Make it print errors onto stderr. */ > >> + virCommandAddArg(cmd, "--stderr"); > >> + } =20 > >=20 > > There's no need for this, see my previous email, archived at: > > https://listman.redhat.com/archives/libvir-list/2023-February/237880.= html > > =20 > >> =20 > >> /* Add IP address info */ > >> for (i =3D 0; i < net->guestIP.nips; i++) { > >> @@ -265,8 +270,19 @@ qemuPasstStart(virDomainObj *vm, > >> goto error; > >> =20 > >> if (cmdret < 0 || exitstatus !=3D 0) { > >> - virReportError(VIR_ERR_INTERNAL_ERROR, > >> - _("Could not start 'passt': %s"), NULLSTR(errb= uf)); > >> + if (STRNEQ_NULLABLE(errbuf, "")) { > >> + virReportError(VIR_ERR_INTERNAL_ERROR, > >> + _("Could not start 'passt': %s"), errbuf); > >> + } else if (net->backend.logFile) { > >> + virReportError(VIR_ERR_INTERNAL_ERROR, > >> + _("Could not start 'passt': look into %s f= or error"), > >> + net->backend.logFile); =20 > >=20 > > ...and this won't be needed either, with Laine's series for passt. It > > might actually be a bit misleading. > > =20 > >> + } else { > >> + virReportError(VIR_ERR_INTERNAL_ERROR, > >> + _("Could not start 'passt': exit status = =3D '%d'"), > >> + exitstatus); > >> + } > >> + > >> goto error; > >> } > >> =20 > >=20 > > So all in all I think this is unnecessary, but also kind of harmless. > > =20 >=20 > Except those patches are not merged yet. Merged. > And as we are getting close to > the release I'd like to make this work with what we have now. We've been > burned plenty of times with QEMU to learn our lesson. We've merged > patches that were based not on QEMU's git, but some patches on top > thinking - yeah, the API won't change. And then it did. >=20 > Now we don't require a release (which would be ideal), but at least for > patches to be merged. When they get merged then yeah, this can be reworke= d. --=20 Stefano