Benoît Canet <benoit.ca...@irqsave.net> writes: > The Wednesday 10 Sep 2014 à 14:40:42 (+0200), Benoît Canet wrote : >> The Wednesday 10 Sep 2014 à 10:13:31 (+0200), Markus Armbruster wrote : [...] >> > diff --git a/qemu-img.c b/qemu-img.c >> > index 4490a22..bad3f64 100644 >> > --- a/qemu-img.c >> > +++ b/qemu-img.c >> > @@ -29,6 +29,7 @@ >> > #include "qemu/error-report.h" >> > #include "qemu/osdep.h" >> > #include "sysemu/sysemu.h" >> > +#include "sysemu/block-backend.h" >> > #include "block/block_int.h" >> > #include "block/qapi.h" >> > #include <getopt.h> >> > @@ -575,6 +576,7 @@ static int img_check(int argc, char **argv) >> > int c, ret; >> > OutputFormat output_format = OFORMAT_HUMAN; >> > const char *filename, *fmt, *output, *cache; >> > + BlockBackend *blk; >> > BlockDriverState *bs; >> > int fix = 0; >> > int flags = BDRV_O_FLAGS | BDRV_O_CHECK; >> > @@ -649,6 +651,7 @@ static int img_check(int argc, char **argv) >> > return 1; >> > } >> > >> >> > + blk = blk_new("image", &error_abort); >> Hmm we are so sure this will work that we don't do if (!block) ? > > Ok I understood we are sure because we control the id and won't use twice the > same.
Exactly! [...]