From: Uri Lublin <uril@redhat.com>
To: qemu-devel@nongnu.org
Cc: Cyril Plisko <cplisko@redhat.com>, Uri Lublin <uril@redhat.com>,
Igor Lvovsky <ilvovsky@redhat.com>
Subject: [Qemu-devel] [RFC] A more consistent qemu-img create with a relative path backing file
Date: Mon, 26 Jan 2009 12:03:58 +0200 [thread overview]
Message-ID: <497D8A8E.2050406@redhat.com> (raw)
Hello,
Currently there is a difference in the way "qemu-img create -b" opens a backing
file and the way bdrv_open does that, when the backing file path is relative.
The former calculates the relative path from the CWD, while the latter
calculates the relative path from the filename's directory. This inconsistency
force the user to change-dir into the created-file directory when creating a new
image.
For example, let the backing file be <images>/dir1/g1.qcow2
and let image to be created be <images>/dir2/g2.qcow2, the steps I need to
take are:
1. cd <images>/dir2
2. qemu-img create -b ../dir1/g1.qcow2 -f qcow2 g2.qcow2
3. cd -
If I skip step 1 then both following options fail (let my CWD be e.g <images>)
a. qemu-img create -b ../dir1/g1.qcow2 -f qcow2 dir2/g2.qcow2 or
b. qemu-img create -b dir1/g1.qcow2 -f qcow2 dir2/g2.qcow
Option (a) fails to open the backing file and "qemu-img create" fails
Option (b) "qemu-img create" succeeds, but bdrv_open fails (e.g. "qemu-img info
dir2/g2.qcow"), as the backing file path calculation result in
<images>/dir2/dir1/g1.qcow2.
We suggest that the path calculation (full path from relative) will be done the
same for qemu-img create and for qemu-img info (bdrv_open), making their
behavior consistent. Thus qemu-img create will first calculate the backing file
path relative to the created-file path (using path_combine), making (1)+(2)+(3)
and (a) above the same.
In order to keep current behavior working, we suggest adding a new flag (-s or
-r) to qemu-img create for the new suggested behavior.
Would such a patch be acceptable ?
Thanks,
Uri.
reply other threads:[~2009-01-26 19:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=497D8A8E.2050406@redhat.com \
--to=uril@redhat.com \
--cc=cplisko@redhat.com \
--cc=ilvovsky@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).