From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0V8u-0003hb-D4 for qemu-devel@nongnu.org; Thu, 23 Feb 2012 04:39:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0V8l-0005RQ-Ct for qemu-devel@nongnu.org; Thu, 23 Feb 2012 04:39:16 -0500 Received: from mx4-phx2.redhat.com ([209.132.183.25]:60331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0V8l-0005Qt-6P for qemu-devel@nongnu.org; Thu, 23 Feb 2012 04:39:07 -0500 Date: Thu, 23 Feb 2012 04:39:04 -0500 (EST) From: Federico Simoncelli Message-ID: <217d6e69-baf0-4f10-8199-87e2ea7353fb@zmail16.collab.prod.int.phx2.redhat.com> In-Reply-To: <4F45ED0F.4060807@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 3/3] Add nocreate option to snapshot_blkdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, mtosatti@redhat.com, qemu-devel@nongnu.org ----- Original Message ----- > From: "Paolo Bonzini" > Cc: "Federico Simoncelli" , kwolf@redhat.com, mtosatti@redhat.com, qemu-devel@nongnu.org > Sent: Thursday, February 23, 2012 8:38:55 AM > Subject: Re: [PATCH 3/3] Add nocreate option to snapshot_blkdev > > On 02/23/2012 08:19 AM, Paolo Bonzini wrote: > >> > Signed-off-by: Federico Simoncelli > > What is the usecase, and how can this be tested? > > Oops, you explained it in part 0. > > > Step 5 - Final Switch to Destination > > ==================================== > > VM1 is now able to switch to the destination for both read and > > write > > operations. > > > > [src/hd0base] <- [src/hd0snap1] <= VM1(read-write) > > > > (qemu) snapshot_blkdev -n ide0-hd0 /tmp/dst/hd0snap1.qcow2 > > It seems to me that reusing the snapshot_blkdev command is a bit of a > misnomer. It also forces you to use format autodetection for the > destination in the blkmirror phase. > > I see two possibilities: > > 1) you can make a new command block_reopen; this fixes only the > naming > problem. > > 2) you can hide the new format behind a new command to be used like > this: > > block_migrate --mirror ide-hd0 /tmp/dst/hd0snap1.qcow2 > ... > block_migrate --switch ide-hd0 > > This leave the possibility to specify the format in the future: > > block_migrate --mirror ide-hd0 /tmp/dst/hd0snap1.qcow2 qcow2 > > And we could have another sub-command > > block_mirror --stream ide-hd0 /tmp/dst/hd0.raw > > to migrate block devices without shared storage and without an > intermediate snapshot. I agree on the fact that using snapshot_blkdev is a misnomer but at the same time I like very much how blkmirror is modular and it can be used as a regular image filename. I'm worried that making it explicit with a "--mirror" option would take away its flexibility. What about adding block_reopen and extending the blkmirror string: (qemu) block_reopen ide-hd0 \ blkmirror:qcow2:/tmp/src/hd0snap1.qcow2:/tmp/dst/hd0snap1.qcow2 so that the format is passed as first argument (and if it's empty we would use the auto-detection). -- Federico