From nobody Sun Apr 28 14:07:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1626798025; cv=none; d=zohomail.com; s=zohoarc; b=B5bMlJQ08cnHmgtU68BYbWCd2Fp5geg9dtnazBghVYjoqvVTwXWCiIauNVH2VtDqpeYcESaCk9xob6WF6ho3XmlxukxFjF0c7ed5vIejkifG3JU4zS9viKiNK1W3tJbZ6Y8NK76E9jVmpqxdqExa8UsuDJ1A+9fLw1CCjef1M9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626798025; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=jGXfFjPO7xI7SnuYJ+Jap3zUl/MCWxw11yInqQbBxow=; b=MzgmvCRDoNp4xli3kx56obzQfFWBnWx3oHqCUL/Gr0jhZAh9D7pQJYq2BbKGZi+nWYkvM+kXofnOezLS5MEJAAeEYvNJTXeXleRnKN2+Rqpxlw/ZN2+D/ls8LTc1dfw/LrdGnQ7tBZwOducUzF3jkYEnT6RUNBNAcNPZlzMDKkw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1626798025092778.6602682158141; Tue, 20 Jul 2021 09:20:25 -0700 (PDT) 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-396-U2Wz4e0uOz-AMBwHJqaUOA-1; Tue, 20 Jul 2021 12:20:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDD3D804142; Tue, 20 Jul 2021 16:20:16 +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 7E4525D9DC; Tue, 20 Jul 2021 16:20:13 +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 740774EA29; Tue, 20 Jul 2021 16:20:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16KGK60a014867 for ; Tue, 20 Jul 2021 12:20:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 983025D703; Tue, 20 Jul 2021 16:20:06 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C8845D6A1 for ; Tue, 20 Jul 2021 16:20:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626798024; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jGXfFjPO7xI7SnuYJ+Jap3zUl/MCWxw11yInqQbBxow=; b=iOfUu/GPlCkQXTyotaaJ5TlSWrI4gXUZ04RFcEIzTXOfJdBTsz6buQMPYIv6pZerUUh0yq qlwoZZ0oWPJM797WVv0JDg9bJr4hxze8bSgm9C/C6p2+tC4pRLIQoEJllOAupC+nrof8pi 5l5cxAyI1mByVHoWZ/ioykkw7Z5vHes= X-MC-Unique: U2Wz4e0uOz-AMBwHJqaUOA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_migration: Unregister close callback only if connection still exists Date: Tue, 20 Jul 2021 18:19:54 +0200 Message-Id: <55b4ccd9410894196dffbf60e645c131c75378da.1626797987.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.79 on 10.5.11.14 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: 1626798025721100001 Content-Type: text/plain; charset="utf-8" When doing a peer-to-peer migration it may happen that the connection to the destination disappears. If that happens, there's no point in trying to unregister the close callback because the connection is closed already. It results only in polluting logs with this message: error : virNetSocketReadWire:1814 : End of file while reading data: : Inp= ut/output error and the reason for that is unregistering a connection callback results in RPC (among other things). Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1918211 Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/qemu/qemu_migration.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a4f44b465d..4d651aeb1a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5214,9 +5214,11 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driv= er, =20 cleanup: virErrorPreserveLast(&orig_err); - qemuDomainObjEnterRemote(vm); - virConnectUnregisterCloseCallback(dconn, qemuMigrationSrcConnectionClo= sed); - ignore_value(qemuDomainObjExitRemote(vm, false)); + if (dconn && virConnectIsAlive(dconn) =3D=3D 1) { + qemuDomainObjEnterRemote(vm); + virConnectUnregisterCloseCallback(dconn, qemuMigrationSrcConnectio= nClosed); + ignore_value(qemuDomainObjExitRemote(vm, false)); + } virErrorRestore(&orig_err); return ret; } --=20 2.31.1