[libvirt] [PATCH] test_driver: call virCheckFlags on testDomainReboot

Erik Skultety eskultet at redhat.com
Fri Jun 28 10:40:11 UTC 2019


On Thu, Jun 20, 2019 at 11:48:57AM +0200, Ilias Stamatis wrote:
> Currently the flags argument is completely ignored, but it should be
> checked for any unsupported flags that might have been passed.
>
> Signed-off-by: Ilias Stamatis <stamatis.iliass at gmail.com>
> ---
>  src/test/test_driver.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 2a0ffbc6c5..6b1d53b06d 100755
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -1850,13 +1850,16 @@ static int testDomainShutdown(virDomainPtr domain)
>
>  /* Similar behaviour as shutdown */
>  static int testDomainReboot(virDomainPtr domain,
> -                            unsigned int action ATTRIBUTE_UNUSED)
> +                            unsigned int flags)
>  {
>      testDriverPtr privconn = domain->conn->privateData;
>      virDomainObjPtr privdom;
>      virObjectEventPtr event = NULL;
>      int ret = -1;
>
> +    virCheckFlags(VIR_DOMAIN_REBOOT_DEFAULT | VIR_DOMAIN_REBOOT_ACPI_POWER_BTN |
> +                  VIR_DOMAIN_REBOOT_GUEST_AGENT | VIR_DOMAIN_REBOOT_INITCTL |
> +                  VIR_DOMAIN_REBOOT_SIGNAL | VIR_DOMAIN_REBOOT_PARAVIRT, -1);

Actually, I think for readability, ^these should be specified on individual
lines. I'll fix that before merging.

Erik




More information about the libvir-list mailing list