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

Ján Tomko jtomko at redhat.com
Tue Sep 1 14:21:26 UTC 2020


On a Monday in 2020, Prakhar Bansal wrote:
>---

This also implements GetHostname - they would look nicer in separate
pateches.

> 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";

And this would look better as "Jailhouse".

Jano

> }
>
> static char *
> jailhouseConnectGetHostname(virConnectPtr conn)
> {
>-    UNUSED(conn);
>-    return NULL;
>+    if (virConnectGetHostnameEnsureACL(conn) < 0)
>+        return NULL;
>+
>+    return virGetHostname();
> }
>
> static int
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200901/faa72026/attachment-0001.sig>


More information about the libvir-list mailing list