On Fri, Dec 2, 2011 at 9:15 AM, Kevin Wolf <kw...@redhat.com> wrote: > Am 01.12.2011 18:00, schrieb Stefan Hajnoczi: >> The qed-tool.py utility can inspect and manipulate QED image files. It >> can be used for testing to see the state of image metadata and also to >> inject corruptions into the image file. It also has a scrubbing feature >> to copy just the metadata out of an image file, allowing users to share >> broken image files without revealing data in bug reports. >> >> This has lived in my local repo for a long time but could be useful to >> others. >> >> Signed-off-by: Stefan Hajnoczi <stefa...@linux.vnet.ibm.com> > > For most of the commands, I think qemu-img/qemu-io should be extended > instead of creating scripts for one or two formats and lacking the > functionality for the rest.
I have mixed feelings about that because I don't think a common interface will ever live up to its promise. We will have an interface that no two file formats implement much of (i.e. lots of NULL function pointers). The user experience will be that these commands don't work ("Operation not supported") and it's more flexible (and less code) to write a format-specific script like this. Also, usually before I use any of these potentially destructive commands I review the script's code to double-check exactly what the impact on the file will be. It's nice to have a concise Python script that can be reviewed easily rather than looking through layers of production C code. Do you really think there is much worth making common here? Stefan