On Sun, Aug 19, 2012 at 8:16 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 19/08/2012 00:02, ronnie sahlberg ha scritto: >> Neither of them work, basically because in >> block.c:find_image_format() >> >> if bs->sg is not set in >> >> if (bs->sg || !bdrv_is_inserted(bs)) { >> >> then we continue to >> >> ret = bdrv_pread(bs, 0, buf, sizeof(buf)); >> >> which fails with an error. >> So this patch is basically to prevent find_image_format() from trying >> to read from a blank disk. >> >> Maybe there is a better way to do this? > > Yeah, I think in this case find_image_format should just use raw.
Ok, so that is basically what the patch does. It forces bs->sg==true so that we pick "raw" right there instead of trying to read from the device. So you are happy with the patch ? regards ronnie sahlberg