From nobody Mon Apr 29 19:53:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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=1585242516; cv=none; d=zohomail.com; s=zohoarc; b=ONXNgRJ4alOIspGzcLjsPB77qgszfcSvJx1xVlxtO2PEKaVaWEAa7tsj4ujzmQoZ06mKCv8PrOS84F8Z4TrrlmFr5wJ3F1bO+/drNmi2sDuWFITUAswuYzVrb1iUlNWlM/GdE6vPdAZZUh3qESfaEh9VGFJfKlC4jDcQvdeFS/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585242516; 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=aIdlSDqXnCKdYODSzrP/ZBqPnqRsNjeC3ecR7mBRYZQ=; b=bwC/nbasxIMbSsJowz/mvvLF7RnLzilfaFjbq8R0kwJUqSRntK7CSZaLyzvT6sh+GFz4iLBf+C5d17f50KjsVEjV9sYd1wcx5TIcAgwNVFnbuE351zNlZkYycmgGFhHdn216I76ulF7tvWx0+EveIiNWCqZPZCzIHDqYJWDtJeU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585242516322574.7611064430943; Thu, 26 Mar 2020 10:08:36 -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-90-L5-JRit7Oyy-GGQ_k_sOPg-1; Thu, 26 Mar 2020 13:08:32 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C348C1088381; Thu, 26 Mar 2020 17:08:26 +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 8E6DF60BF7; Thu, 26 Mar 2020 17:08:25 +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 CCEAB18089CD; Thu, 26 Mar 2020 17:08:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02QH8MFv001485 for ; Thu, 26 Mar 2020 13:08:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A5C310027B9; Thu, 26 Mar 2020 17:08:22 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0011C10027AF for ; Thu, 26 Mar 2020 17:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585242515; 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=aIdlSDqXnCKdYODSzrP/ZBqPnqRsNjeC3ecR7mBRYZQ=; b=PrLNcUL1tsTIAYDavjhL1MzAEDpkkDUZ8peC8i9cCzaV/6JWtM764AyJn9uVA3WJtV3Luf 1siGXkrhH62AqsSDP1clHletq5W/EYuUVXOszn8ontpIHzbrVxmp0clYcb+rWpG0wNZ1fH 7lKC8ppyrhwS0QjJDwrpyddEGaG+61U= X-MC-Unique: L5-JRit7Oyy-GGQ_k_sOPg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemuCheckpointCreateXML: Check VM liveness first Date: Thu, 26 Mar 2020 18:08:18 +0100 Message-Id: <9e570a4bccaa09b7636689ff9d974681e1c7a7a4.1585242498.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.12 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" Move the liveness check prior to the capability check. If the VM is offline the capabilities are not initialized and thus we'd report the wrong error. https://bugzilla.redhat.com/show_bug.cgi?id=3D1812531 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_checkpoint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 62b6e87b53..3a510c9780 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -647,15 +647,15 @@ qemuCheckpointCreateXML(virDomainPtr domain, update_current =3D false; } - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) { + if (!virDomainObjIsActive(vm)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("incremental backup is not supported yet")); + _("cannot create checkpoint for inactive domain")); return NULL; } - if (!virDomainObjIsActive(vm)) { + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot create checkpoint for inactive domain")); + _("incremental backup is not supported yet")); return NULL; } --=20 2.24.1