Re: [PATCH v2 10/15] test: Finalize removal of locking from driver->eventState

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

 




On 06/24/2015 10:11 AM, Peter Krempa wrote:
> Don't lock the driver when registering event callbacks.
> ---
>  src/test/test_driver.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/src/test/test_driver.c b/src/test/test_driver.c
> index 2ab0402..b08c1e5 100644
> --- a/src/test/test_driver.c
> +++ b/src/test/test_driver.c
> @@ -5915,11 +5915,9 @@ testConnectDomainEventRegister(virConnectPtr conn,
>      testDriverPtr driver = conn->privateData;
>      int ret = 0;
> 
> -    testDriverLock(driver);
>      if (virDomainEventStateRegister(conn, driver->eventState,
>                                      callback, opaque, freecb) < 0)
>          ret = -1;
> -    testDriverUnlock(driver);
> 
>      return ret;
>  }
> @@ -5932,11 +5930,9 @@ testConnectDomainEventDeregister(virConnectPtr conn,
>      testDriverPtr driver = conn->privateData;
>      int ret = 0;
> 
> -    testDriverLock(driver);
>      if (virDomainEventStateDeregister(conn, driver->eventState,
>                                        callback) < 0)
>          ret = -1;
> -    testDriverUnlock(driver);
> 
>      return ret;
>  }
> @@ -5953,12 +5949,10 @@ testConnectDomainEventRegisterAny(virConnectPtr conn,
>      testDriverPtr driver = conn->privateData;
>      int ret;

int ret = 0;

> 
> -    testDriverLock(driver);
>      if (virDomainEventStateRegisterID(conn, driver->eventState,
>                                        dom, eventID,
>                                        callback, opaque, freecb, &ret) < 0)
>          ret = -1;
> -    testDriverUnlock(driver);
> 
>      return ret;
>  }
> @@ -5970,11 +5964,9 @@ testConnectDomainEventDeregisterAny(virConnectPtr conn,
>      testDriverPtr driver = conn->privateData;
>      int ret = 0;
> 
> -    testDriverLock(driver);
>      if (virObjectEventStateDeregisterID(conn, driver->eventState,
>                                          callbackID) < 0)
>          ret = -1;
> -    testDriverUnlock(driver);
> 
>      return ret;
>  }
> @@ -5991,12 +5983,10 @@ testConnectNetworkEventRegisterAny(virConnectPtr conn,
>      testDriverPtr driver = conn->privateData;
>      int ret;
> 
int ret = 0;


I know, existing... but for consistency of other places...  not
required, but suggested ;-)

John

> -    testDriverLock(driver);
>      if (virNetworkEventStateRegisterID(conn, driver->eventState,
>                                         net, eventID, callback,
>                                         opaque, freecb, &ret) < 0)
>          ret = -1;
> -    testDriverUnlock(driver);
> 
>      return ret;
>  }
> @@ -6008,11 +5998,9 @@ testConnectNetworkEventDeregisterAny(virConnectPtr conn,
>      testDriverPtr driver = conn->privateData;
>      int ret = 0;
> 
> -    testDriverLock(driver);
>      if (virObjectEventStateDeregisterID(conn, driver->eventState,
>                                          callbackID) < 0)
>          ret = -1;
> -    testDriverUnlock(driver);
> 
>      return ret;
>  }
> 

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]