From nobody Tue Feb 10 01:59:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1583223628; cv=none; d=zohomail.com; s=zohoarc; b=dk+FctloAsj555iCD615q/cjcZbidUZuDKOEjPlRSVlbgSpK7nyEn/o2CU7qDqjrllC1DOrY80E4RcPU9SkLeJGs+s8EWfDUIU9WI4oHI2qvPKe9HTNNUk+7LA1psIUQxzg6tHsyyuisjGX3eLNbI8xtmaf/vOmjZqN0M0rx4s8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583223628; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4KyBTLwu5HvsFzTiwodnNzam+l4b5gGpLxCMvG0shM0=; b=NLaW4L8zQ/yP+bm6P287SH9Jlh3GjgXQEpLS2vhrlPyOTBfRwt/3rn2wjjTNocgU7ha7Drvl9j5LOW6DCgEOMUSlunLsHgBf3igaEP+ac287l0RQ/shYNPVj9MgBSGatqV7bos4jIL08Cpc3kupi4MAKhp6twKJVaP+DAAx5OtU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1583223628836751.3092087269032; Tue, 3 Mar 2020 00:20:28 -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-328-Rg2c4Q74NkibNGxocY2OTg-1; Tue, 03 Mar 2020 03:20:23 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 17DC2140B; Tue, 3 Mar 2020 08:20:18 +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 D98B528998; Tue, 3 Mar 2020 08:20:17 +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 801AC86A05; Tue, 3 Mar 2020 08:20:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0238JnCV003664 for ; Tue, 3 Mar 2020 03:19:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8CE4CEB32E; Tue, 3 Mar 2020 08:19:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87EE6EB347 for ; Tue, 3 Mar 2020 08:19:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 B77CD1019E10 for ; Tue, 3 Mar 2020 08:19:44 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-156-_r0Z9d_YNki_ZA0Vs_P9hA-1; Tue, 03 Mar 2020 03:19:42 -0500 Received: from dhcp-172-16-24-106.sw.ru ([172.16.24.106] helo=shiny.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j92mB-0002uR-P9 for libvir-list@redhat.com; Tue, 03 Mar 2020 11:19:39 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583223625; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4KyBTLwu5HvsFzTiwodnNzam+l4b5gGpLxCMvG0shM0=; b=i+mHkSKoUhG2oJ5TJ/ew4itFbfHqOq/N2hAqNPj5A4G3tuIkrre19PVlGqQSqs7oXVYlp8 YsIXjRtts9oLvvmUII3HbWpkXCJATpw2JTMChbozSiMXQxzpLOOxUWDZljkN+DwfoCDI7S 3Yczmd1ad2t2wAbLYWE/ke2WxI8u7lg= X-MC-Unique: Rg2c4Q74NkibNGxocY2OTg-1 X-MC-Unique: _r0Z9d_YNki_ZA0Vs_P9hA-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH 8/8] qemu: qemu: remove remnant files on define Date: Tue, 3 Mar 2020 11:19:22 +0300 Message-Id: <20200303081922.9157-9-nshirokovskiy@virtuozzo.com> In-Reply-To: <20200303081922.9157-1-nshirokovskiy@virtuozzo.com> References: <20200303081922.9157-1-nshirokovskiy@virtuozzo.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0238JnCV003664 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.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Due to failures 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 e1b9240893..f534f8ec99 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7644,6 +7644,9 @@ qemuDomainDefineXMLFlags(virConnectPtr conn, goto cleanup; def =3D NULL; =20 + if (!oldDef && qemuDomainNamePathsCleanup(cfg, vm->def->name, true) < = 0) + goto cleanup; + if (virDomainDefSave(vm->newDef ? vm->newDef : vm->def, driver->xmlopt, cfg->configDir) < 0) goto cleanup; @@ -22030,6 +22033,9 @@ qemuDomainRenameCallback(virDomainObjPtr vm, vm->def->name))) goto cleanup; =20 + if (qemuDomainNamePathsCleanup(cfg, new_name, true) < 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 3fc5388d6a..2e49e466f2 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4915,6 +4915,9 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver, priv->qemuCaps))) goto error; =20 + if (!oldDef && qemuDomainNamePathsCleanup(cfg, vmdef->name, true) < 0) + goto error; + if (virDomainDefSave(vmdef, driver->xmlopt, cfg->configDir) < 0 && !ignoreSaveError) goto error; --=20 2.23.0