[PATCH 3/7] qemuMonitorBlockJobInfo: Store 'ready' and 'ready_present' separately

Michal Privoznik mprivozn at redhat.com
Fri Dec 4 17:26:46 UTC 2020


On 12/4/20 4:07 PM, Peter Krempa wrote:
> Don't make the logic confusing by representing the 3 options using an
> integer with negative values.
> 
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
>   src/qemu/qemu_driver.c       | 9 +++++----
>   src/qemu/qemu_monitor.h      | 3 ++-
>   src/qemu/qemu_monitor_json.c | 8 ++------
>   src/qemu/qemu_process.c      | 4 ++--
>   4 files changed, 11 insertions(+), 13 deletions(-)
> 

> diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
> index 49be2d5412..a2f28f9492 100644
> --- a/src/qemu/qemu_monitor.h
> +++ b/src/qemu/qemu_monitor.h
> @@ -1117,7 +1117,8 @@ struct _qemuMonitorBlockJobInfo {
>       unsigned long long bandwidth; /* in bytes/s */
>       virDomainBlockJobCursor cur;
>       virDomainBlockJobCursor end;
> -    int ready; /* -1 if unknown, 0 if not ready, 1 if ready */
> +    bool ready_present;
> +    bool ready;

At your discretion this can be virTristateBool.

Michal




More information about the libvir-list mailing list