[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv2 14/27] test: reject unknown flags



2011/7/8 Eric Blake <eblake redhat com>:
> * src/test/test_driver.c (testOpen, testDomainCoreDump)
> (testOpenNetwork, testNetworkGetXMLDesc, testOpenInterface)
> (testInterfaceChangeBegin, testInterfaceChangeCommit)
> (testInterfaceChangeRollback, testInterfaceGetXMLDesc)
> (testInterfaceDefineXML, testInterfaceCreate)
> (testInterfaceDestroy, testStorageOpen, testStoragePoolStart)
> (testStorageFindPoolSources, testStoragePoolCreate)
> (testStoragePoolDefine, testStoragePoolBuild)
> (testStoragePoolDelete, testStoragePoolRefresh)
> (testStoragePoolGetXMLDesc, testStorageVolumeCreateXML)
> (testStorageVolumeCreateXMLFrom, testStorageVolumeDelete)
> (testStorageVolumeGetXMLDesc, testDevMonOpen)
> (testNodeNumOfDevices, testNodeListDevices)
> (testNodeDeviceGetXMLDesc, testNodeDeviceCreateXML)
> (testSecretOpen, testNWFilterOpen): Reject unknown flags.
> ---
>  src/test/test_driver.c |  144 +++++++++++++++++++++++++++++++++++++-----------
>  1 files changed, 112 insertions(+), 32 deletions(-)
>
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 98daca8..5ff01a3 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -1099,11 +1099,13 @@ static int testOpenFromFile(virConnectPtr conn,
>
>  static virDrvOpenStatus testOpen(virConnectPtr conn,
>                                  virConnectAuthPtr auth ATTRIBUTE_UNUSED,
> -                                 unsigned int flags ATTRIBUTE_UNUSED)
> +                                 unsigned int flags)
>  {
>     int ret;
>     testConnPtr privconn;
>
> +    virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
> +
>     if (!conn->uri)
>         return VIR_DRV_OPEN_DECLINED;
>
> @@ -1904,7 +1906,7 @@ cleanup:
>
>  static int testDomainCoreDump(virDomainPtr domain,
>                               const char *to,
> -                              unsigned int flags ATTRIBUTE_UNUSED)
> +                              unsigned int flags)
>  {
>     testConnPtr privconn = domain->conn->privateData;
>     int fd = -1;
> @@ -1912,6 +1914,8 @@ static int testDomainCoreDump(virDomainPtr domain,
>     virDomainEventPtr event = NULL;
>     int ret = -1;
>
> +    virCheckFlags(0, -1);

testDomainCoreDump understands VIR_DUMP_CRASH. Don't get fooled by the
ATTRIBUTE_UNUSED :)

ACK, with testDomainCoreDump fixed.

-- 
Matthias Bolte
http://photron.blogspot.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]