domiftune: Add API virDomain{S,G}etInterfaceParameters

The APIs are used to set/get domain's network interface's parameters.
Currently supported parameters are bandwidth settings.

* include/libvirt/libvirt.h.in: new API and parameters definition
* python/generator.py: skip the Python API generation
* src/driver.h: add new entry to the driver structure
* src/libvirt_public.syms: export symbols
This commit is contained in:
Hu Tao 2011-12-29 15:33:16 +08:00 committed by Osier Yang
parent f0293edc3f
commit 85f3493f34
4 changed files with 66 additions and 0 deletions

View File

@ -645,6 +645,48 @@ typedef virTypedParameter *virTypedParameterPtr;
*/ */
#define VIR_DOMAIN_SCHEDULER_SHARES "shares" #define VIR_DOMAIN_SCHEDULER_SHARES "shares"
/**
* VIR_DOMAIN_BANDWIDTH_IN_AVERAGE:
*
* Macro represents the inbound average of NIC bandwidth.
*/
#define VIR_DOMAIN_BANDWIDTH_IN_AVERAGE "inbound.average"
/**
* VIR_DOMAIN_BANDWIDTH_IN_PEAK:
*
* Macro represents the inbound peak of NIC bandwidth.
*/
#define VIR_DOMAIN_BANDWIDTH_IN_PEAK "inbound.peak"
/**
* VIR_DOMAIN_BANDWIDTH_IN_BURST:
*
* Macro represents the inbound burst of NIC bandwidth.
*/
#define VIR_DOMAIN_BANDWIDTH_IN_BURST "inbound.burst"
/**
* VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE:
*
* Macro represents the outbound average of NIC bandwidth.
*/
#define VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE "outbound.average"
/**
* VIR_DOMAIN_BANDWIDTH_OUT_PEAK:
*
* Macro represents the outbound peak of NIC bandwidth.
*/
#define VIR_DOMAIN_BANDWIDTH_OUT_PEAK "outbound.peak"
/**
* VIR_DOMAIN_BANDWIDTH_OUT_BURST:
*
* Macro represents the outbound burst of NIC bandwidth.
*/
#define VIR_DOMAIN_BANDWIDTH_OUT_BURST "outbound.burst"
/* /*
* Fetch scheduler parameters, caller allocates 'params' field of size 'nparams' * Fetch scheduler parameters, caller allocates 'params' field of size 'nparams'
*/ */
@ -1446,6 +1488,14 @@ int virDomainInterfaceStats (virDomainPtr dom,
const char *path, const char *path,
virDomainInterfaceStatsPtr stats, virDomainInterfaceStatsPtr stats,
size_t size); size_t size);
int virDomainSetInterfaceParameters (virDomainPtr dom,
const char *device,
virTypedParameterPtr params,
int nparams, unsigned int flags);
int virDomainGetInterfaceParameters (virDomainPtr dom,
const char *device,
virTypedParameterPtr params,
int *nparams, unsigned int flags);
int virDomainMemoryStats (virDomainPtr dom, int virDomainMemoryStats (virDomainPtr dom,
virDomainMemoryStatPtr stats, virDomainMemoryStatPtr stats,
unsigned int nr_stats, unsigned int nr_stats,

View File

@ -419,6 +419,8 @@ skip_impl = (
'virDomainBlockStatsFlags', 'virDomainBlockStatsFlags',
'virDomainSetBlockIoTune', 'virDomainSetBlockIoTune',
'virDomainGetBlockIoTune', 'virDomainGetBlockIoTune',
'virDomainSetInterfaceParameters',
'virDomainGetInterfaceParameters',
) )
qemu_skip_impl = ( qemu_skip_impl = (

View File

@ -375,6 +375,16 @@ typedef int
(virDomainPtr domain, (virDomainPtr domain,
const char *path, const char *path,
struct _virDomainInterfaceStats *stats); struct _virDomainInterfaceStats *stats);
typedef int
(*virDrvDomainSetInterfaceParameters) (virDomainPtr dom,
const char *device,
virTypedParameterPtr params,
int nparams, unsigned int flags);
typedef int
(*virDrvDomainGetInterfaceParameters) (virDomainPtr dom,
const char *device,
virTypedParameterPtr params,
int *nparams, unsigned int flags);
typedef int typedef int
(*virDrvDomainMemoryStats) (*virDrvDomainMemoryStats)
@ -883,6 +893,8 @@ struct _virDriver {
virDrvDomainBlockStats domainBlockStats; virDrvDomainBlockStats domainBlockStats;
virDrvDomainBlockStatsFlags domainBlockStatsFlags; virDrvDomainBlockStatsFlags domainBlockStatsFlags;
virDrvDomainInterfaceStats domainInterfaceStats; virDrvDomainInterfaceStats domainInterfaceStats;
virDrvDomainSetInterfaceParameters domainSetInterfaceParameters;
virDrvDomainGetInterfaceParameters domainGetInterfaceParameters;
virDrvDomainMemoryStats domainMemoryStats; virDrvDomainMemoryStats domainMemoryStats;
virDrvDomainBlockPeek domainBlockPeek; virDrvDomainBlockPeek domainBlockPeek;
virDrvDomainMemoryPeek domainMemoryPeek; virDrvDomainMemoryPeek domainMemoryPeek;

View File

@ -512,6 +512,8 @@ LIBVIRT_0.9.9 {
global: global:
virDomainGetNumaParameters; virDomainGetNumaParameters;
virDomainSetNumaParameters; virDomainSetNumaParameters;
virDomainGetInterfaceParameters;
virDomainSetInterfaceParameters;
} LIBVIRT_0.9.8; } LIBVIRT_0.9.8;
# .... define new API here using predicted next version number .... # .... define new API here using predicted next version number ....