mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
Add new API virDomainBlockPull* to headers
Set up the types for the block pull functions and insert them into the virDriver structure definition. Symbols are exported in this patch to prevent documentation compile failures. * include/libvirt/libvirt.h.in: new API * src/driver.h: add the new entry to the driver structure * python/generator.py: fix compiler errors, the actual python bindings * are implemented later * src/libvirt_public.syms: export symbols * docs/apibuild.py: Extend 'unsigned long' parameter exception to this * API
This commit is contained in:
parent
bfb485ced2
commit
152e810388
@ -1641,7 +1641,9 @@ class CParser:
|
||||
"virDomainMigrateSetMaxSpeed" : (False, ("bandwidth")),
|
||||
"virDomainSetMaxMemory" : (False, ("memory")),
|
||||
"virDomainSetMemory" : (False, ("memory")),
|
||||
"virDomainSetMemoryFlags" : (False, ("memory")) }
|
||||
"virDomainSetMemoryFlags" : (False, ("memory")),
|
||||
"virDomainBlockJobSetSpeed" : (False, ("bandwidth")),
|
||||
"virDomainBlockPull" : (False, ("bandwidth")) }
|
||||
|
||||
def checkLongLegacyFunction(self, name, return_type, signature):
|
||||
if "long" in return_type and "long long" not in return_type:
|
||||
@ -1667,7 +1669,8 @@ class CParser:
|
||||
# [unsigned] long long
|
||||
long_legacy_struct_fields = \
|
||||
{ "_virDomainInfo" : ("maxMem", "memory"),
|
||||
"_virNodeInfo" : ("memory") }
|
||||
"_virNodeInfo" : ("memory"),
|
||||
"_virDomainBlockJobInfo" : ("bandwidth") }
|
||||
|
||||
def checkLongLegacyStruct(self, name, fields):
|
||||
for field in fields:
|
||||
|
@ -1419,6 +1419,50 @@ int virDomainDetachDeviceFlags(virDomainPtr domain,
|
||||
int virDomainUpdateDeviceFlags(virDomainPtr domain,
|
||||
const char *xml, unsigned int flags);
|
||||
|
||||
/*
|
||||
* BlockJob API
|
||||
*/
|
||||
|
||||
/**
|
||||
* virDomainBlockJobType:
|
||||
*
|
||||
* VIR_DOMAIN_BLOCK_JOB_TYPE_PULL: Block Pull (virDomainBlockPull)
|
||||
*/
|
||||
typedef enum {
|
||||
VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN = 0,
|
||||
VIR_DOMAIN_BLOCK_JOB_TYPE_PULL = 1,
|
||||
} virDomainBlockJobType;
|
||||
|
||||
/* An iterator for monitoring block job operations */
|
||||
typedef unsigned long long virDomainBlockJobCursor;
|
||||
|
||||
typedef struct _virDomainBlockJobInfo virDomainBlockJobInfo;
|
||||
struct _virDomainBlockJobInfo {
|
||||
virDomainBlockJobType type;
|
||||
unsigned long bandwidth;
|
||||
/*
|
||||
* The following fields provide an indication of block job progress. @cur
|
||||
* indicates the current position and will be between 0 and @end. @end is
|
||||
* the final cursor position for this operation and represents completion.
|
||||
* To approximate progress, divide @cur by @end.
|
||||
*/
|
||||
virDomainBlockJobCursor cur;
|
||||
virDomainBlockJobCursor end;
|
||||
};
|
||||
typedef virDomainBlockJobInfo *virDomainBlockJobInfoPtr;
|
||||
|
||||
int virDomainBlockJobAbort(virDomainPtr dom, const char *path,
|
||||
unsigned int flags);
|
||||
int virDomainGetBlockJobInfo(virDomainPtr dom, const char *path,
|
||||
virDomainBlockJobInfoPtr info,
|
||||
unsigned int flags);
|
||||
int virDomainBlockJobSetSpeed(virDomainPtr dom, const char *path,
|
||||
unsigned long bandwidth, unsigned int flags);
|
||||
|
||||
int virDomainBlockPull(virDomainPtr dom, const char *path,
|
||||
unsigned long bandwidth, unsigned int flags);
|
||||
|
||||
|
||||
/*
|
||||
* NUMA support
|
||||
*/
|
||||
|
@ -186,6 +186,7 @@ def enum(type, name, value):
|
||||
functions_failed = []
|
||||
functions_skipped = [
|
||||
"virConnectListDomains",
|
||||
'virDomainGetBlockJobInfo',
|
||||
]
|
||||
|
||||
skipped_modules = {
|
||||
@ -202,6 +203,7 @@ skipped_types = {
|
||||
'virStreamEventCallback': "No function types in python",
|
||||
'virEventHandleCallback': "No function types in python",
|
||||
'virEventTimeoutCallback': "No function types in python",
|
||||
'virDomainBlockJobInfoPtr': "Not implemented yet",
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
|
24
src/driver.h
24
src/driver.h
@ -686,6 +686,26 @@ typedef int
|
||||
unsigned long flags,
|
||||
int cancelled);
|
||||
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainBlockJobAbort)(virDomainPtr dom, const char *path,
|
||||
unsigned int flags);
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainGetBlockJobInfo)(virDomainPtr dom, const char *path,
|
||||
virDomainBlockJobInfoPtr info,
|
||||
unsigned int flags);
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainBlockJobSetSpeed)(virDomainPtr dom,
|
||||
const char *path, unsigned long bandwidth,
|
||||
unsigned int flags);
|
||||
|
||||
typedef int
|
||||
(*virDrvDomainBlockPull)(virDomainPtr dom, const char *path,
|
||||
unsigned long bandwidth, unsigned int flags);
|
||||
|
||||
|
||||
/**
|
||||
* _virDriver:
|
||||
*
|
||||
@ -833,6 +853,10 @@ struct _virDriver {
|
||||
virDrvDomainMigrateFinish3 domainMigrateFinish3;
|
||||
virDrvDomainMigrateConfirm3 domainMigrateConfirm3;
|
||||
virDrvDomainSendKey domainSendKey;
|
||||
virDrvDomainBlockJobAbort domainBlockJobAbort;
|
||||
virDrvDomainGetBlockJobInfo domainGetBlockJobInfo;
|
||||
virDrvDomainBlockJobSetSpeed domainBlockJobSetSpeed;
|
||||
virDrvDomainBlockPull domainBlockPull;
|
||||
};
|
||||
|
||||
typedef int
|
||||
|
@ -474,6 +474,10 @@ LIBVIRT_0.9.4 {
|
||||
virDomainSaveImageGetXMLDesc;
|
||||
virDomainUndefineFlags;
|
||||
virDomainDestroyFlags;
|
||||
virDomainBlockJobAbort;
|
||||
virDomainGetBlockJobInfo;
|
||||
virDomainBlockJobSetSpeed;
|
||||
virDomainBlockPull;
|
||||
} LIBVIRT_0.9.3;
|
||||
|
||||
# .... define new API here using predicted next version number ....
|
||||
|
Loading…
Reference in New Issue
Block a user