From patchwork Mon Nov 7 21:03:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dawid Zamirski X-Patchwork-Id: 81183 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1218164qge; Mon, 7 Nov 2016 13:06:50 -0800 (PST) X-Received: by 10.176.83.92 with SMTP id y28mr6008474uay.128.1478552810678; Mon, 07 Nov 2016 13:06:50 -0800 (PST) Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com. [209.132.183.37]) by mx.google.com with ESMTPS id h46si8242586uaa.82.2016.11.07.13.06.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 13:06:50 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@datto-com.20150623.gappssmtp.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uA7L3orL031010; Mon, 7 Nov 2016 16:03:50 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id uA7L3nj9021061 for ; Mon, 7 Nov 2016 16:03:49 -0500 Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uA7L3nqm001968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 7 Nov 2016 16:03:49 -0500 Received: from mail-qt0-f177.google.com (mail-qt0-f177.google.com [209.85.216.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D52AC0567A1 for ; Mon, 7 Nov 2016 21:03:47 +0000 (UTC) Received: by mail-qt0-f177.google.com with SMTP id w33so95443464qtc.3 for ; Mon, 07 Nov 2016 13:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version; bh=717tq3V7RFbOD8HBJK6lQSYCBpqJv5frbUPgelzwb8g=; b=C1AFLA15Hg9D+TialE+vAupJiSqPoKDC9p6Vw5Z7vBrfZRhxtasyp/Uq9K8DUaIf9k ZsCD+lnJy86ijwZ0jiVNwItV/Lyy51z/tzvKyNK1s/pC0yoqRKbdfp2uVq2gPHw4Vx6+ HjHpTHuEEHZl4oH13iLRz4XPCeDM5NZaMDf1g9vKTZWH8zq58sVHRELWV3GPYlpBBuX6 wi1BO3INbIv5/daEzBf6IeBjY282Lu4J9kJ2u+XSSANmsDcFZriU2xBqc5htxT9D1RTM fc8WGiHR3iAmrGhBIurOhJHxyqFlBzeuTQYLLhssiqQwKdMPpLWIu5x8C8GKEkDVDeTG 7W5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version; bh=717tq3V7RFbOD8HBJK6lQSYCBpqJv5frbUPgelzwb8g=; b=IVOosl9RF7xTIMz//gPXFLupillNWNl4atlB6rwMDe3/Pg3/7Hsv0QXe1VgGOoDN+5 J1eAEjuUtv1VIXc/5dsy/xD1RS5TuSJcY+/ZC6ZtE5urVPB4NWXh+n+Y4+toHPY/U1BN mXW6JKyW4FmwQ+U8jO7BUF9WNrYicsgfeERHzprLpHuSVbRVjYiOFhyMTzRQzxFvVgI2 mg14tg+AaNzHXSHFAry7eT6tlNXJKlphV2yEQC3ufXuLj6JG/aLpLHgwi5qj71YO8qX0 2FnKlzSsOUA5gz4s0o0OVC/gENwoe/DBVAJsH4guqyGG+mtJkV8nDgkZCah16oXlBW2a BOFw== X-Gm-Message-State: ABUngve393yc3Ui6UGyKytlk8p5t0uaiEEYMy1MClj4N1Nw7DzZJdv2tdsoo2pg9DSxyQaZV X-Received: by 10.200.51.251 with SMTP id d56mr8987974qtb.89.1478552626330; Mon, 07 Nov 2016 13:03:46 -0800 (PST) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id x4sm4561591qtc.42.2016.11.07.13.03.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 13:03:45 -0800 (PST) From: Dawid Zamirski To: libvir-list@redhat.com Date: Mon, 7 Nov 2016 16:03:43 -0500 Message-Id: <20161107210343.13395-3-dzamirski@datto.com> In-Reply-To: <20161107210343.13395-1-dzamirski@datto.com> References: <20161107210343.13395-1-dzamirski@datto.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 07 Nov 2016 21:03:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 07 Nov 2016 21:03:47 +0000 (UTC) for IP:'209.85.216.177' DOMAIN:'mail-qt0-f177.google.com' HELO:'mail-qt0-f177.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.869 (BAYES_50, DCC_REPUT_00_12, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.177 mail-qt0-f177.google.com 209.85.216.177 mail-qt0-f177.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] vbox: hookup the 5.1 C API to the unified driver. 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 simply follow the same pattern as other versions did. --- src/Makefile.am | 1 + src/vbox/vbox_V5_1.c | 13 +++++++++++++ src/vbox/vbox_common.h | 2 ++ src/vbox/vbox_storage.c | 2 ++ src/vbox/vbox_tmpl.c | 2 ++ src/vbox/vbox_uniformed_api.h | 1 + 6 files changed, 21 insertions(+) create mode 100644 src/vbox/vbox_V5_1.c -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/Makefile.am b/src/Makefile.am index 8ee5567..d417b6e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -800,6 +800,7 @@ VBOX_DRIVER_SOURCES = \ vbox/vbox_V4_3.c vbox/vbox_CAPI_v4_3.h \ vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h \ vbox/vbox_V5_0.c vbox/vbox_CAPI_v5_0.h \ + vbox/vbox_V5_1.c vbox/vbox_CAPI_v5_1.h \ vbox/vbox_common.c vbox/vbox_common.h \ vbox/vbox_uniformed_api.h \ vbox/vbox_get_driver.h \ diff --git a/src/vbox/vbox_V5_1.c b/src/vbox/vbox_V5_1.c new file mode 100644 index 0000000..839bced --- /dev/null +++ b/src/vbox/vbox_V5_1.c @@ -0,0 +1,13 @@ +/** @file vbox_V5_1.c + * C file to include support for multiple versions of VirtualBox + * at runtime. + */ + +#include + +/** The API Version */ +#define VBOX_API_VERSION 5001000 +/** Version specific prefix. */ +#define NAME(name) vbox51##name + +#include "vbox_tmpl.c" diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h index b178878..f68bf1b 100644 --- a/src/vbox/vbox_common.h +++ b/src/vbox/vbox_common.h @@ -432,6 +432,8 @@ typedef nsISupports IKeyboard; vbox43_4InstallUniformedAPI(&gVBoxAPI); \ } else if (uVersion >= 4003051 && uVersion < 5000051) { \ vbox50InstallUniformedAPI(&gVBoxAPI); \ + } else if (uVersion >= 5000051 && uVersion < 5001051) { \ + vbox51InstallUniformedAPI(&gVBoxAPI); \ } else { \ result = -1; \ } \ diff --git a/src/vbox/vbox_storage.c b/src/vbox/vbox_storage.c index c849505..743c5d3 100644 --- a/src/vbox/vbox_storage.c +++ b/src/vbox/vbox_storage.c @@ -910,6 +910,8 @@ virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion) vbox43_4InstallUniformedAPI(&gVBoxAPI); } else if (uVersion >= 4003051 && uVersion < 5000051) { vbox50InstallUniformedAPI(&gVBoxAPI); + } else if (uVersion >= 5000051 && uVersion < 5001051) { + vbox51InstallUniformedAPI(&gVBoxAPI); } else { return NULL; } diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 23f63f9..6892cc7 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -71,6 +71,8 @@ # include "vbox_CAPI_v4_3_4.h" #elif VBOX_API_VERSION == 5000000 # include "vbox_CAPI_v5_0.h" +#elif VBOX_API_VERSION == 5001000 +# include "vbox_CAPI_v5_1.h" #else # error "Unsupport VBOX_API_VERSION" #endif diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h index 74e9ac0..8ec1533 100644 --- a/src/vbox/vbox_uniformed_api.h +++ b/src/vbox/vbox_uniformed_api.h @@ -629,5 +629,6 @@ void vbox42_20InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox43InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox43_4InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); void vbox50InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); +void vbox51InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI); #endif /* VBOX_UNIFORMED_API_H */