Re: [PATCH 7/6] Dedicated name for sub-driver open/close methods

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

 



On 04/23/2013 09:57 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> It will simplify later work if the sub-drivers have dedicated
> APIs / field names. ie virNetworkDriver should have
> virDrvNetworkOpen and virDrvNetworkClose methods
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  docs/hvsupport.pl                       |  4 +++
>  src/datatypes.c                         | 12 ++++-----
>  src/driver.h                            | 47 ++++++++++++++++++++++++---------

>  tests/qemuxml2argvtest.c                |  4 +--
>  31 files changed, 129 insertions(+), 102 deletions(-)

Not as mechanical, but also small enough to review closely.  Still
passes 'make check'.

> +++ b/src/datatypes.c
> @@ -144,17 +144,17 @@ virConnectDispose(void *obj)
>      virConnectPtr conn = obj;
>  
>      if (conn->networkDriver)
> -        conn->networkDriver->connectClose(conn);
> +        conn->networkDriver->networkClose(conn);
>      if (conn->interfaceDriver)
> -        conn->interfaceDriver->connectClose(conn);
> +        conn->interfaceDriver->interfaceClose(conn);

Definite improvement in this use case.

> +++ b/src/esx/esx_device_monitor.c
> @@ -69,8 +69,8 @@ esxDeviceClose(virConnectPtr conn)
>  
>  static virNodeDeviceDriver esxNodeDeviceDriver = {
>      .name = "ESX",
> -    .connectOpen = esxDeviceOpen, /* 0.7.6 */
> -    .connectClose = esxDeviceClose, /* 0.7.6 */
> +    .nodeDeviceOpen = esxDeviceOpen, /* 0.7.6 */
> +    .nodeDeviceClose = esxDeviceClose, /* 0.7.6 */
>  };

In fact, this fixes one of the comments I made in 4/6, at least for this
file (there may be other places where the driver callback function name
doesn't match the driver.h struct member name, still worth cleaning up
separately).

/me peeks ahead

Oh, patch 8 solves that remaining mismatch :)  We must be thinking alike
on the cleanup today.

ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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]