From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from imap.gmail.com [173.194.76.109] by localhost with POP3 (fetchmail-6.3.26) for (single-drop); Thu, 23 May 2024 12:11:28 +0200 (CEST) Received: by 2002:a05:6a11:2489:b0:55f:c3c0:ed08 with SMTP id sg9csp1205989pxb; Thu, 23 May 2024 03:11:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWVyqCV8Y04Y1ZHNfg3EEulLMoE5AWhgPbFH/qehZz806YO90TH52mhc3yAzrmvk7+h1hCuTNX3UqLY7xMKbk7BMiP2wB0MfJY= X-Google-Smtp-Source: AGHT+IHDom+a7LwHQhn73WVhRyJa7b9ydcOduvwiXbvuPU/Y8xMgJIi96CV7BP+vmBfPYS148/ul X-Received: by 2002:a05:690c:883:b0:61b:1de0:4546 with SMTP id 00721157ae682-627e487ead7mr49207427b3.49.1716459067197; Thu, 23 May 2024 03:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716459067; cv=none; d=google.com; s=arc-20160816; b=KNKSmFrdSpl+6FMVL8ORSgcpNIPvr4pVB30JALDLSVqGH+qcLwJkpaMkvEnz/IRaOE LL6b76qKzu3VojqH0iCS+QqRtQeoQlkMopEQIWbMXsNfgGsM+0J6P/JbXk7YkhkLWyxT xDgRnhv2Y6Op8i+d3hgz+6On8ZNayc6JkMJvkNp7z9bmpF+JXoJioS4owUP0TN5G4pH5 UEU2+VmBzqIHAS7DKrGq+kbtnX1PJyI1HRwfBQDqWOWyBjmv0UL1UdeO3BXAMle/rpSt JIDh2zXPv2Cf8BZoP+tJ8h28XdfhHhgJEXc6OtF1RwP+ccTb7hcqLDYdCj7nxhJmFonY QRvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:user-agent:in-reply-to:mime-version:references :message-id:subject:cc:to:from:date:delivered-to; bh=aWq5wtDb13O0fh57YeSQv4XDu4Z7v5AUSpdfB7k/+NM=; fh=sa22/YzBg7gBlP1vWMAMO0ID50cEEzmrnuJNDeV9zT4=; b=zmcrMGPeGAOniGOL78g+lJf3m48CCD3CZpUlO052m8egy1hvHrBXh4BqStUTg8iIDv UhEdJAFq3nyjIij8DAiv2Azs6K9yXi4FMD2Vro1hSipPeplwQneygK+1qKqGrIvny/hq C1BsLHzZaK16KKH1D2vLO6AW1ynAT1gIJyGiEmJDrnCeWpVJEYvn9nHbvD1cb0r9SnbJ U1GHopTdRaV4hncFTlJEOKxi+w37wSYu+NLAgkjKQytYSSqf4lmKj9RdWbJ8B244/jk9 39ZHTRxqE2hjWJ1303IYZDYyWbrO3fE7FbWSG05q2WBE1MQAyQ3dwy7xg2Acg76c+mpH yjoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; gateway.spf=pass (google.com: domain gapps.redhat.com configured 170.10.128.131 as internal address) smtp.mailfrom=rjones@redhat.com smtp.remote-ip=170.10.128.131 policy.d=gapps.redhat.com Return-Path: Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com. [170.10.128.131]) by mx.google.com with ESMTPS id 6a1803df08f44-6aadce38b49si14512336d6.522.2024.05.23.03.11.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 03:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain gapps.redhat.com configured 170.10.128.131 as internal address) Authentication-Results: mx.google.com; gateway.spf=pass (google.com: domain gapps.redhat.com configured 170.10.128.131 as internal address) smtp.mailfrom=rjones@redhat.com smtp.remote-ip=170.10.128.131 policy.d=gapps.redhat.com Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-379-lWrOdKLuPl-K0XsiYOd4tA-1; Thu, 23 May 2024 06:11:05 -0400 X-MC-Unique: lWrOdKLuPl-K0XsiYOd4tA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 547C03C025B9 for ; Thu, 23 May 2024 10:11:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 515B740B90D; Thu, 23 May 2024 10:11:05 +0000 (UTC) Received: from localhost (unknown [10.42.28.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1F8F491034; Thu, 23 May 2024 10:11:04 +0000 (UTC) Date: Thu, 23 May 2024 11:11:02 +0100 From: "Richard W.M. Jones" To: Stefano Brivio Cc: passt-dev@passt.top, David Gibson , Minxi Hou Subject: Re: [PATCH 8/8] conf, passt.h: Rename pid_file in struct ctx to pidfile Message-ID: <20240523101102.GX4345@redhat.com> References: <20240522205911.261325-1-sbrivio@redhat.com> <20240522205911.261325-9-sbrivio@redhat.com> MIME-Version: 1.0 In-Reply-To: <20240522205911.261325-9-sbrivio@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: On Wed, May 22, 2024 at 10:59:11PM +0200, Stefano Brivio wrote: > We have pidfile_fd now, pid_file_fd would be quite ugly. > > Signed-off-by: Stefano Brivio > --- > conf.c | 8 ++++---- > passt.h | 4 ++-- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/conf.c b/conf.c > index f62a5eb..50383a3 100644 > --- a/conf.c > +++ b/conf.c > @@ -1123,7 +1123,7 @@ static void conf_open_files(struct ctx *c) > if (c->mode == MODE_PASST && c->fd_tap == -1) > c->fd_tap_listen = tap_sock_unix_open(c->sock_path); > > - c->pidfile_fd = pidfile_open(c->pid_file); > + c->pidfile_fd = pidfile_open(c->pidfile); > } > > /** > @@ -1456,12 +1456,12 @@ void conf(struct ctx *c, int argc, char **argv) > > break; > case 'P': > - if (*c->pid_file) > + if (*c->pidfile) > die("Multiple --pid options given"); > > - ret = snprintf(c->pid_file, sizeof(c->pid_file), "%s", > + ret = snprintf(c->pidfile, sizeof(c->pidfile), "%s", > optarg); > - if (ret <= 0 || ret >= (int)sizeof(c->pid_file)) > + if (ret <= 0 || ret >= (int)sizeof(c->pidfile)) > die("Invalid PID file: %s", optarg); > > break; > diff --git a/passt.h b/passt.h > index 3e50612..46d073a 100644 > --- a/passt.h > +++ b/passt.h > @@ -184,7 +184,7 @@ struct ip6_ctx { > * @nofile: Maximum number of open files (ulimit -n) > * @sock_path: Path for UNIX domain socket > * @pcap: Path for packet capture file > - * @pid_file: Path to PID file, empty string if not configured > + * @pidfile: Path to PID file, empty string if not configured > * @pidfile_fd: File descriptor for PID file, -1 if none > * @pasta_netns_fd: File descriptor for network namespace in pasta mode > * @no_netns_quit: In pasta mode, don't exit if fs-bound namespace is gone > @@ -236,7 +236,7 @@ struct ctx { > char sock_path[UNIX_PATH_MAX]; > char pcap[PATH_MAX]; > > - char pid_file[PATH_MAX]; > + char pidfile[PATH_MAX]; > int pidfile_fd; > > int one_off; Looks like trivial refactor so: Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org