From nobody Thu May 9 23:32:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1649330706; cv=none; d=zohomail.com; s=zohoarc; b=ElOXI1NzQIlxyVhkH+IqP3t/VQyTZ6SOiuCMh620AWhqjSAJVf9irkkAlkCMSpFUzKP+cO6AqWg5AA2fZnjhudJB5OUKBQ9d62sd8DWvs20q1v/6/aemlRLD+rBhniibBdWDcABvqkFYsUxGvjuOf/q97CQl6BI4dmUII52sf98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1649330706; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=snvXPN/patVcm7n78/hpnuQuSNKTD7RwlO8GYzMjSnk=; b=HsF6+xvMwxgoERik8s/HcX/MBX3iw2eagSGAWXwJno9srUf91yPvQejjY5puiko3/uNDhNqUJnFQaWibvFEztRZL2VHk086GONY500bouCOcaSn/2r9ryOy6f9ZJs5Gx1IohMhEJdWSR2NJlzGMtedublpk20QZljzu9wMXUCL8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1649330706696324.7647352448563; Thu, 7 Apr 2022 04:25:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-281-lXWwL9rXNIKL89Diyn56uw-1; Thu, 07 Apr 2022 07:25:04 -0400 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 5D134296A612; Thu, 7 Apr 2022 11:25:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D98AA40CF91D; Thu, 7 Apr 2022 11:25:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 926461949761; Thu, 7 Apr 2022 11:25:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 587411947BBE for ; Thu, 7 Apr 2022 11:24:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1B92040E8100; Thu, 7 Apr 2022 11:24:59 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0BEC9404729C for ; Thu, 7 Apr 2022 11:24:59 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E3E8E185A7BA for ; Thu, 7 Apr 2022 11:24:58 +0000 (UTC) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-441-1VPBajN9Ov66iUPbAeT01Q-1; Thu, 07 Apr 2022 07:24:58 -0400 Received: by mail-ej1-f71.google.com with SMTP id k16-20020a17090632d000b006ae1cdb0f07so2871399ejk.16 for ; Thu, 07 Apr 2022 04:24:57 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id z6-20020a056402274600b004194fc1b7casm9085872edd.48.2022.04.07.04.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 04:24:52 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 500BB5CE96C5; Thu, 7 Apr 2022 13:24:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649330705; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=snvXPN/patVcm7n78/hpnuQuSNKTD7RwlO8GYzMjSnk=; b=SeP8gU/hRUMawqbAcdhAexJa91O4BRg8hMK+uG2N95Iy4FWF8ORXizGZlGrQW9Moa2U9zz fEjpQlu1LZThRZPV3LP0vVcoWC7EFHda28PmWxrRSvIn3bGQa7C+d5IcW5sbqV8/ki2E59 +EikidB3YJYITjN5CGpnM27+B3Fsud4= X-MC-Unique: lXWwL9rXNIKL89Diyn56uw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 1VPBajN9Ov66iUPbAeT01Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=snvXPN/patVcm7n78/hpnuQuSNKTD7RwlO8GYzMjSnk=; b=NWK28zwuak+VgtjlW9Lp0gJEtHT4aEUgX4p4FWs/U36Eo3zqRW9ia1Aq6PfSzhVQ8/ qfKD5hBZG58a9g+vBW6rQmqcft54TDmrrN/5CmkqQMn9fva0Lmlynx4gniTVgVgH8Oq0 +ibIDaaR3wfHwY26AU8TX8etQeZJlAKPNrkpdmgKcFWw9Y5rRYpQKw0O1JMNROoPYpfy SCbMEBnM/7SyqPpupnVrH5toseeFhmXfFPt08LeHMScctSbWrbbXJHMhcKhjFN84aLep Qdl5r1XEN8lQ8JvdsTs+I/APYde4tYTMZES7YMIdpF2DgMID27Kp5d2bdBmc9jgznOaW 8KVQ== X-Gm-Message-State: AOAM531oXQEXbV+p2lwPGhmhhRY6Po0Wjw6a8piS4LAUqoitQ4KO6VJH 7wXQ+KppoGyMLNq6jfjEC4ZB2k03odaWJix69GVnkrppGnT25B0bclqt/yeYslLdr/mT14vYz2B SEQ0kjkM0pt66UzQ95jY= X-Received: by 2002:a17:907:96a5:b0:6e6:f1f3:ba75 with SMTP id hd37-20020a17090796a500b006e6f1f3ba75mr12534412ejc.397.1649330693514; Thu, 07 Apr 2022 04:24:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMAaxurklCtIwzRKLEPcnbVxV9gw0MKwTTaVqzY8yqq0Wh8JcF8FRH8V8X43zxoWYdvLpvzw== X-Received: by 2002:a17:907:96a5:b0:6e6:f1f3:ba75 with SMTP id hd37-20020a17090796a500b006e6f1f3ba75mr12534396ejc.397.1649330693269; Thu, 07 Apr 2022 04:24:53 -0700 (PDT) From: Martin Kletzander To: libvir-list@redhat.com Subject: [libvirt PATCH] qemu: Shorten domain name in virtiofsd log path Date: Thu, 7 Apr 2022 13:24:52 +0200 Message-Id: <214e8e82f68475ebf8639e1379a120cb0f1e1a5c.1649329138.git.mkletzan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1649330708014100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This helps when starting domains with long names which could possibly end up creating too long of a name for the filesystem. The path is not being saved in the domain config, so there is no need for backwards compatibility. User aliases will always start with "ua-" and the= only way paths could collide is to: 1) create a domain named e.g. "asdf-ua" 2) start the domain with virtiofsd debug logs 3) destroy the domain 4) restart libvirt daemon for domain IDs to start from 1 again 5) create a domain named "asdf" 6) add user alias for the virtiofs that is the same as was generated for the first domain, with the required "ua-" prefix 7) start the "asdf" domain at which point the logs for the two domains would end up in the same logfil= e. Since this is still better than what we had before I think it is not worth fixing this peculiar scenario in this patch. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1817401 Signed-off-by: Martin Kletzander --- src/qemu/qemu_virtiofs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c index 7e3324b017ce..67df8b3890b6 100644 --- a/src/qemu/qemu_virtiofs.c +++ b/src/qemu/qemu_virtiofs.c @@ -81,8 +81,9 @@ qemuVirtioFSCreateLogFilename(virQEMUDriverConfig *cfg, const char *alias) { g_autofree char *name =3D NULL; + g_autofree char *shortname =3D virDomainDefGetShortName(def); =20 - name =3D g_strdup_printf("%s-%s", def->name, alias); + name =3D g_strdup_printf("%s-%s", shortname, alias); =20 return virFileBuildPath(cfg->logDir, name, "-virtiofsd.log"); } --=20 2.35.1