]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: copy: Accept 'format' parameter when copying to a non-existing img
authorPeter Krempa <pkrempa@redhat.com>
Tue, 1 Jul 2014 11:52:51 +0000 (13:52 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 1 Jul 2014 15:45:26 +0000 (17:45 +0200)
commit42619ed05d7924978f3e6e2399522fc6f30607de
tree07a8383f4f92ef13acb30b64e8fa5b9e6abf7165
parentf412fc9ffa67888a772c6b8c6a96ebad8a47a373
qemu: copy: Accept 'format' parameter when copying to a non-existing img

We have the following matrix of possible arguments handled by the logic
statement touched by this patch:
       | flags & _REUSE_EXT | !(flags & _REUSE_EXT)
-------+--------------------+----------------------
 format| (1)                | (2)
-------+--------------------+----------------------
!format| (3)                | (4)
-------+--------------------+----------------------

In cases 1 and 2 the user provided a format, in cases 3 and 4 not. The
user requests to use a pre-existing image in 1 and 3 and libvirt will
create a new image in 2 and 4.

The difference between cases 3 and 4 is that for 3 the format is probed
from the user-provided image, whereas in 4 we just use the existing disk
format.

The current code would treat cases 1,3 and 4 correctly but in case 2 the
format provided by the user would be ignored.

The particular piece of code was broken in commit 35c7701c64508f975dfeb8
but since it was introduced a few commits before that it was never
released as working.
src/qemu/qemu_driver.c