On 10/23/2014 08:56 AM, Max Reitz wrote:
> Sometimes, qemu does not have a filename to work with (it then generates
> a JSON filename), so it does not know which directory to use for a
> backing file specified by a relative filename.
> 
> In this case, qemu should not somehow try to append the backing file's
> name to the JSON object, but rather just print an error and bail out.

Hmm. Makes me wonder if we should extend BlockdevOptions to allow for a
BDS to additionally track a notion of "current directory" from which any
relative names should be interpreted against.  That is, something like:

 TEST_IMG="json:{
     'driver': '$IMGFMT',
     'file': {
         'driver': 'blkdebug',
         'image': {
             'driver': 'file',
             'filename': '$TEST_IMG'
         },
+        'rel-dir': '$DIR_OF_TEST_IMG_BACK',
         'set-state': [
             {
                 'event': 'read_aio',
                 'new_state': 42
             }
         ]
     }
 }" _img_info | _filter_img_info

being a way to let us access the (otherwise relative-only) backing file
encoded behind the blkdebug wall with a notion of the correct directory
to find it in.  Of course, such an extension to BDS description (for
both command line and QMP) would be a separate series...

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to