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 672875A0268 for ; Thu, 16 Feb 2023 17:38:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676565535; 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=xOogsRADZpkMKB/+Sq8sy0gT1OCnf9oLUKepGt1neRE=; b=ib0O3UgeoJyuNrqSWi+T25KRn9jmUCd3vUNp+l2u3UKTqSTwNyUwVMNh72bUBj7/dAWVin NduMIpKNbn881/viZl7Nwc6DDhG6ZV/WhLuk08IvlFMSlEyOBRIQHGQRtd49SxTvZ5b1QG COWluYSb8M3ge9YA07T5gEU5KB3+FMk= 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-462-bg2XE-B9OdOSGl6RU-YJPw-1; Thu, 16 Feb 2023 11:38:46 -0500 X-MC-Unique: bg2XE-B9OdOSGl6RU-YJPw-1 Received: by mail-qv1-f71.google.com with SMTP id v10-20020a0cf90a000000b0056f060452adso551244qvn.6 for ; Thu, 16 Feb 2023 08:38:46 -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=xOogsRADZpkMKB/+Sq8sy0gT1OCnf9oLUKepGt1neRE=; b=W595XRiQcyKrqyhdYlVtp3SxHcb3Tfpw0RwXc3LrwETjBUWckwY4vQymOl3a29Rr3M fND+RmGmwUDawNHnFqKAcFvAmmwZLGdiPqAkZ5vorKrPlOuMabJZUmqjNWprwQiPgwzt Du/PBhlG6UYtnBpkgOLT8+A4PNibdCcGRXxoyk+hw/53ij/8sMUlxECUvEtqen9wh4ri 2dLcHXRVRB/R+57M5myZ+oy5wlTuUCD4kqAOJAWBjM8kAu2EQnCjSfK9OGlEPVz8EdmP vfcM/xWkIFxT1xFRbdlvHckFtvr6m+SRZulgUvwfep9EcNgkTdEi1bJKTwTEqwB1KbEp icIg== X-Gm-Message-State: AO0yUKWeAYk0sTLlQ2Jb+J9ANCfLKB9LN8i0f+TlpEFGKSQd5g0oQPSD vEjVZOllontJ25GSZh8RCmapZ8W8a2ERm/mmFYkpCLEVCbNnfVsN6vRTOOltUYuHHZtmU/QQt4X nGWWqKxPZS54Q X-Received: by 2002:ac8:5945:0:b0:3a9:818f:db3d with SMTP id 5-20020ac85945000000b003a9818fdb3dmr10050171qtz.53.1676565526539; Thu, 16 Feb 2023 08:38:46 -0800 (PST) X-Google-Smtp-Source: AK7set+cuxO94LgitiPImvrh47zyE0bXn+OxPs9hJst9JX1c/Co0JpX66hUdFASzxPalp0XIccQ4Bw== X-Received: by 2002:ac8:5945:0:b0:3a9:818f:db3d with SMTP id 5-20020ac85945000000b003a9818fdb3dmr10050154qtz.53.1676565526324; Thu, 16 Feb 2023 08:38:46 -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 q22-20020ac84116000000b003bd1648e3b2sm266159qtl.86.2023.02.16.08.38.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Feb 2023 08:38:45 -0800 (PST) Message-ID: <27e83d03-f9fb-e615-7526-7e2d6f5dcae3@redhat.com> Date: Thu, 16 Feb 2023 11:38:45 -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 v2 2/5] qemu_passt: Report passt's error on failed start 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: J4PS2F465THPC35DTYURPZIPO6L4DEZC X-Message-ID-Hash: J4PS2F465THPC35DTYURPZIPO6L4DEZC 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/16/23 8:32 AM, Michal Privoznik wrote: > When starting passt, it may write something onto its stderr > (convincing it to print even more is addressed later). Pass this > string we read to user. > > Since we're not daemonizing passt anymore (see previous commit), > we can let virCommand module do all the heavy lifting and switch > to virCommandSetErrorBuffer() instead of reading error from an > FD. > > Signed-off-by: Michal Privoznik Reviewed-by: Laine Stump (also a part of the reverted patch) > --- > src/qemu/qemu_passt.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c > index adc69fc052..c082c149cd 100644 > --- a/src/qemu/qemu_passt.c > +++ b/src/qemu/qemu_passt.c > @@ -144,18 +144,18 @@ qemuPasstStart(virDomainObj *vm, > g_autofree char *passtSocketName = qemuPasstCreateSocketPath(vm, net); > g_autoptr(virCommand) cmd = NULL; > g_autofree char *pidfile = qemuPasstCreatePidFilename(vm, net); > + g_autofree char *errbuf = NULL; > char macaddr[VIR_MAC_STRING_BUFLEN]; > size_t i; > pid_t pid = (pid_t) -1; > int exitstatus = 0; > int cmdret = 0; > - VIR_AUTOCLOSE errfd = -1; > > cmd = virCommandNew(PASST); > > virCommandClearCaps(cmd); > virCommandSetPidFile(cmd, pidfile); > - virCommandSetErrorFD(cmd, &errfd); > + virCommandSetErrorBuffer(cmd, &errbuf); > > virCommandAddArgList(cmd, > "--one-off", > @@ -266,7 +266,7 @@ qemuPasstStart(virDomainObj *vm, > > if (cmdret < 0 || exitstatus != 0) { > virReportError(VIR_ERR_INTERNAL_ERROR, > - _("Could not start 'passt'. exitstatus: %d"), exitstatus); > + _("Could not start 'passt': %s"), NULLSTR(errbuf)); > goto error; > } >