From nobody Sun Feb 8 23:23:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1600356268; cv=none; d=zohomail.com; s=zohoarc; b=imoj5Rdcv3EfdL0z/Bu5YziAwS5JmlEFy1x8oiDioLX1K+TUydZkgmXPrmurdtZjcQkGbhFctJK6oackGWvIaM4NMMjIwXgql0z7gWLdM2ayuu0WziEDBBXVz0nH3KCPEnnpGQz12i6qja3Vg6gBaMUL3QQvVT4SpPKzu/poQdM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600356268; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dBqUncYJq3Nem9df1Ye7sWxuagERFqN117v8gkDeH+I=; b=hvWRXRZ7oRDK1RrNPw+B92FkFWJCQnHJDLJ40ZU1yLB7aGvF3c3gXme9F2qmzFCeyIheQyw1KVolmIEb5gcBihAyusvNCsgH5yUZVZPKeU/8qWjdvOGWxVWv6tehN+rp5Z0YtXydecVMMoVO2L2EYVFuDHtJdodh1rHqWh10ltY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1600356268968442.8074343429438; Thu, 17 Sep 2020 08:24:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-16-usnSpdddN5-uvCN5MurEQw-1; Thu, 17 Sep 2020 11:24:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2239564098; Thu, 17 Sep 2020 15:24:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F17EC73665; Thu, 17 Sep 2020 15:24:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B2A71183D04C; Thu, 17 Sep 2020 15:24:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08HFO8Ee017786 for ; Thu, 17 Sep 2020 11:24:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7DF4960CC0; Thu, 17 Sep 2020 15:24:08 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-114-29.ams2.redhat.com [10.36.114.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6ADD610F2; Thu, 17 Sep 2020 15:24:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600356267; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dBqUncYJq3Nem9df1Ye7sWxuagERFqN117v8gkDeH+I=; b=JROmyVxCJLu7FhKQg0CM/WrOKy48+0clPtwuPhz3e44OclgsFItmHjmgIMOkNan1fK41hg ncy5RayWOJE8xmW05sVUzZCPk7lelYj8Ah4m43SqlLKU4Tn2LxffLgA8fNDfpLdOkYVCni lGUOWMOH0uxb22F+gZjuxL9XBloo2IQ= X-MC-Unique: usnSpdddN5-uvCN5MurEQw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/9] Jailhouse driver: Implementation of ConnectGetType Date: Thu, 17 Sep 2020 16:23:53 +0100 Message-Id: <20200917152359.1621763-4-berrange@redhat.com> In-Reply-To: <20200917152359.1621763-1-berrange@redhat.com> References: <20200917152359.1621763-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Prakhar Bansal X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Prakhar Bansal --- 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_dri= ver.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" =20 #define VIR_FROM_THIS VIR_FROM_JAILHOUSE =20 @@ -241,16 +243,19 @@ jailhouseStateInitialize(bool privileged G_GNUC_UNUSE= D, static const char * jailhouseConnectGetType(virConnectPtr conn) { - UNUSED(conn); - return NULL; + if (virConnectGetTypeEnsureACL(conn) < 0) + return NULL; =20 + return "JAILHOUSE"; } =20 static char * jailhouseConnectGetHostname(virConnectPtr conn) { - UNUSED(conn); - return NULL; + if (virConnectGetHostnameEnsureACL(conn) < 0) + return NULL; + + return virGetHostname(); } =20 static int @@ -263,7 +268,7 @@ jailhouseNodeGetInfo(virConnectPtr conn, virNodeInfoPtr= info) =20 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; - } =20 static int @@ -350,18 +354,18 @@ static virHypervisorDriver jailhouseHypervisorDriver = =3D { .connectOpen =3D jailhouseConnectOpen, /* 6.3.0 */ .connectClose =3D jailhouseConnectClose, /* 6.3.0 */ .connectListAllDomains =3D jailhouseConnectListAllDomains, /* 6.3.0= */ - .domainLookupByID =3D jailhouseDomainLookupByID, /* 6.3.0 */ - .domainLookupByUUID =3D jailhouseDomainLookupByUUID, /* 6.3.0 */ - .domainLookupByName =3D jailhouseDomainLookupByName, /* 6.3.0 */ - .domainGetXMLDesc =3D jailhouseDomainGetXMLDesc, /* 6.3.0 */ - .domainCreate =3D jailhouseDomainCreate, /* 6.3.0 */ .connectGetType =3D jailhouseConnectGetType, /* 6.3.0 */ .connectGetHostname =3D jailhouseConnectGetHostname, /* 6.3.0 */ - .nodeGetInfo =3D jailhouseNodeGetInfo, /* 6.3.0 */ + .domainCreate =3D jailhouseDomainCreate, /* 6.3.0 */ .domainShutdown =3D jailhouseDomainShutdown, /* 6.3.0 */ .domainDestroy =3D jailhouseDomainDestroy, /* 6.3.0 */ .domainGetInfo =3D jailhouseDomainGetInfo, /* 6.3.0 */ .domainGetState =3D jailhouseDomainGetState, /* 6.3.0 */ + .domainLookupByID =3D jailhouseDomainLookupByID, /* 6.3.0 */ + .domainLookupByUUID =3D jailhouseDomainLookupByUUID, /* 6.3.0 */ + .domainLookupByName =3D jailhouseDomainLookupByName, /* 6.3.0 */ + .domainGetXMLDesc =3D jailhouseDomainGetXMLDesc, /* 6.3.0 */ + .nodeGetInfo =3D jailhouseNodeGetInfo, /* 6.3.0 */ }; =20 =20 --=20 2.26.2