From nobody Wed May 15 17:07:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1585746667; cv=none; d=zohomail.com; s=zohoarc; b=Iyhqwt0sOjXmyoYjX/h+ntPLNSQjbD/typ3wLJykJpyDdNiUqrTLrSqoUC0WL7NW7YCrJ9muHAbGD9s/O+5It+UPZDOZ9UBGoRowigF8BQWJwyyNiBYhCAdukw4WGFke6yAiD9S+ytHOvaNohY2adiAJ5iPa62LJAvs0Fw0yK0A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585746667; 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=dszQHPSXqJflRosuo1yeMfyvRswhl7aiwHiXqg2mJm8=; b=Bvpurp1sV+TLaEe5PnjQK3zFEnT2/Edk33HBUzgHnAV23ze6GffNluj29EV4J46e2NVzQsIC85QRiFa/B2k8wjy1To4paeJGGhbFoUcRMu9KrueCyPYODW2ZMRShVdP8Oj6gDJs34RlkN79bYfdQ+wKHjsMBjLO5Bf0IpgMGgQ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1585746667686397.9670887546728; Wed, 1 Apr 2020 06:11:07 -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-465-IbwMRED6OkWAcm6Hl1tVaA-1; Wed, 01 Apr 2020 09:11:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EFFB118A6EC6; Wed, 1 Apr 2020 13:10:58 +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 4DE0B8AC2D; Wed, 1 Apr 2020 13:10:58 +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 D652F86C03; Wed, 1 Apr 2020 13:10:53 +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 031DAqvR001613 for ; Wed, 1 Apr 2020 09:10:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id A259EA63AA; Wed, 1 Apr 2020 13:10:52 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2679CA63A3 for ; Wed, 1 Apr 2020 13:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585746666; 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=dszQHPSXqJflRosuo1yeMfyvRswhl7aiwHiXqg2mJm8=; b=CgdNfenHHX0Z/tH+rBVXFx8KUB72lm4VvpMWp3j/CA5aVySu5jll5BrnmXz6O/uG6B/OPs ApXDr0Lzme09liZ5EXEscUSvCaor9ZQ9usfMDzAuw+vf4S6C2RujhmrNMUPPlQ9PWVBMEf pGtzJsblaG+1yIVQfRt56SZRa5yUBsc= X-MC-Unique: IbwMRED6OkWAcm6Hl1tVaA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu: checkpoint: Allow checkpoint redefine for offline VMs Date: Wed, 1 Apr 2020 15:10:46 +0200 Message-Id: In-Reply-To: References: 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.11 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" Skip the liveness and capability checks when redefining checkpoints as we don't need qemu interactions to update the metadata. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_checkpoint.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 3a510c9780..8340addf81 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -647,16 +647,18 @@ qemuCheckpointCreateXML(virDomainPtr domain, update_current =3D false; } - if (!virDomainObjIsActive(vm)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot create checkpoint for inactive domain")); - return NULL; - } + if (!redefine) { + if (!virDomainObjIsActive(vm)) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cannot create checkpoint for inactive domain= ")); + return NULL; + } - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("incremental backup is not supported yet")); - return NULL; + if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP))= { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("incremental backup is not supported yet")); + return NULL; + } } if (!(def =3D virDomainCheckpointDefParseString(xmlDesc, driver->xmlop= t, --=20 2.25.1 From nobody Wed May 15 17:07:56 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=1585746688; cv=none; d=zohomail.com; s=zohoarc; b=NGaD0BKN1WAZuJAYoEtYJD8mGfyhkOunxX7CpzBk2Vti2Tv6QaP8/6j1t224EQ7ZVPDglPiW0V+79VodjX/xgh5gyvjISHA5a3vlvFIJvRF1GMUK0Ycn5Nj2HP7tvxQb3CGreLpaLq8p/nJTsFdYW6hjYW8mDrLP2QGTgOyKx/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585746688; 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=R127DghwRuxw8Tk1ApqqjjrCobcIxd4Ef/dVhvJm8NM=; b=XkEL9hTAc7tNnxPh8JPafyNwkCS1SSrLP2FQ9zTWfu+Dj3A5eBNC34YaNyCxJnMsATIPOqKw32spCb0jHdEV+HZQwwsgyxuJmFgC34DZXGlBlVIUhyneFipjBVbKMj8BLOEZCklp56FJWzzt8HrD3FHtibnmGJy1M9DKSXlQpzY= 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 1585746688402880.2191966286948; Wed, 1 Apr 2020 06:11:28 -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-433-B29H0eHlPJSpuG1gWX621w-1; Wed, 01 Apr 2020 09:11:25 -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 3ACCA80256F; Wed, 1 Apr 2020 13:11:19 +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 E64A5610B0; Wed, 1 Apr 2020 13:11:18 +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 97BA01808878; Wed, 1 Apr 2020 13:11:18 +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 031DArUq001624 for ; Wed, 1 Apr 2020 09:10:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7B9CBA63A3; Wed, 1 Apr 2020 13:10:53 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3C90A63AD for ; Wed, 1 Apr 2020 13:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585746687; 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=R127DghwRuxw8Tk1ApqqjjrCobcIxd4Ef/dVhvJm8NM=; b=TW26Q369a5FmbetMePrm8wnVzsvz1ZL6tKdZ2HVoGqds5HZeKvpOJAkqP6wZFhTk8lttJZ XVkfnu4/h5ZYgLNvZyjrNGuTiZ+QT7U5SUvNebZzqlzPG96efyG7st3ULlTbeOShzRDWXH NeqYQ/pS56b2c1KBA2l/9/q+atwKRDM= X-MC-Unique: B29H0eHlPJSpuG1gWX621w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] virDomainCheckpointRedefinePrep: Set 'current' checkpoint if there isn't any Date: Wed, 1 Apr 2020 15:10:47 +0200 Message-Id: <97b2ef7d3dbee1c29a0630418ff925a4e86e2155.1585746591.git.pkrempa@redhat.com> In-Reply-To: References: 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.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" When redefining checkpoints from scratch we'd not set the 'current' checkpoint if there wasn't any. This meant that the code wasn't ever able to set a 'current' checkpoint as any other one looks up if the parent of the redefined checkpoint is current. Since the backup code then requires the current checkpoint to start the lookup we'd not be able to perform a backup after restoring the checkpoint hierarchy. Reported-by: Eyal Shenitzky Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/conf/checkpoint_conf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index 26bcfc16b7..d557fada49 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -550,6 +550,10 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm, *update_current =3D true; } + /* set the first redefined checkpoint as current */ + if (virDomainCheckpointGetCurrent(vm->checkpoints) =3D=3D NULL) + *update_current =3D true; + other =3D virDomainCheckpointFindByName(vm->checkpoints, def->parent.n= ame); if (other) { otherdef =3D virDomainCheckpointObjGetDef(other); --=20 2.25.1