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 39AB25A0082 for ; Mon, 9 Jan 2023 15:51:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673275910; 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: in-reply-to:in-reply-to:references:references; bh=Wxtju7QWt5mPxqgO+Mhco+iLn91gIXEf3ykdeb1Xz3k=; b=BCLRqHRNOyAxT1+OPyML1hLBbCc6FNedqCD/uywqQj6jZcqEEfcOmp9j9qAbfvvfSwppzn yB6F/2kFrZl23RLfTa11D1jIvLnZ+4UJEpqJTJHu8zQph7WLB6YX8FwkOqPEYIgIuDYm5j WBaTtgqtmszUA3IS3GPC2FzVtIv/rkQ= 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-417-VZF9K_hbOA6PbnQRquOCfw-1; Mon, 09 Jan 2023 09:51:46 -0500 X-MC-Unique: VZF9K_hbOA6PbnQRquOCfw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 29642857A86 for ; Mon, 9 Jan 2023 14:51:46 +0000 (UTC) Received: from fedora (ovpn-192-19.brq.redhat.com [10.40.192.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A60F640C2064; Mon, 9 Jan 2023 14:51:37 +0000 (UTC) Date: Mon, 9 Jan 2023 15:51:59 +0100 From: =?iso-8859-1?B?SuFu?= Tomko To: Laine Stump Subject: Re: [libvirt PATCH 8/9] qemu: hook up passt config to qemu domains Message-ID: References: <20230109041112.368790-1-laine@redhat.com> <20230109041112.368790-9-laine@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dpGEGMBOGDUqIoU5" Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-MailFrom: jtomko@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: XGUVOEFWDSVKDZFHW3JRKNPMLSS6426V X-Message-ID-Hash: XGUVOEFWDSVKDZFHW3JRKNPMLSS6426V X-Mailman-Approved-At: Tue, 10 Jan 2023 16:08:41 +0100 CC: Libvirt , 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: --dpGEGMBOGDUqIoU5 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On a Monday in 2023, Laine Stump wrote: >On 1/9/23 2:32 AM, J=E1n Tomko wrote: >>On a Sunday in 2023, Laine Stump wrote: >>>+static char * >>>+qemuPasstCreatePidFilename(virDomainObj *vm, >>>+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 virDomainNetDef *net) >>>+{ >>>+=A0=A0=A0 qemuDomainObjPrivate *priv =3D vm->privateData; >>>+=A0=A0=A0 virQEMUDriver *driver =3D priv->driver; >>>+=A0=A0=A0 g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig= (driver); >>>+=A0=A0=A0 g_autofree char *name =3D NULL; >>>+ >>>+=A0=A0=A0 name =3D g_strdup_printf("%s-%s-passt", vm->def->name,=20 >>>net->info.alias); >> >>Please use virDomainDefGetShortName for filename purposes. > >Why? If I use GetShortName, then there's the possibility that two=20 >domains would want to use the same name for the pidfile. > Because otherwise the PID filename might exceed maximum path length for domains with very long names. The short name should be unique since it contains the domain ID. The ShortName function is also used for slirp and virtiofsd pid filenames, so we have the cult argument too :) (If you know of an issue with this usage, please share it - it could be the cause of us not cleaning up virtiofsd properly sometimes [0]) Jano >Would it be better to use the domain's UUID (as I did for the socket=20 >path?) The advantage of using the name is that it's easier for a human=20 >to find, but while the uuid is usually longer, its length is at least=20 >predictable/consistent, and I suppose a human will probably never need=20 >to find the pidfile anyway... > >> >>>+ >>>+=A0=A0=A0 return virPidFileBuildPath(cfg->passtStateDir, name); >>>+} >>>+ >>>+ [0] https://bugzilla.redhat.com/show_bug.cgi?id=3D2151808 --dpGEGMBOGDUqIoU5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQT+Rn5j0qdK2hQgnuAU0rOr/y4PvAUCY7wqCwAKCRAU0rOr/y4P vLr4AP44AfG2f7oRJtS5UZwFbqYGuwcIy3ZrafKa8uwq8GWXzAD/Z2GmsBrs6PR9 Uc/An7Ul2C3/cLb4bOFKe7cgloMsYQE= =PKAU -----END PGP SIGNATURE----- --dpGEGMBOGDUqIoU5--