On 10/28/2010 04:51 AM, Daniel P. Berrange wrote:
The problem is that this wouldn't work in the general case. It's rather
an exception that it makes sense for file: backing files with file:
images. Consider this:

   # qemu-img create -o backing_file=nbd:foo:1234 /tmp/main.img

Without this patch, you'll end up with /tmp/nbd:foo:1234, which is
probably not what you wanted. With a patch that would work for file: you
would get a hardly better path nbd:/tmp/foo:1234
Since we know the protocol, there could be a per-protocol function used
for resolving the backing store URI relative to the master URI. That
would avoid needing to special case file: in the shared generic code.

Relative resolution of a backing files makes me very nervous. Any time a disk image can reasonably resolve to something other than what the user expected is potentially a very nasty security issue.

The less obvious the resolution, the worse the problem becomes. I think resolution based on current path is probably the most obvious implementation.

Regards,

Anthony Liguori

Daniel


Reply via email to