20.04.2016 17:05, Nikolay Shirokovskiy пишет:
Attach/detach functions for disk/net are quite trivial and
typically call a few functions in begin/end edit frame. Having
in mind update function too adding configuring for another
device (like graphics) will introduce 3 trivial functions more.
Let's replace current approach by attach/detach functions for
device.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/vz/vz_driver.c | 60 ++++-----------------
src/vz/vz_sdk.c | 156 +++++++++++++++++++++++------------------------------
src/vz/vz_sdk.h | 8 +--
3 files changed, 79 insertions(+), 145 deletions(-)
[snip]
diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h
index e562f98..e68a710 100644
--- a/src/vz/vz_sdk.h
+++ b/src/vz/vz_sdk.h
@@ -63,16 +63,12 @@ prlsdkUnregisterDomain(vzDriverPtr driver, virDomainObjPtr dom,
unsigned int fla
int
prlsdkDomainManagedSaveRemove(virDomainObjPtr dom);
int
-prlsdkAttachVolume(vzDriverPtr driver, virDomainObjPtr dom, virDomainDiskDefPtr disk);
+prlsdkAttachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr disk);
s/disk/dev
int
-prlsdkDetachVolume(virDomainObjPtr dom, virDomainDiskDefPtr disk);
+prlsdkDetachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr disk);
s/disk/dev
int
prlsdkGetBlockStats(virDomainObjPtr dom, virDomainDiskDefPtr disk,
virDomainBlockStatsPtr stats);
int
-prlsdkAttachNet(vzDriverPtr driver, virDomainObjPtr dom, virDomainNetDefPtr net);
-int
-prlsdkDetachNet(vzDriverPtr driver, virDomainObjPtr dom, virDomainNetDefPtr net);
-int
prlsdkGetNetStats(virDomainObjPtr dom, const char *path, virDomainInterfaceStatsPtr
stats);
int
prlsdkGetVcpuStats(virDomainObjPtr dom, int idx, unsigned long long *time);
ACK with little nits above.
Max