On 10/15/2012 12:42 PM, Alex Bligh wrote: > Eric, > > --On 15 October 2012 12:11:02 -0600 Eric Blake <ebl...@redhat.com> wrote: > >> On the other hand, if you don't use -u, then qemu-img complains: >> >> $ qemu-img rebase -b '' bar >> qemu-img: Could not open new backing file '' >> >> So I think a better patch would be to allow rebase-by-pull to work the >> same as unsafe rebase, by honoring the empty string as a request to pull >> the entire chain into the destination and leave no backing file. > > Yes, that's exactly the case we're missing. How about the attached (as > a single patch) > > Also available at: > https://github.com/abligh/qemu > as commits > > https://github.com/abligh/qemu/commit/4cce9c961fa52a71bd6520a9c499f4dc4b174b97 > > and > > https://github.com/abligh/qemu/commit/4d5b3b431d8dd276f4c564d8a82c6d25cb111381 > > > -- > Alex Bligh
Missing a Signed-off-by; as such, it cannot be taken as is. Please repost, and provide an updated subject line and a dedicated commit message (information such as where to download the commit for testing belongs after the --- line). I'm not maintainer for this portion of code, so I can only review it. > @@ -1580,7 +1581,7 @@ static int img_rebase(int argc, char **argv) > if (!unsafe) { > uint64_t num_sectors; > uint64_t old_backing_num_sectors; > - uint64_t new_backing_num_sectors; > + uint64_t new_backing_num_sectors=0; As long as you are touching this line, fix the indentation to be consistent (or is this unusual spacing an artifact of how you pasted your commit after your '-- ' signature rather than submitting it via 'git send-email' as a proper patch?). Also, most of qemu uses spaces on both sides of '='. But the overall idea looks nice. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature