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

Re: [libvirt] [PATCH 05/11] Separate internal node device APIs from public API



On 05/02/2013 02:03 PM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange redhat com>
> 
> The individual hypervisor drivers were directly referencing
> APIs in src/nodeinfo.c in their virDriverPtr struct. Separate
> these methods, so there is always a wrapper in the hypervisor
> driver. This allows the unused virConnectPtr args to be
> removed from the nodeinfo.c file. Again this will ensure that
> ACL checks will only be performed on invocations that are
> directly associated with public API usage.
> 
> Signed-off-by: Daniel P. Berrange <berrange redhat com>
> ---
>  src/check-driverimpls.pl         |  3 --
>  src/lxc/lxc_driver.c             | 92 +++++++++++++++++++++++++++++++++++----
>  src/nodeinfo.c                   | 42 ++++++++----------
>  src/nodeinfo.h                   | 22 ++++------
>  src/openvz/openvz_conf.c         |  2 +-
>  src/openvz/openvz_driver.c       | 70 +++++++++++++++++++++++++++---
>  src/parallels/parallels_driver.c | 12 +++++-
>  src/qemu/qemu_capabilities.c     |  2 +-
>  src/qemu/qemu_driver.c           | 93 ++++++++++++++++++++++++++++++++++++----
>  src/uml/uml_driver.c             | 92 +++++++++++++++++++++++++++++++++++----
>  src/vbox/vbox_tmpl.c             | 30 +++++++++++--
>  src/xen/xen_driver.c             | 24 ++++++++++-
>  12 files changed, 403 insertions(+), 81 deletions(-)
> 
> diff --git a/src/check-driverimpls.pl b/src/check-driverimpls.pl
> index 52b14e4..e385de0 100755
> --- a/src/check-driverimpls.pl
> +++ b/src/check-driverimpls.pl
> @@ -42,9 +42,6 @@ while (<>) {
>              my $prefix = $impl;
>              $prefix =~ s/^([a-z]+(?:Unified)?)(.*?)$/$1/;
>  
> -            # External impls
> -            next if $prefix eq "node";
> -
>              if (defined $mainprefix) {
>                  if ($mainprefix ne $prefix) {
>                      print "$ARGV:$. Bad prefix '$prefix' for API '$api', expecting '$mainprefix'\n";
> diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
> index 1475d04..04de015 100644
> --- a/src/lxc/lxc_driver.c
> +++ b/src/lxc/lxc_driver.c
> @@ -4402,6 +4402,82 @@ lxcConnectGetSysinfo(virConnectPtr conn, unsigned int flags)
>  }
>  
>  
> +static int
> +lxcNodeGetInfo(virConnectPtr conn ATTRIBUTE_UNUSED,
> +                virNodeInfoPtr nodeinfo)
                  ^ indentation

> +{
> +    return nodeGetInfo(nodeinfo);
> +}
> +
> +

ACK with the check-driverimpls.pl hunk removed.

Jan


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