From nobody Tue Feb 10 07:41:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1496770721902943.8323709239952; Tue, 6 Jun 2017 10:38:41 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 90CFC80481; Tue, 6 Jun 2017 17:38:39 +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 6AF4E7D4E3; Tue, 6 Jun 2017 17:38:39 +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 14B904A48F; Tue, 6 Jun 2017 17:38:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v56EkNli029189 for ; Tue, 6 Jun 2017 10:46:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 000C517D29; Tue, 6 Jun 2017 14:46:23 +0000 (UTC) Received: from angien.brq.redhat.com (dhcp129-47.brq.redhat.com [10.34.129.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5703F17CCF; Tue, 6 Jun 2017 14:46:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 90CFC80481 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 90CFC80481 From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 6 Jun 2017 16:46:15 +0200 Message-Id: <94f280a2f9b95bb517105feba1b9408d772653fb.1496760336.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 2/2] virsh: Add support for VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 06 Jun 2017 17:38:40 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Allow using the new flag with virsh. --- tools/virsh-domain.c | 10 +++++++++- tools/virsh.pod | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index ccb514ef9..f39589c20 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2184,6 +2184,10 @@ static const vshCmdOptDef opts_block_copy[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("the bandwidth limit is in bytes/s rather than MiB/s") }, + {.name =3D "transient-job", + .type =3D VSH_OT_BOOL, + .help =3D N_("the copy job is not persisted if VM is turned off") + }, {.name =3D NULL} }; @@ -2205,6 +2209,7 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd) bool blocking =3D vshCommandOptBool(cmd, "wait") || finish || pivot; bool async =3D vshCommandOptBool(cmd, "async"); bool bytes =3D vshCommandOptBool(cmd, "bytes"); + bool transientjob =3D vshCommandOptBool(cmd, "transient-job"); int timeout =3D 0; const char *path =3D NULL; int abort_flags =3D 0; @@ -2234,6 +2239,8 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd) flags |=3D VIR_DOMAIN_BLOCK_REBASE_SHALLOW; if (vshCommandOptBool(cmd, "reuse-external")) flags |=3D VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT; + if (transientjob) + flags |=3D VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB; if (vshCommandOptTimeoutToMs(ctl, cmd, &timeout) < 0) return false; @@ -2282,7 +2289,8 @@ cmdBlockCopy(vshControl *ctl, const vshCmd *cmd) } } - if (granularity || buf_size || (format && STRNEQ(format, "raw")) || xm= l) { + if (granularity || buf_size || (format && STRNEQ(format, "raw")) || xm= l || + transientjob) { /* New API */ if (bandwidth || granularity || buf_size) { params =3D vshCalloc(ctl, 3, sizeof(*params)); diff --git a/tools/virsh.pod b/tools/virsh.pod index aee964689..b15595c3c 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1078,6 +1078,7 @@ command. | I<--xml> B } [I<--shallow>] [I<--reuse-external>] [I] [I<--wait> [I<--async>] [I<--verbose>]] [{I<--pivot> | I<--finish>}] [I<--timeout> B] [I] [I] [I<--bytes>] +[I<--transient-job>] Copy a disk backing image chain to a destination. Either I as the destination file name, or I<--xml> with the name of an XML file contai= ning @@ -1132,6 +1133,9 @@ within a certain range. Specifying I will c= ontrol how much data can be simultaneously in-flight during the copy; larger values use more memory= but may allow faster completion (the default value is usually correct). +I<--transient-job> allows to specify that the user does not require the jo= b to +be recovered if the VM crashes or is turned off before the job completes. + =3Ditem B I I [I] [I<--bytes>] [I] [I<--wait> [I<--verbose>] [I<--timeout> B] [I<--async>]] [I<--keep-relative>] --=20 2.12.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list