Revision d220894e block.c

b/block.c
2881 2881
                    char *options, uint64_t img_size, int flags)
2882 2882
{
2883 2883
    QEMUOptionParameter *param = NULL, *create_options = NULL;
2884
    QEMUOptionParameter *backing_fmt, *backing_file;
2884
    QEMUOptionParameter *backing_fmt, *backing_file, *size;
2885 2885
    BlockDriverState *bs = NULL;
2886 2886
    BlockDriver *drv, *proto_drv;
2887 2887
    BlockDriver *backing_drv = NULL;
......
2964 2964

  
2965 2965
    // The size for the image must always be specified, with one exception:
2966 2966
    // If we are using a backing file, we can obtain the size from there
2967
    if (get_option_parameter(param, BLOCK_OPT_SIZE)->value.n == -1) {
2967
    size = get_option_parameter(param, BLOCK_OPT_SIZE);
2968
    if (size && size->value.n == -1) {
2968 2969
        if (backing_file && backing_file->value.s) {
2969 2970
            uint64_t size;
2970 2971
            char buf[32];

Also available in: Unified diff