[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 04/14] Internal driver API



Signed-off-by: Jiri Denemark <jdenemar redhat com>
---
 src/driver.h             |   20 ++++++++++++++++++++
 src/libvirt_private.syms |    1 +
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/driver.h b/src/driver.h
index 09ce8e2..16bf9bf 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -349,6 +349,9 @@ typedef int
 typedef int
     (*virDrvDomainIsPersistent)(virDomainPtr dom);
 
+typedef char *
+    (*virDrvGetHostCPU)(virConnectPtr conn);
+
 /**
  * _virDriver:
  *
@@ -435,6 +438,7 @@ struct _virDriver {
     virDrvConnectIsSecure      isSecure;
     virDrvDomainIsActive       domainIsActive;
     virDrvDomainIsPersistent   domainIsPersistent;
+    virDrvGetHostCPU            getHostCPU;
 };
 
 typedef int
@@ -944,6 +948,21 @@ struct _virStreamDriver {
 };
 
 
+typedef int (*virDrvCPUCompare)(virConnectPtr conn,
+                                const char *cpu);
+
+
+typedef struct _virCPUDriver virCPUDriver;
+typedef virCPUDriver *virCPUDriverPtr;
+struct _virCPUDriver {
+    const char *name;    /* the name of the driver */
+    virDrvOpen  open;
+    virDrvClose close;
+
+    virDrvCPUCompare    compare;
+};
+
+
 /*
  * Registration
  * TODO: also need ways to (des)activate a given driver
@@ -955,6 +974,7 @@ int virRegisterInterfaceDriver(virInterfaceDriverPtr);
 int virRegisterStorageDriver(virStorageDriverPtr);
 int virRegisterDeviceMonitor(virDeviceMonitorPtr);
 int virRegisterSecretDriver(virSecretDriverPtr);
+int virRegisterCPUDriver(virCPUDriverPtr);
 #ifdef WITH_LIBVIRTD
 int virRegisterStateDriver(virStateDriverPtr);
 #endif
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 9acd062..f10527a 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -276,6 +276,7 @@ virRegisterStateDriver;
 virRegisterStorageDriver;
 virRegisterDeviceMonitor;
 virRegisterSecretDriver;
+virRegisterCPUDriver;
 
 
 # json.h
-- 
1.6.5.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]