Searched hist:"1452686495922 b81d6cf43edf025c1aef15965c0" (Results 1 – 1 of 1) sorted by relevance
/openbmc/qemu/ |
H A D | blockdev.c | diff 117e0c82881f05d88902d4059a3171bc6cd02df0 Mon Nov 25 13:28:55 CST 2013 Max Reitz <mreitz@redhat.com> block/drive-mirror: Reuse backing HD for sync=none
For "none" sync mode in "absolute-paths" mode, the current image should be used as the backing file for the newly created image.
The current behavior is: a) If the image to be mirrored has a backing file, use that (which is wrong, since the operations recorded by "none" are applied to the image itself, not to its backing file). b) If the image to be mirrored lacks a backing file, the target doesn't have one either (which is not really wrong, but not really right, either; "none" records a set of operations executed on the image file, therefore having no backing file to apply these operations on seems rather pointless).
For a, this is clearly a bugfix. For b, it is still a bugfix, although it might break existing API - but since that case crashed qemu just three weeks ago (before 1452686495922b81d6cf43edf025c1aef15965c0), we can safely assume there is no such API relying on that case yet.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1385407736-13941-2-git-send-email-mreitz@redhat.com Signed-off-by: Anthony Liguori <aliguori@amazon.com> diff 1452686495922b81d6cf43edf025c1aef15965c0 Wed Nov 06 12:50:44 CST 2013 Max Reitz <mreitz@redhat.com> block/drive-mirror: Check for NULL backing_hd
It should be possible to execute the QMP "drive-mirror" command in "none" sync mode and "absolute-paths" mode even for block devices lacking a backing file.
"absolute-paths" does in fact not require a backing file to be present, as can be seen from the "top" sync mode code path. "top" basically states that the device should indeed have a backing file - however, the current code catches the case if it doesn't and then simply treats it as "full" sync mode, creating a target image without a backing file (in "absolute-paths" mode). Thus, "absolute-paths" does not imply the target file must indeed have a backing file.
Therefore, the target file may be left unbacked in case of "none" sync mode as well, if the specified device is not backed either. Currently, qemu will crash trying to dereference the backing file pointer since it assumes that it will always be non-NULL in that case ("none" with "absolute-paths").
Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|