From nobody Sun Feb 8 05:40:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1587125043; cv=none; d=zohomail.com; s=zohoarc; b=SfHTNgmC4kMEPDNcULBetzaG2pWKGdT+610WJplr4kfEWeZhMcKG0TtDJMBm4DV7FIuXq2sKGYsNXA3J71C5vk18j/cD+MBhedcawqv9syusRMZ84Ko8o9R3UtSUrY/4QjoLLcpSJ9/dBkuivagGdXvRROi7PhLlitBEn3C8MMs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587125043; h=Content-Type:Content-Transfer-Encoding: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=GVQoSxlOWTKJILsyzGM86N1QGERX10wdRuy/nLBswVM=; b=hvxqc4V8g+DfcIKlyuULaWMGBcE09sbDnxM/zdNcV1X5VMiZHs0kaPCsj9evpS3hleEoL5q+PMBRULzDaZnVq2PRONGfUstUPTafL5xQT7pSdyknMMJL3UUleYDEIOT6JfXy2r9U9qNiMJAnXozWHCuzSjWWdvBtzHadH3idr+k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1587125043552514.6676874731712; Fri, 17 Apr 2020 05:04:03 -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-328-x2lXHQiWPdaYsA65CojQwQ-1; Fri, 17 Apr 2020 08:02:30 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EBF0EA0CC4; Fri, 17 Apr 2020 12:02:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAE6E11D2DD; Fri, 17 Apr 2020 12:02:24 +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 6839C938F3; Fri, 17 Apr 2020 12:02:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03HC2GJP024777 for ; Fri, 17 Apr 2020 08:02:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A06F5C296; Fri, 17 Apr 2020 12:02:16 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.110.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFE275C221; Fri, 17 Apr 2020 12:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587125042; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=GVQoSxlOWTKJILsyzGM86N1QGERX10wdRuy/nLBswVM=; b=fV2FKQ5nY4TxVUGW6tpqz0kiSwaXngweAbaXL/8XfskS4jkssFJUI1N7RIqTrbpBxTOBi8 f+Ysb1GZOyDyolW0St84piZg8Th3K3Vw5yrhhWdlh37u1HE4ZPEIPaJkBOMz44wJladPZR 3IfaNKvUmX9cCManqzjL2M+QW18LuoY= X-MC-Unique: x2lXHQiWPdaYsA65CojQwQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 07/10] vbox: add support for version 6.0 SDK Date: Fri, 17 Apr 2020 13:01:32 +0100 Message-Id: <20200417120135.326266-8-berrange@redhat.com> In-Reply-To: <20200417120135.326266-1-berrange@redhat.com> References: <20200417120135.326266-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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.11 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" Signed-off-by: Daniel P. Berrang=C3=A9 --- src/vbox/Makefile.inc.am | 2 ++ src/vbox/vbox_V6_0.c | 13 +++++++++++++ src/vbox/vbox_common.h | 2 ++ src/vbox/vbox_storage.c | 2 ++ src/vbox/vbox_tmpl.c | 9 ++++++++- src/vbox/vbox_uniformed_api.h | 1 + 6 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/vbox/vbox_V6_0.c diff --git a/src/vbox/Makefile.inc.am b/src/vbox/Makefile.inc.am index 9d827eff97..fdc6537d51 100644 --- a/src/vbox/Makefile.inc.am +++ b/src/vbox/Makefile.inc.am @@ -7,6 +7,8 @@ VBOX_DRIVER_SOURCES =3D \ vbox/vbox_snapshot_conf.h \ vbox/vbox_V5_2.c \ vbox/vbox_CAPI_v5_2.h \ + vbox/vbox_CAPI_v6_0.h \ + vbox/vbox_V6_0.c \ vbox/vbox_common.c \ vbox/vbox_common.h \ vbox/vbox_uniformed_api.h \ diff --git a/src/vbox/vbox_V6_0.c b/src/vbox/vbox_V6_0.c new file mode 100644 index 0000000000..4e4db6326f --- /dev/null +++ b/src/vbox/vbox_V6_0.c @@ -0,0 +1,13 @@ +/** @file vbox_V6_0.c + * C file to include support for multiple versions of VirtualBox + * at runtime. + */ + +#include + +/** The API Version */ +#define VBOX_API_VERSION 6000000 +/** Version specific prefix. */ +#define NAME(name) vbox60##name + +#include "vbox_tmpl.c" diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h index 9ea984276d..7c29d92789 100644 --- a/src/vbox/vbox_common.h +++ b/src/vbox/vbox_common.h @@ -431,6 +431,8 @@ typedef nsISupports IKeyboard; result =3D 0; \ if (uVersion >=3D 5001051 && uVersion < 5002051) { \ vbox52InstallUniformedAPI(&gVBoxAPI); \ + } else if (uVersion >=3D 6000000 && uVersion < 6000051) { \ + vbox60InstallUniformedAPI(&gVBoxAPI); \ } else { \ result =3D -1; \ } \ diff --git a/src/vbox/vbox_storage.c b/src/vbox/vbox_storage.c index e0b82f4bd8..83172ee1fe 100644 --- a/src/vbox/vbox_storage.c +++ b/src/vbox/vbox_storage.c @@ -882,6 +882,8 @@ virStorageDriverPtr vboxGetStorageDriver(uint32_t uVers= ion) */ if (uVersion >=3D 5001051 && uVersion < 5002051) { vbox52InstallUniformedAPI(&gVBoxAPI); + } else if (uVersion >=3D 6000000 && uVersion < 6000051) { + vbox60InstallUniformedAPI(&gVBoxAPI); } else { return NULL; } diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 5bf305db4d..9ac7f88b0f 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -51,8 +51,10 @@ /* This one changes from version to version. */ #if VBOX_API_VERSION =3D=3D 5002000 # include "vbox_CAPI_v5_2.h" +#elif VBOX_API_VERSION =3D=3D 6000000 +# include "vbox_CAPI_v6_0.h" #else -# error "Unsupport VBOX_API_VERSION" +# error "Unsupported VBOX_API_VERSION" #endif =20 /* Include this *last* or we'll get the wrong vbox_CAPI_*.h. */ @@ -729,8 +731,13 @@ _machineCreateSharedFolder(IMachine *machine, PRUnicha= r *name, PRUnichar *hostPath, PRBool writable, PRBool automount G_GNUC_UNUSED) { +#if VBOX_API_VERSION >=3D 6000000 + return machine->vtbl->CreateSharedFolder(machine, name, hostPath, + writable, automount, NULL); +#else return machine->vtbl->CreateSharedFolder(machine, name, hostPath, writable, automount); +#endif } =20 static nsresult diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h index a4468711fc..9ab3afc4d5 100644 --- a/src/vbox/vbox_uniformed_api.h +++ b/src/vbox/vbox_uniformed_api.h @@ -556,3 +556,4 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn, =20 /* Version specified functions for installing uniformed API */ void vbox52InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); +void vbox60InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); --=20 2.25.2