From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdLVM-00045Y-LE for qemu-devel@nongnu.org; Wed, 01 Apr 2015 12:28:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdLVI-0004GW-Mu for qemu-devel@nongnu.org; Wed, 01 Apr 2015 12:28:36 -0400 Message-ID: <551C1CA8.2050203@redhat.com> Date: Wed, 01 Apr 2015 10:28:24 -0600 From: Eric Blake MIME-Version: 1.0 References: <551C19F9.3020409@redhat.com> In-Reply-To: <551C19F9.3020409@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lNo1lPKmJ4hpCmJM5rL3dfr58rCLKmC1e" Subject: Re: [Qemu-devel] qemu-img behavior for locating backing files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , Kevin Wolf Cc: qemu-devel , qemu-block This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lNo1lPKmJ4hpCmJM5rL3dfr58rCLKmC1e Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/01/2015 10:16 AM, John Snow wrote: > Kevin, what's the correct behavior for qemu-img and relative paths when= > creating a new qcow2 file? >=20 > Example: >=20 > (in e.g. /home/qemu/build/ or anywhere not /home: ) > qemu-img create -f qcow2 base.qcow2 32G creates /home/qemu/build/base.qcow2 > qemu-img create -f qcow2 -F qcow2 -b base.qcow2 /home/overlay.qcow2 Tries to create /home/overlay.qcow2; requires /home/base.qcow2 to exist for the creation to be well-formed. (Any use of /home/qemu/build/base.qcow2 should be wrong) If you want, you could do: qemu-img create -f qcow2 /home/overlay.qcow2 $size qemu-img rebase -u -f qcow2 -F qcow2 -b base.qcow2 /home/overlay.qcow2 to create the file that would relatively point to /home/base.qcow2, whether or not that file already exists; and it could be argued that we may even want to support that via a single create command (that is, 'create an image with this string as the backing file, but without actually chasing through that string') >=20 > In 1.7.0., this produces a warning that the base object cannot be found= > (because it does not exist at that location relative to overlay.qcow2),= > but qemu-img will create the qcow2 for you regardless. Sounds almost ideal (or at least an argument for the 'create with an unsafe string for backing) - but how did it pick the size for that image?= >=20 > 2.0, 2.1 and 2.2 all will create the image successfully, with no warnin= gs. Oops. >=20 > 2.3-rc1/master as they exist now will emit an error message and create > no image. Sounds like a bug fix, not a regression. >=20 > Since this is a change in behavior for the pending release, is this the= > correct/desired behavior? Yes, I think so. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lNo1lPKmJ4hpCmJM5rL3dfr58rCLKmC1e 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVHByoAAoJEKeha0olJ0Nq+sQIAI0EtIX9LqjFv3zjOXHfFonG 6wbRk5RJP904R6y6G7ofy6yIzjjUAQEt1UT0zEYrOzlCOyhDpHrrAnw5on70KIMH r6Sv45LKdfaNlxLndUPijASQL7I35wJi9mFwrFef1xXesPQtaWgqlqfKTNoARueN Ll9D/oaL9R/HgPjKAYloxLRobJEpa4JcNHAEW+HnKWHMCPatKNVSS+nPmysYn8NA zfPZDe2gMWQV8VKQYkckclkTpAGEGtH1JekHRN89XA2ep0RrUfqRcoDl6BshZ+nA Fw4HZZl7EoH//sFCD3J9Lf6ou+CJvJbRe7ie8FgRBw2znwjb5E1ERG2QJQpqCqc= =b5Ad -----END PGP SIGNATURE----- --lNo1lPKmJ4hpCmJM5rL3dfr58rCLKmC1e--