From nobody Mon Feb 9 23:39:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1604404984; cv=none; d=zohomail.com; s=zohoarc; b=ksew5djTQz+t9UmmwlMiWIDrN8U1Kz91CLjRvGVw6nP2G5qTAUWA0HXMrKqy+yt3XWJN/8d8DN9TXxMJRHVTgb0nVbyjfusx78pPYzdVkMmYrkLYcs1llYFneBaH4YKOMUGgCwze3K4UfukjTyr+j9L3gTzr5oCRcdbxbrqIgcA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604404984; h=Content-Type:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=dcyrd8lrUWE803OMjZORJPygHTptIwldCEprXNAvDYY=; b=TSU5m6AV+SRM4azCouqDpRlyyLCLSNbVDE3k/SnSoX15LVmDbe/SuZdIP0fHHF/m+adsCKDqcU9bog0VdC35ROD6w9hbzeBJ/nRiG2Bk5FvDS9EF36CE22VzGr1BdR3ifc1YQBT7NS/DoDIeTLY92oZD01QWgzCltvhlNFtKMhU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 160440498496380.52526135248377; Tue, 3 Nov 2020 04:03:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-105-Mox03aRhNtiUVapa9DASbA-1; Tue, 03 Nov 2020 07:02:58 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E7B4809DE3; Tue, 3 Nov 2020 12:02:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 07F121002D49; Tue, 3 Nov 2020 12:02:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C92125813E; Tue, 3 Nov 2020 12:02:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A3C2kVw011949 for ; Tue, 3 Nov 2020 07:02:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 35E04110DBC4; Tue, 3 Nov 2020 12:02:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 323C6110DBC2 for ; Tue, 3 Nov 2020 12:02:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CFDB090E429 for ; Tue, 3 Nov 2020 12:02:43 +0000 (UTC) Received: from relay3.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-155--NcnsFN-PNufv70TZYvCqA-1; Tue, 03 Nov 2020 07:02:41 -0500 Received: from [10.28.15.159] (helo=vz7.sw.ru) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from ) id 1kZv10-007EMR-T4 for libvir-list@redhat.com; Tue, 03 Nov 2020 15:02:18 +0300 X-MC-Unique: Mox03aRhNtiUVapa9DASbA-1 X-MC-Unique: -NcnsFN-PNufv70TZYvCqA-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH v2 10/10] qemu: remove possible garbage left from previous rename/undefine Date: Tue, 3 Nov 2020 15:00:08 +0300 Message-Id: <1604404808-825155-11-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1604404808-825155-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1604404808-825155-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Due to failures to unlink on previous rename/undefine we can already have autolink etc files for the domain to be defined. Remove them. Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_driver.c | 6 ++++++ src/qemu/qemu_migration.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6c353a5..3b7d1d7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6719,6 +6719,9 @@ qemuDomainDefineXMLFlags(virConnectPtr conn, goto cleanup; def =3D NULL; =20 + if (!oldDef && qemuDomainNamePathsCleanup(cfg, vm->def->name, false) <= 0) + goto cleanup; + if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def, driver->xmlopt, cfg->configDir) < 0) goto cleanup; @@ -19184,6 +19187,9 @@ qemuDomainRenameCallback(virDomainObjPtr vm, vm->def->name))) return -1; =20 + if (qemuDomainNamePathsCleanup(cfg, new_name, false) < 0) + goto cleanup; + if (vm->autostart) { if (!(new_dom_autostart_link =3D virDomainConfigFile(cfg->autostar= tDir, new_dom_name)) || diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 6f764b0..b4fb586 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5137,6 +5137,9 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver, priv->qemuCaps))) goto error; =20 + if (!oldDef && qemuDomainNamePathsCleanup(cfg, vmdef->name, false) < 0) + goto error; + if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0 && !ignoreSaveError) goto error; --=20 1.8.3.1