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 3C6795A0082 for ; Thu, 16 Feb 2023 16:42:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676562175; 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=2rHEhZvvt8qcjt8i43NFls9LB5Ftlt1iKRgRtLfQZYM=; b=X99eOv1KyujcZvOqK7NQt1LsJIJTZJw5U5mrDBE9XJg9H9pA3i32fCkuWNRf5HUy4es/5N zF5OdxhCNEeYGeqPtv5NgLHscrKmdwhkvVPUnXNtFNQO4FzaVPEJs6zFQsRYlJjggUbxNG RXJJluwIhdos+ujGZ99WE3XD5GfzJsE= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-207-03MI3GP2PNGNV5JDMeyQdQ-1; Thu, 16 Feb 2023 10:42:53 -0500 X-MC-Unique: 03MI3GP2PNGNV5JDMeyQdQ-1 Received: by mail-qv1-f71.google.com with SMTP id jh2-20020a0562141fc200b004c74bbb0affso1265277qvb.21 for ; Thu, 16 Feb 2023 07:42:53 -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: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=2rHEhZvvt8qcjt8i43NFls9LB5Ftlt1iKRgRtLfQZYM=; b=SOvCU3L7+/MR7gbdG+OSVm3fikOatZjroR8hLIR1fpYh17BVz9U0Sh0lDlfRSJlRwr GE0n+5CVUjg+0H9NQIv31P8zfx1YW1yIceWo32Goekp479CUYzl5vDciGjZn5icP2qDe phfYphc32secN8n2VYxE3wOCdGXQAkdC4TuOxe6n6pEgBKLTnsPUfE9ToBvSy1kPo2KV rVbefgKVvjz59VNkeVhUWCg1VYmn78q8fkp+aNPxET2MEnv85I7KQ+yVgWmMPbrV2bMT 6vSnScdaArFqSIs1g8lyMwX+fNqcw5a7rpVL+7XP4Aa0o/q+NhPZLTtcH/nSdq7zTlqO q9Mg== X-Gm-Message-State: AO0yUKUJ/mdx1CnM53z4a1qQGBvraUkotysWdWrXGkWLK5WDfZ+cnaIS jsDp2AE7mpf3nj8kmo+wI0NVQPjglirT2WPE6E2xysuTxgKWQ2J6NKu/cBnbcPtBq98iUvFKSaa Mw+rDJQeoihco X-Received: by 2002:ac8:5885:0:b0:3b9:a5d8:2c50 with SMTP id t5-20020ac85885000000b003b9a5d82c50mr8069537qta.38.1676562173233; Thu, 16 Feb 2023 07:42:53 -0800 (PST) X-Google-Smtp-Source: AK7set+ZpoHZKGfVbiXTknLgcnFBPlkFDL+UPt56BFvV0GntlZ+YWVg7JmhOlUCjTWS/NdO9MkE2Lg== X-Received: by 2002:ac8:5885:0:b0:3b9:a5d8:2c50 with SMTP id t5-20020ac85885000000b003b9a5d82c50mr8069516qta.38.1676562172972; Thu, 16 Feb 2023 07:42:52 -0800 (PST) Received: from [192.168.0.222] (207-153-48-138.fttp.usinternet.com. [207.153.48.138]) by smtp.gmail.com with ESMTPSA id j14-20020ac8404e000000b003b646123691sm1464872qtl.31.2023.02.16.07.42.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Feb 2023 07:42:52 -0800 (PST) Message-ID: <38d52208-9198-af2f-f841-9602a04c36d8@redhat.com> Date: Thu, 16 Feb 2023 09:42:51 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v2 3/5] qemu_passt: Make passt report errors to stderr whenever possible To: Michal Privoznik , libvir-list@redhat.com References: From: Jonathon Jongsma 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 X-MailFrom: jjongsma@redhat.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: MEZ4ELGSZALGYJ6TTP37KQ5CJGD23KCJ X-Message-ID-Hash: MEZ4ELGSZALGYJ6TTP37KQ5CJGD23KCJ X-Mailman-Approved-At: Thu, 16 Feb 2023 18:44:37 +0100 CC: sbrivio@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 2/16/23 7:32 AM, Michal Privoznik wrote: > 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); > > - 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 interested > + * into errors too. Make it print errors onto stderr. */ s/into/in the/ ? > + virCommandAddArg(cmd, "--stderr"); > + } > > /* Add IP address info */ > for (i = 0; i < net->guestIP.nips; i++) { > @@ -265,8 +270,19 @@ qemuPasstStart(virDomainObj *vm, > goto error; > > if (cmdret < 0 || exitstatus != 0) { > - virReportError(VIR_ERR_INTERNAL_ERROR, > - _("Could not start 'passt': %s"), NULLSTR(errbuf)); > + 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 for error"), > + net->backend.logFile); > + } else { > + virReportError(VIR_ERR_INTERNAL_ERROR, > + _("Could not start 'passt': exit status = '%d'"), > + exitstatus); > + } > + > goto error; > } >