From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Ydo-0003Sv-2N for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:48:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7Ydj-0000Cb-34 for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:48:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7Ydi-0000CM-RB for qemu-devel@nongnu.org; Tue, 13 Mar 2012 16:48:15 -0400 Message-ID: <4F5FB28A.4090605@redhat.com> Date: Tue, 13 Mar 2012 14:48:10 -0600 From: Eric Blake MIME-Version: 1.0 References: <1331056563-7503-1-git-send-email-pbonzini@redhat.com> <1331056563-7503-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1331056563-7503-11-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigF77C44AD4108A0C8B4DC1D48" Subject: Re: [Qemu-devel] [PATCH v4 10/10] Add the drive-reopen command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, fsimonce@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF77C44AD4108A0C8B4DC1D48 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/06/2012 10:56 AM, Paolo Bonzini wrote: > From: Federico Simoncelli >=20 > Signed-off-by: Federico Simoncelli > Signed-off-by: Paolo Bonzini > ## > +# @drive-reopen > +# > +# Assigns a new image file to a device. > +# > +# @device: the name of the device for which we are changing the image = file. > +# > +# @new-image-file: the target of the new image. If the file doesn't ex= ists the > +# command will fail. > +# > +# @format: #optional the format of the new image, default is 'qcow2'. > +# > +# Returns: nothing on success > +# If @device is not a valid block device, DeviceNotFound > +# If @new-image-file can't be opened, OpenFileFailed > +# If @format is invalid, InvalidBlockFormat > +# > +# Since 1.1 > +## > +{ 'command': 'drive-reopen', > + 'data': { 'device': 'str', 'new-image-file': 'str', '*format': 'str'= } } I still think we need a 'drive-reopen' action included in 'transaction', as an 11/10 on this series. For disk migration, it is true that you can migrate one disk at a time, and therefore only need to reopen one disk at a time, to get the guarantee that for a single disk image, the current state of that image will be guaranteed to be consistent using only one storage domain. But since the API allows the creation of two mirrors in one command, I'm worried that someone will try to start a mirror on two disks at once, but then be stuck doing two separate 'drive-reopen' commands. If the first succeeds but the second fails, you have now stranded the qemu process across two storage domains, which is exactly what we were trying to avoid in the first place by inventing transactions. That is, even if all disks are individually consistent in a single domain, the act of migrating then reopening one disk at a time means you will have a window where disk 1 and disk 2 are opened on different storage domains. Besides, I'm planning on implementing libvirt support for the 'drive-reopen' command by adding a flag to virDomainSnapshotDelete (basically, the presence of the flag states that for all mirrored disks in a given snapshot, libvirt will then issue a drive-reopen that pivots qemu over to the mirror, and finally delete the snapshot now that mirroring is no longer needed). With separate commands, if drive-reopen on disk 1 succeeds, then drive-reopen on disk 2 fails, I can attempt a rollback by doing another drive-reopen on disk 1; but the rollback will be incomplete since I have lost the ability to reopen the mirroring. I would much rather issue a 'transaction' with multiple reopen commands, and knowing that either all disks were reopened and the mirrors discarded, or that none were reopened and the mirroring remains intact. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigF77C44AD4108A0C8B4DC1D48 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJPX7KKAAoJEKeha0olJ0NqiLoH/RYO+J0ZDjrk0KZZzu+UGw1n AYZFvTnpl/G9RTvHu5fsZnc5FtfUj3vC8tOTDXofprWeb9rFt8JXCaVQ4nZduQSk O+knw0i0D6mi9zUOGiTtfg1evBTdSBanYd4zyEVyb2ZdJ/fNsy90y3iMnWncqE05 IJHAFPFe+8z9eAYtA81YnfmC8JoY6RXbauTEe0q1YmiNH6tiDhMHWT54Ra5L2dv6 YmZj5aLzOKxIl8cT0CA5xj6t5LQk3Ml3mAKhlQ4uiiV/UKHpdWNGg7QFyBiSwdC7 en5e61XUfAu+PDF+JU5d3NuUBYL127PBnZVcDbYA1K+TGxXinqzqolF4WUipxF4= =MN78 -----END PGP SIGNATURE----- --------------enigF77C44AD4108A0C8B4DC1D48--