From nobody Fri May 3 12:05:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1582196576; cv=none; d=zohomail.com; s=zohoarc; b=gXLjFOuPHZ3tY6eP/byEIe6j/ubgL2zeD9txXsS0THW8AXOwM8hWXzZJxAZa/1SdU8j3yTW+/DXbCkodkCzk9U3kBjvoi27hYFaNiA141pCYc86ohOLQd/upTQzA6xyvaGr7ISFMwN6cLiB/RgrfMX0tlatIEarL+P76YWkAAJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582196576; 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=ix7wSNybfZqY7B8k0H+hNZeE9SFZRJZoP8FrMtGqrAU=; b=HEF98pwXN7wVFFqLJMLOi1ypGk4FEFanqJHguRfA/qEXZ0be9d1Bvw29S31Waruzi9Zgm4alCsFaJQWKSgd8IToZar4/1RAh36qci+5u1WcJTeHXjdu8Erbm9IkmPB5a1yZpNOvFtLPQW6BMe9P+imhNoFlObbQqVztKpXh+rs8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1582196576893969.0065597682938; Thu, 20 Feb 2020 03:02:56 -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-179-7xOCUgk8M3iTNEaRxMvMow-1; Thu, 20 Feb 2020 06:02:52 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDB81800D53; Thu, 20 Feb 2020 11:02:46 +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 AAF5A790CF; Thu, 20 Feb 2020 11:02:46 +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 5F7F13F5CF; Thu, 20 Feb 2020 11:02:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01KB2jaB009981 for ; Thu, 20 Feb 2020 06:02:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1818C19C4F; Thu, 20 Feb 2020 11:02:45 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9068B19756 for ; Thu, 20 Feb 2020 11:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582196575; 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=ix7wSNybfZqY7B8k0H+hNZeE9SFZRJZoP8FrMtGqrAU=; b=EdkzpvtlVoDteczkgJmMAAvpD7gey0a1jfG6W0dKWnCS9SyJSV6A6HjxpA8xagtYddGg+8 f0G7QwIuliDqUUN151GeQHe47yN/3rKGsh6gApYvV4lwm2vVXReLWy0DuoAvtUAwcN8RKa Eqw+/Khx3TpZ6xED0Bh0liB9c52f9II= From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] virpidfile: Set correct retval in virPidFileReadPath() Date: Thu, 20 Feb 2020 12:02:35 +0100 Message-Id: <10f8f2a59263f6dabaf4342150890b0d485bc7aa.1582196469.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.15 X-MC-Unique: 7xOCUgk8M3iTNEaRxMvMow-1 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" The virPidFileReadPath() function is supposed to return 0 on success or a negative value on failure. But the negative value has a special meaning - it's negated errno. Therefore, when converting string to int we shouldn't return -1 which translates to EPERM. Returning EINVAL looks closer to the truth. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/util/virpidfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index a8a743504d..d5aa5f4f84 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -130,7 +130,7 @@ int virPidFileReadPath(const char *path, if (virStrToLong_ll(pidstr, &endptr, 10, &pid_value) < 0 || !(*endptr =3D=3D '\0' || g_ascii_isspace(*endptr)) || (pid_t) pid_value !=3D pid_value) { - rc =3D -1; + rc =3D -EINVAL; goto cleanup; } =20 --=20 2.24.1 From nobody Fri May 3 12:05:16 2024 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582196649; cv=none; d=zohomail.com; s=zohoarc; b=eA9Bxwml5xAlqbf2B3ZhXWrUFoIxmtmdcGRI/cC1jeaKwM7Y5CC6KThe21uSeuJPB+JUUOlRfBTOa0E4wk3smJg8BNzbqoUU5pB+C3Jnp2ZLTvDR3XjFTQUP9e3ENFc9kCe2DkkICbGOoNP/M3dv4V+ebBiantMdIQZPhafo9SY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582196649; 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=hkSiqYXduF6QD8r0vUNLYD0PxotJn2y7jdaDbpSgF04=; b=N2pcfv+BznFsGEPyfE6WQJss0rAEhGCvMovtb7yUHYhCZ0+y7EQIRfz61EyomrBLgpLTl0cPvUrgeA42IkCRUlElIiRYS7YMMj3/w6HmbLnftiyCHdnamPKb0HLhKTN3LP//j5iKgbE7ODN4dDeOso114ePL/MeX9tqOjaLyzx8= 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=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1582196649810191.88326538216563; Thu, 20 Feb 2020 03:04:09 -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-41-q5kCu-V3OGumKaJQRtju8Q-1; Thu, 20 Feb 2020 06: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 754AF1005516; Thu, 20 Feb 2020 11:02:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3832E10027B2; Thu, 20 Feb 2020 11:02:52 +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 CCB3518089CD; Thu, 20 Feb 2020 11:02:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01KB2jqf009986 for ; Thu, 20 Feb 2020 06:02:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id E26F719756; Thu, 20 Feb 2020 11:02:45 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67D7919C4F for ; Thu, 20 Feb 2020 11:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582196648; 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=hkSiqYXduF6QD8r0vUNLYD0PxotJn2y7jdaDbpSgF04=; b=Q6mJkqzC/WIL+VJ+nSqJza00V9zuhKtra9jSm6Tx1Y93TM18MvRFBQJ3j6D3twt4ewORy4 9q+wjMEsy+5bA56wTekV8P79rF233A7GxNtXJKkUgX6e/TnTYmT9QwWqusWaL2q6jUJnAq QAGz9IpqE0t+MDq2dfeZoi2LuvZd+fE= X-MC-Unique: q5kCu-V3OGumKaJQRtju8Q-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/3] qemu: Don't explicitly remove pidfile after virPidFileForceCleanupPath() Date: Thu, 20 Feb 2020 12:02:36 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 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" In two places where virPidFileForceCleanupPath() is called, we try to unlink() the pidfile again. This is needless because virPidFileForceCleanupPath() has done just that. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 9 +-------- src/qemu/qemu_vhost_user_gpu.c | 10 +--------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index bf987a3bc3..8c1ed76677 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2802,14 +2802,7 @@ qemuProcessKillManagedPRDaemon(virDomainObjPtr vm) if (virPidFileForceCleanupPath(pidfile) < 0) { VIR_WARN("Unable to kill pr-helper process"); } else { - if (unlink(pidfile) < 0 && - errno !=3D ENOENT) { - virReportSystemError(errno, - _("Unable to remove stale pidfile %s"), - pidfile); - } else { - priv->prDaemonRunning =3D false; - } + priv->prDaemonRunning =3D false; } virErrorRestore(&orig_err); } diff --git a/src/qemu/qemu_vhost_user_gpu.c b/src/qemu/qemu_vhost_user_gpu.c index 51244f9b35..ae1f530338 100644 --- a/src/qemu/qemu_vhost_user_gpu.c +++ b/src/qemu/qemu_vhost_user_gpu.c @@ -223,16 +223,8 @@ void qemuExtVhostUserGPUStop(virQEMUDriverPtr driver, } =20 virErrorPreserveLast(&orig_err); - if (virPidFileForceCleanupPath(pidfile) < 0) { + if (virPidFileForceCleanupPath(pidfile) < 0) VIR_WARN("Unable to kill vhost-user-gpu process"); - } else { - if (unlink(pidfile) < 0 && - errno !=3D ENOENT) { - virReportSystemError(errno, - _("Unable to remove stale pidfile %s"), - pidfile); - } - } virErrorRestore(&orig_err); } =20 --=20 2.24.1 From nobody Fri May 3 12:05:16 2024 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582196587; cv=none; d=zohomail.com; s=zohoarc; b=fgSTwClzVVowrDomm59/Wh6O1vChyoud2PGJmFiou10Wnj/dWIgMhcRmHZr419++Gmud5n0mGQCfWtCCtDkvlVdnjnGkAQ+2sdYB/FsFKFmHcGxC4xjuvE2IdTrK+Vf4gdSNVrDgsuPgTbSil+OWPdeqmbW0oP5WEpxsIGVGtjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582196587; 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=0k5cQRBmNU1SiX9f1Fmw4nJ0fPTu+/YtpzxW1t1IiXo=; b=aVNyviuhlQoUTGO+AmBOyku0wx9ks9Nqu19/ltRKJ8kYtDVxyIOyNzaU0QkU7kk6HFzqRlSBEgaHl3jGnkaFJ+fjsMRJELpUJ81epe8f2bGhyojIATgPPC/yUOrHud2PRclvP1QSlHomQteGxAZGeMoIWyp/mwAkXT9M6VcHwns= 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=pass 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 1582196587190766.6629658237819; Thu, 20 Feb 2020 03:03:07 -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-276-UAIvg9eVNzKR3WcqLHP8pQ-1; Thu, 20 Feb 2020 06:03:02 -0500 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 57DF48017DF; Thu, 20 Feb 2020 11:02:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AA585DA7B; Thu, 20 Feb 2020 11:02:57 +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 CB30518089D0; Thu, 20 Feb 2020 11:02:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01KB2kFZ009995 for ; Thu, 20 Feb 2020 06:02:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id BB13219756; Thu, 20 Feb 2020 11:02:46 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E2C819C4F for ; Thu, 20 Feb 2020 11:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582196585; 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=0k5cQRBmNU1SiX9f1Fmw4nJ0fPTu+/YtpzxW1t1IiXo=; b=ecnXpMX1gPfsO46PQFKLYRdggqOW4+rIn7MSaiQ7xmQQqJdrMQ5tJQkcx3BYVbUvITksjz 0AodLxaqRaNbObu9au9MGKZPC0dpgdeK1t4EqI7quFeia+lP/sPAcghDfGxtlvulHwF0O+ N7p7pEM4Kk1tWb12hdagYy67gxBweCc= From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/3] qemu_migration: Rearrange some checks in qemuMigrationSrcIsAllowed() Date: Thu, 20 Feb 2020 12:02:37 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 X-MC-Unique: UAIvg9eVNzKR3WcqLHP8pQ-1 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" Firstly, the check for disk I/O error can be moved into 'if (!offline)' section a few lines below. Secondly, checks for vmstate and slirp should be moved under the same section because they reflect live state of a domain. For offline migration no QEMU is involved and thus these restrictions are not valid. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration.c | 66 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index ceac81c960..a307c5ebe2 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1185,43 +1185,25 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, nsnapshots); return false; } - - /* cancel migration if disk I/O error is emitted while migrating */ - if (flags & VIR_MIGRATE_ABORT_ON_ERROR && - !(flags & VIR_MIGRATE_OFFLINE) && - virDomainObjGetState(vm, &pauseReason) =3D=3D VIR_DOMAIN_PAUSE= D && - pauseReason =3D=3D VIR_DOMAIN_PAUSED_IOERROR) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("cannot migrate domain with I/O error")); - return false; - } - } - - if (virHashSize(priv->dbusVMStates) > 0 && - !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain requires dbus-vmstate support")); - return false; - } - - for (i =3D 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net =3D vm->def->nets[i]; - qemuSlirpPtr slirp =3D QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; - - if (slirp && !qemuSlirpHasFeature(slirp, QEMU_SLIRP_FEATURE_MIGRAT= E)) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("a slirp-helper cannot be migrated")); - return false; - } } =20 /* following checks don't make sense for offline migration */ if (!(flags & VIR_MIGRATE_OFFLINE)) { - if (remote && - qemuProcessAutoDestroyActive(driver, vm)) { - virReportError(VIR_ERR_OPERATION_INVALID, - "%s", _("domain is marked for auto destroy")); - return false; + if (remote) { + /* cancel migration if disk I/O error is emitted while migrati= ng */ + if (flags & VIR_MIGRATE_ABORT_ON_ERROR && + virDomainObjGetState(vm, &pauseReason) =3D=3D VIR_DOMAIN_P= AUSED && + pauseReason =3D=3D VIR_DOMAIN_PAUSED_IOERROR) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot migrate domain with I/O error")); + return false; + } + + if (qemuProcessAutoDestroyActive(driver, vm)) { + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain is marked for auto destroy"= )); + return false; + } } =20 =20 @@ -1280,6 +1262,24 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, _("migration with shmem device is not supported= ")); return false; } + + if (virHashSize(priv->dbusVMStates) > 0 && + !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("domain requires dbus-vmstate support")); + return false; + } + + for (i =3D 0; i < vm->def->nnets; i++) { + virDomainNetDefPtr net =3D vm->def->nets[i]; + qemuSlirpPtr slirp =3D QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; + + if (slirp && !qemuSlirpHasFeature(slirp, QEMU_SLIRP_FEATURE_MI= GRATE)) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("a slirp-helper cannot be migrated")); + return false; + } + } } =20 return true; --=20 2.24.1