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

Ilias Stamatis posted 1 patch 4 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190620094857.26321-1-stamatis.iliass@gmail.com
Test syntax-check passed
src/test/test_driver.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[libvirt] [PATCH] test_driver: call virCheckFlags on testDomainReboot
Posted by Ilias Stamatis 4 years, 9 months ago
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@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);

     if (!(privdom = testDomObjFromDomain(domain)))
         goto cleanup;
--
2.22.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] test_driver: call virCheckFlags on testDomainReboot
Posted by Erik Skultety 4 years, 9 months ago
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@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] test_driver: call virCheckFlags on testDomainReboot
Posted by Erik Skultety 4 years, 9 months ago
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@gmail.com>
> ---

Reviewed-by: Erik Skultety <eskultet@redhat.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list