sysinfo: define internal driver API

* src/driver.h (virDrvGetSysinfo): New typedef.
(_virDriver): New callback member.
* src/esx/esx_driver.c (esxDriver): Add stub for driver.
* src/lxc/lxc_driver.c (lxcDriver): Likewise.
* src/opennebula/one_driver.c (oneDriver): Likewise.
* src/openvz/openvz_driver.c (openvzDriver): Likewise.
* src/phyp/phyp_driver.c (phypDriver): Likewise.
* src/qemu/qemu_driver.c (qemuDriver): Likewise.
* src/remote/remote_driver.c (remote_driver): Likewise.
* src/test/test_driver.c (testDriver): Likewise.
* src/uml/uml_driver.c (umlDriver): Likewise.
* src/vbox/vbox_tmpl.c (Driver): Likewise.
* src/vmware/vmware_driver.c (vmwareDriver): Likewise.
* src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
* src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
This commit is contained in:
Eric Blake 2011-02-07 14:14:56 -07:00
parent 353b760953
commit dec13a5a15
14 changed files with 27 additions and 7 deletions

View File

@ -83,6 +83,9 @@ typedef char *
(*virDrvGetHostname) (virConnectPtr conn);
typedef char *
(*virDrvGetURI) (virConnectPtr conn);
typedef char *
(*virDrvGetSysinfo) (virConnectPtr conn,
unsigned int flags);
typedef int
(*virDrvGetMaxVcpus) (virConnectPtr conn,
const char *type);
@ -515,6 +518,7 @@ struct _virDriver {
virDrvGetVersion version;
virDrvGetLibVersion libvirtVersion;
virDrvGetHostname getHostname;
virDrvGetSysinfo getSysinfo;
virDrvGetMaxVcpus getMaxVcpus;
virDrvNodeGetInfo nodeGetInfo;
virDrvGetCapabilities getCapabilities;

View File

@ -2,7 +2,7 @@
/*
* esx_driver.c: core driver functions for managing VMware ESX hosts
*
* Copyright (C) 2010 Red Hat, Inc.
* Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright (C) 2009-2010 Matthias Bolte <matthias.bolte@googlemail.com>
* Copyright (C) 2009 Maximilian Wilhelm <max@rfc2324.org>
*
@ -4557,6 +4557,7 @@ static virDriver esxDriver = {
esxGetVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
esxGetHostname, /* hostname */
NULL, /* getSysinfo */
NULL, /* getMaxVcpus */
esxNodeGetInfo, /* nodeGetInfo */
esxGetCapabilities, /* getCapabilities */

View File

@ -2833,6 +2833,7 @@ static virDriver lxcDriver = {
lxcVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
virGetHostname, /* getHostname */
NULL, /* getSysinfo */
NULL, /* getMaxVcpus */
nodeGetInfo, /* nodeGetInfo */
lxcGetCapabilities, /* getCapabilities */

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------*/
/*
* Copyright (C) 2010 Red Hat, Inc.
* Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright 2002-2009, Distributed Systems Architecture Group, Universidad
* Complutense de Madrid (dsa-research.org)
*
@ -732,6 +732,7 @@ static virDriver oneDriver = {
oneVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
NULL, /* getHostname */
NULL, /* getSysinfo */
NULL, /* getMaxVcpus */
NULL, /* nodeGetInfo */
oneGetCapabilities, /* getCapabilities */

View File

@ -1,7 +1,7 @@
/*
* openvz_driver.c: core driver methods for managing OpenVZ VEs
*
* Copyright (C) 2010 Red Hat, Inc.
* Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright (C) 2006, 2007 Binary Karma
* Copyright (C) 2006 Shuveb Hussain
* Copyright (C) 2007 Anoop Joe Cyriac
@ -1572,6 +1572,7 @@ static virDriver openvzDriver = {
openvzGetVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
NULL, /* getHostname */
NULL, /* getSysinfo */
openvzGetMaxVCPUs, /* getMaxVcpus */
nodeGetInfo, /* nodeGetInfo */
openvzGetCapabilities, /* getCapabilities */

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 Red Hat, Inc.
* Copyright (C) 2010-2011 Red Hat, Inc.
* Copyright IBM Corp. 2009
*
* phyp_driver.c: ssh layer to access Power Hypervisors
@ -3954,6 +3954,7 @@ static virDriver phypDriver = {
NULL, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
NULL, /* getHostname */
NULL, /* getSysinfo */
NULL, /* getMaxVcpus */
NULL, /* nodeGetInfo */
phypConnectGetCapabilities, /* getCapabilities */

View File

@ -10375,6 +10375,7 @@ static virDriver qemuDriver = {
qemudGetVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
virGetHostname, /* getHostname */
NULL, /* getSysinfo */
qemudGetMaxVCPUs, /* getMaxVcpus */
nodeGetInfo, /* nodeGetInfo */
qemudGetCapabilities, /* getCapabilities */

View File

@ -2,7 +2,7 @@
* remote_internal.c: driver to provide access to libvirtd running
* on a remote machine
*
* Copyright (C) 2007-2010 Red Hat, Inc.
* Copyright (C) 2007-2011 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -10823,6 +10823,7 @@ static virDriver remote_driver = {
remoteGetVersion, /* version */
remoteGetLibVersion, /* libvirtVersion */
remoteGetHostname, /* getHostname */
NULL, /* getSysinfo */
remoteGetMaxVcpus, /* getMaxVcpus */
remoteNodeGetInfo, /* nodeGetInfo */
remoteGetCapabilities, /* getCapabilities */

View File

@ -1,7 +1,7 @@
/*
* test.c: A "mock" hypervisor for use by application unit tests
*
* Copyright (C) 2006-2010 Red Hat, Inc.
* Copyright (C) 2006-2011 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@ -5346,6 +5346,7 @@ static virDriver testDriver = {
testGetVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
virGetHostname, /* getHostname */
NULL, /* getSysinfo */
testGetMaxVCPUs, /* getMaxVcpus */
testNodeGetInfo, /* nodeGetInfo */
testGetCapabilities, /* getCapabilities */

View File

@ -2148,6 +2148,7 @@ static virDriver umlDriver = {
umlGetVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
virGetHostname, /* getHostname */
NULL, /* getSysinfo */
NULL, /* getMaxVcpus */
nodeGetInfo, /* nodeGetInfo */
umlGetCapabilities, /* getCapabilities */

View File

@ -8537,6 +8537,7 @@ virDriver NAME(Driver) = {
vboxGetVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
virGetHostname, /* getHostname */
NULL, /* getSysinfo */
vboxGetMaxVcpus, /* getMaxVcpus */
nodeGetInfo, /* nodeGetInfo */
vboxGetCapabilities, /* getCapabilities */

View File

@ -1,5 +1,7 @@
/*---------------------------------------------------------------------------*/
/* Copyright 2010, diateam (www.diateam.net)
/*
* Copyright (C) 2011 Red Hat, Inc.
* Copyright 2010, diateam (www.diateam.net)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -906,6 +908,7 @@ static virDriver vmwareDriver = {
vmwareGetVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
NULL, /* getHostname */
NULL, /* getSysinfo */
NULL, /* getMaxVcpus */
NULL, /* nodeGetInfo */
NULL, /* getCapabilities */

View File

@ -2004,6 +2004,7 @@ static virDriver xenUnifiedDriver = {
xenUnifiedGetVersion, /* version */
NULL, /* libvirtVersion (impl. in libvirt.c) */
virGetHostname, /* getHostname */
NULL, /* getSysinfo */
xenUnifiedGetMaxVcpus, /* getMaxVcpus */
xenUnifiedNodeGetInfo, /* nodeGetInfo */
xenUnifiedGetCapabilities, /* getCapabilities */

View File

@ -1,5 +1,6 @@
/*
* xenapi_driver.c: Xen API driver.
* Copyright (C) 2011 Red Hat, Inc.
* Copyright (C) 2009, 2010 Citrix Ltd.
*
* This library is free software; you can redistribute it and/or
@ -1783,6 +1784,7 @@ static virDriver xenapiDriver = {
xenapiGetVersion, /* version */
NULL, /*getlibvirtVersion */
xenapiGetHostname, /* getHostname */
NULL, /* getSysinfo */
xenapiGetMaxVcpus, /* getMaxVcpus */
xenapiNodeGetInfo, /* nodeGetInfo */
xenapiGetCapabilities, /* getCapabilities */