From dec13a5a15135873a7b5311eb43d12fa6ea7186d Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 7 Feb 2011 14:14:56 -0700 Subject: [PATCH] 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. --- src/driver.h | 4 ++++ src/esx/esx_driver.c | 3 ++- src/lxc/lxc_driver.c | 1 + src/opennebula/one_driver.c | 3 ++- src/openvz/openvz_driver.c | 3 ++- src/phyp/phyp_driver.c | 3 ++- src/qemu/qemu_driver.c | 1 + src/remote/remote_driver.c | 3 ++- src/test/test_driver.c | 3 ++- src/uml/uml_driver.c | 1 + src/vbox/vbox_tmpl.c | 1 + src/vmware/vmware_driver.c | 5 ++++- src/xen/xen_driver.c | 1 + src/xenapi/xenapi_driver.c | 2 ++ 14 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/driver.h b/src/driver.h index 114002df0e..745100416b 100644 --- a/src/driver.h +++ b/src/driver.h @@ -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; diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index c66df0e385..97f3dbec8b 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -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 * Copyright (C) 2009 Maximilian Wilhelm * @@ -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 */ diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 2e8a84567a..0f78579569 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -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 */ diff --git a/src/opennebula/one_driver.c b/src/opennebula/one_driver.c index 6945f91382..75d7b9a409 100644 --- a/src/opennebula/one_driver.c +++ b/src/opennebula/one_driver.c @@ -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 */ diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 1dde004801..00d378a4b5 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -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 */ diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 350889136a..d954f2a964 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -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 */ diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b9367355a4..87d228b558 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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 */ diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 8bae697964..1d9209d7f1 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -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 */ diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 15e90c8033..1937da05ce 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -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 */ diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index d248b453cc..2af8002e01 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -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 */ diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index b5cde1f863..cf3cbc6516 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -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 */ diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index f176c2f4f6..22b29d1940 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -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 */ diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index f3613f06a3..b14c8db119 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -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 */ diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c index aac112bfd2..7851e931d7 100644 --- a/src/xenapi/xenapi_driver.c +++ b/src/xenapi/xenapi_driver.c @@ -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 */