From nobody Fri Dec 19 17:13:01 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1729063450936139.53226265200385; Wed, 16 Oct 2024 00:24:10 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EC900186F; Wed, 16 Oct 2024 03:24:09 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id DC7EB14EC; Wed, 16 Oct 2024 03:23:20 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id D40AA1287; Wed, 16 Oct 2024 03:23:14 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 38EAF13AA for ; Wed, 16 Oct 2024 03:23:14 -0400 (EDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-zA02DWf3P7qp3ovT0nxorA-1; Wed, 16 Oct 2024 03:23:12 -0400 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-37d609ef9f7so1705680f8f.3 for ; Wed, 16 Oct 2024 00:23:12 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4313f55dec4sm40402595e9.8.2024.10.16.00.23.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 00:23:10 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id BC8B03287523 for ; Wed, 16 Oct 2024 09:23:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729063393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6L8gjGW0xBSBDkDYfX/7PQLkqk1H5AEii0GQHFhpnlY=; b=Y5cifuPXw6Ca06HwxQnIt1HXGqUYrcWbmA1jxyXV0VEorON1WWumpH2S0Q/7lY268rTkle QL8DqUfcDBiC04HsimaMtIiny42VUCSrn2FQrK0jcFfABbA9WVd3UmesBQZ+Irnp189ILn zvar/qSgwkZrlZO0qrsILQsTiOjdZtw= X-MC-Unique: zA02DWf3P7qp3ovT0nxorA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729063391; x=1729668191; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6L8gjGW0xBSBDkDYfX/7PQLkqk1H5AEii0GQHFhpnlY=; b=HbqcRlXvFDadomM7cyhFKhy0mSK/d3oNMag3f+aG2WKG7sii2R9ClyIeJZUK5JlNi8 TBxaT9ZZ92AUnfE2DOEl7LoD/ehgokDacIsMQyxIWZrgMyzV6XG85B4WOMk4kUg00LWq brwJhjhY5xTFBwWzk/diEsiauS4Cz6A+Jf0V+mJqoqYp9r76hbPNFTFc269P3AcNj057 UB8150kN5QvvSRZJ9IoC+u/X7oA8MLe4M9v+JyZk+85AJJmFfa5I+/skmIMSUZ4G7k40 yDmx3LO8PLgyWUW8SlevSgaAvYGSWNQLQ1GUMwnFsYNvdF21NH/j5fMCJWZlCE9Kktpm Daeg== X-Gm-Message-State: AOJu0YzL4vexF1QwLM0XGXzQZkMyBN1qxOuSLo4+oEbILugvif+YfUP/ eKdw4kAUZ7CxAAmrOKEZblEy6YlQ66VdhkjJLdvkM6KQ4O9/hG1H5N35ZUPXyDT5r8aQEKuKzu9 Gqh6xnKZM5e4gu421Npcp6fdoIUUqaqHZAA2CzNj/xemZplKtLI3tCbo1I1F7pfZMFtcNeLm4Mo 9A0+t4Ovh9Bk82Qw2vYF69vVm0kS3sdJt8/PGP6dg= X-Received: by 2002:a05:6000:10c6:b0:37d:47b3:7b86 with SMTP id ffacd0b85a97d-37d5529a82dmr11220039f8f.44.1729063391512; Wed, 16 Oct 2024 00:23:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzIHswUZzjESg3fTpu8BM+71NwsSlBZ6hD9xGJlU5yTjZNsHEtbW517cZpJGZ6G/pPYZfQEA== X-Received: by 2002:a05:6000:10c6:b0:37d:47b3:7b86 with SMTP id ffacd0b85a97d-37d5529a82dmr11220029f8f.44.1729063390941; Wed, 16 Oct 2024 00:23:10 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 2/3] qemu_namespace: Properly report new files Date: Wed, 16 Oct 2024 09:23:06 +0200 Message-ID: <8d45ac2f1f97dd9be98491cb9258d2135ed0fb74.1729062819.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: R6T5A5UX7PDCPHII642FKDW47XMQR3Y5 X-Message-ID-Hash: R6T5A5UX7PDCPHII642FKDW47XMQR3Y5 X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1729063451954116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Function qemuNamespaceMknodOne() is supposed to return 0 if the file did not exist before this function. If, however, the file existed, but was removed and recreated by this function the @existed flag should be reset to its original state (false) because the function then behaves the same way as if the file did not exist as it needed to be recreated. So reset the @existed flag to properly reflect what happened. Signed-off-by: Martin Kletzander Reviewed-by: Peter Krempa --- src/qemu/qemu_namespace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index 71e29b4ba4f6..33a773917373 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -1022,6 +1022,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data) data->file, data->target); } else { VIR_DEBUG("Creating symlink %s -> %s", data->file, data->targe= t); + existed =3D false; =20 /* First, unlink the symlink target. Symlinks change and * therefore we have no guarantees that pre-existing @@ -1053,6 +1054,7 @@ qemuNamespaceMknodOne(qemuNamespaceMknodItem *data) } else { VIR_DEBUG("Creating dev %s (%d,%d)", data->file, major(data->sb.st_rdev), minor(data->sb.= st_rdev)); + existed =3D false; unlink(data->file); if (mknod(data->file, data->sb.st_mode, data->sb.st_rdev) < 0)= { virReportSystemError(errno, --=20 2.47.0