Skip to contentSkip to conversation

bad error message in drive-mirror

Qemu-devel Eric Blake 2 participants 2 messages Aug 25, 2014 – Aug 27, 2014

lore
Share & tools
lore

Eric Blake

author
#0 lore raw

I just noticed today that passing "granularity":1 to QMP drive-mirror results in this confusing error message:

Invalid parameter 'drive-virtio-disk0'

because the code mistakenly did

        error_set(errp, QERR_INVALID_PARAMETER, device);
instead of the correct
        error_set(errp, QERR_INVALID_PARAMETER, "granularity");

I ran out of time to patch it today, and at any rate, whoever writes the patch should probably audit for other bad uses of error_set(QERR_INVALID_PARAMETER).

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
#1 lore raw
Quoted 5 lines · Eric Blake

I just noticed today that passing "granularity":1 to QMP drive-mirror results in this confusing error message:

Invalid parameter 'drive-virtio-disk0'

Quoted 8 lines

because the code mistakenly did

        error_set(errp, QERR_INVALID_PARAMETER, device);
instead of the correct
        error_set(errp, QERR_INVALID_PARAMETER, "granularity");

I ran out of time to patch it today, and at any rate, whoever writes the patch should probably audit for other bad uses of error_set(QERR_INVALID_PARAMETER).

I have sent a patch to fix this. Thanks for reporting it.

Stefan