On 2017-12-04 17:37, Alberto Garcia wrote:
> On Mon 20 Nov 2017 09:10:00 PM CET, Max Reitz wrote:
>> -static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options)
>> +static void blkdebug_refresh_filename(BlockDriverState *bs)
>>  {
>>      BDRVBlkdebugState *s = bs->opaque;
>> -    QDict *opts;
>>      const QDictEntry *e;
>> -    bool force_json = false;
>> -
>> -    for (e = qdict_first(options); e; e = qdict_next(options, e)) {
>> -        if (strcmp(qdict_entry_key(e), "config") &&
>> -            strcmp(qdict_entry_key(e), "x-image"))
>> -        {
>> -            force_json = true;
>> -            break;
>> -        }
>> -    }
>> +    int ret;
>>  
>> -    if (force_json && !bs->file->bs->full_open_options) {
>> -        /* The config file cannot be recreated, so creating a plain filename
>> -         * is impossible */
>> +    if (!bs->file->bs->exact_filename[0]) {
>>          return;
>>      }
>>  
>> -    if (!force_json && bs->file->bs->exact_filename[0]) {
>> -        int ret = snprintf(bs->exact_filename, sizeof(bs->exact_filename),
>> -                           "blkdebug:%s:%s", s->config_file ?: "",
>> -                           bs->file->bs->exact_filename);
>> -        if (ret >= sizeof(bs->exact_filename)) {
>> -            /* An overflow makes the filename unusable, so do not report 
>> any */
>> -            bs->exact_filename[0] = 0;
>> +    for (e = qdict_first(bs->full_open_options); e;
>> +         e = qdict_next(bs->full_open_options, e))
>> +    {
>> +        if (strcmp(qdict_entry_key(e), "config") &&
>> +            strcmp(qdict_entry_key(e), "image") &&
> 
> Shouldn't this be "x-image" ?

Er, yes.  It should.

Max

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to