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

Re: [libvirt PATCH 3/9] Jailhouse driver: Implementation of ConnectGetType



On Thu, Sep 17, 2020 at 04:23:53PM +0100, Daniel P. Berrangé wrote:
> From: Prakhar Bansal <prakharbansal0910 gmail com>
> 
> ---
>  src/jailhouse/jailhouse_driver.c | 28 ++++++++++++++++------------
>  1 file changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/src/jailhouse/jailhouse_driver.c b/src/jailhouse/jailhouse_driver.c
> index ac9da4c85d..75bf41fc11 100644
> --- a/src/jailhouse/jailhouse_driver.c
> +++ b/src/jailhouse/jailhouse_driver.c
> @@ -32,8 +32,10 @@
>  #include "viralloc.h"
>  #include "virfile.h"
>  #include "virlog.h"
> +#include "virutil.h"
>  #include "vircommand.h"
>  #include "virpidfile.h"
> +#include "access/viraccessapicheck.h"
>  
>  #define VIR_FROM_THIS VIR_FROM_JAILHOUSE
>  
> @@ -241,16 +243,19 @@ jailhouseStateInitialize(bool privileged G_GNUC_UNUSED,
>  static const char *
>  jailhouseConnectGetType(virConnectPtr conn)
>  {
> -    UNUSED(conn);
> -    return NULL;
> +    if (virConnectGetTypeEnsureACL(conn) < 0)
> +        return NULL;
>  
> +    return "JAILHOUSE";
>  }
>  
>  static char *
>  jailhouseConnectGetHostname(virConnectPtr conn)
>  {
> -    UNUSED(conn);
> -    return NULL;
> +    if (virConnectGetHostnameEnsureACL(conn) < 0)
> +        return NULL;
> +
> +    return virGetHostname();
>  }
>  
>  static int
> @@ -263,7 +268,7 @@ jailhouseNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
>  
>  static int
>  jailhouseConnectListAllDomains(virConnectPtr conn,
> -                               virDomainPtr ** domain, unsigned int flags)
> +                               virDomainPtr **domain, unsigned int flags)
>  {
>      UNUSED(conn);
>      UNUSED(domain);
> @@ -300,7 +305,6 @@ jailhouseDomainCreate(virDomainPtr domain)
>  {
>      UNUSED(domain);
>      return -1;
> -
>  }

Put these formatting fixes in the original patch that caused them.

>  
>  static int
> @@ -350,18 +354,18 @@ static virHypervisorDriver jailhouseHypervisorDriver = {
>      .connectOpen = jailhouseConnectOpen,        /* 6.3.0 */
>      .connectClose = jailhouseConnectClose,      /* 6.3.0 */
>      .connectListAllDomains = jailhouseConnectListAllDomains,    /* 6.3.0 */
> -    .domainLookupByID = jailhouseDomainLookupByID,      /* 6.3.0 */
> -    .domainLookupByUUID = jailhouseDomainLookupByUUID,  /* 6.3.0 */
> -    .domainLookupByName = jailhouseDomainLookupByName,  /* 6.3.0 */
> -    .domainGetXMLDesc = jailhouseDomainGetXMLDesc,      /* 6.3.0 */
> -    .domainCreate = jailhouseDomainCreate,      /* 6.3.0 */
>      .connectGetType = jailhouseConnectGetType,  /* 6.3.0 */
>      .connectGetHostname = jailhouseConnectGetHostname,  /* 6.3.0 */
> -    .nodeGetInfo = jailhouseNodeGetInfo,        /* 6.3.0 */
> +    .domainCreate = jailhouseDomainCreate,      /* 6.3.0 */
>      .domainShutdown = jailhouseDomainShutdown,  /* 6.3.0 */
>      .domainDestroy = jailhouseDomainDestroy,    /* 6.3.0 */
>      .domainGetInfo = jailhouseDomainGetInfo,    /* 6.3.0 */
>      .domainGetState = jailhouseDomainGetState,  /* 6.3.0 */
> +    .domainLookupByID = jailhouseDomainLookupByID,      /* 6.3.0 */
> +    .domainLookupByUUID = jailhouseDomainLookupByUUID,  /* 6.3.0 */
> +    .domainLookupByName = jailhouseDomainLookupByName,  /* 6.3.0 */
> +    .domainGetXMLDesc = jailhouseDomainGetXMLDesc,      /* 6.3.0 */
> +    .nodeGetInfo = jailhouseNodeGetInfo,        /* 6.3.0 */
>  };

This re-ordering should be dropped, or done in the original patch


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


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