[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Make relative path correct in bdrv_create

From: Balazs Attila-Mihaly \(Cd-MaN\)
Subject: [Qemu-devel] [PATCH] Make relative path correct in bdrv_create
Date: Sun, 30 Dec 2007 02:01:51 -0800 (PST)


When using base images (ie difference disks), the path of the backing image is 
interpreted correctly as being relative to the path of the difference image 
(which is very nice). However, at creation time, the path is copied verbatim 
from the command line, which can lead to incorrect results if the "qemu-img 
create" is issued from a different location than the final location of the 
difference image.

For example:

if we have /home/cdman/qemu/winxp.img and we want to create 
/home/cdman/Desktop/diff.img and we are currently in the /home/cdman directory, 
we would say:
qemu-img create -f qcow2 -b qemu/winxp.img Desktop/diff.img

With the current source, this would write "qemu/winxp.img" in the diff.img 
file, however the correct thing to write would be "../qemu/winxp.img" (because 
the path should be relative to the location of diff.img). The attached patch 
fixes this. 

Warning! It contains string manipulation in C (which no sane person should do 
:)) and was not tested on other platforms than Linux, although I tried to code 
in some Windows compatibility.

PS. If there are no objections to the packet capturing patch 
(http://lists.gnu.org/archive/html/qemu-devel/2007-12/msg00501.html), could 
somebody please apply it? Or if there are, please let me know so that I can 
make any necessary changes.

Best regards

Support the World Aids Awareness campaign this month with Yahoo! For Good 

Attachment: block_relative_create.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]