On Wed, Jun 1, 2011 at 1:05 PM, Kevin Wolf <kw...@redhat.com> wrote: > Block drivers that don't support creating images don't have a size option. > Fail > gracefully instead of segfaulting when trying to access the option's value. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-)
A command-line to reproduce the crash would be nice. I noticed this line above your fix: set_option_parameter_int(param, BLOCK_OPT_SIZE, img_size); If I follow correctly there should be an "Unknown option 'size'" error message before set_option_parameter_int() returns -1 (which we ignore) and then crash. Perhaps we should just catch the error when set_option_parameter_int() fails? Stefan