[libvirt] [PATCH] vbox: fix a bug in _machineStateInactive

Michal Privoznik mprivozn at redhat.com
Wed Nov 19 13:37:08 UTC 2014


On 19.11.2014 09:53, Yohan BELLEGUIC wrote:
> This function returned non-inactive domains instead of active domains.
> This broke virConnectNumOfDefinedDomains() and virConnectListDefinedDomains()
> functions.
> ---
>   src/vbox/vbox_tmpl.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
> index de8744d..37ec8e1 100644
> --- a/src/vbox/vbox_tmpl.c
> +++ b/src/vbox/vbox_tmpl.c
> @@ -4607,8 +4607,8 @@ static bool _machineStateOnline(PRUint32 state)
>
>   static bool _machineStateInactive(PRUint32 state)
>   {
> -    return ((state > MachineState_FirstOnline) &&
> -            (state < MachineState_LastOnline));
> +    return ((state < MachineState_FirstOnline) ||
> +            (state > MachineState_LastOnline));
>   }
>
>   static bool _machineStateNotStart(PRUint32 state)
>

ACKed and pushed.

Michal




More information about the libvir-list mailing list