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

Re: [libvirt] [PATCHv3 2/4] phyp: add rudimentary storage driver



On 06/24/2010 07:32 PM, Eric Blake wrote:
From: Eduardo Otubo<otubo linux vnet ibm com>

* src/phyp/phyp_driver.c (phypStorageDriver): New driver.
(phypStorageOpen, phypStorageClose): New functions.
(phypRegister): Register it.

Signed-off-by: Eric Blake<eblake redhat com>
---

For my sanity, I split out the creation/registration of the
driver from the addition of all the methods in the driver.

  src/phyp/phyp_driver.c |   64 +++++++++++++++++++++++++++++++++++++++++++++++-
  1 files changed, 63 insertions(+), 1 deletions(-)

diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 0912f90..341ee99 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -56,6 +56,7 @@
  #include "virterror_internal.h"
  #include "uuid.h"
  #include "domain_conf.h"
+#include "storage_conf.h"
  #include "nodeinfo.h"

  #include "phyp_driver.h"
@@ -2265,6 +2266,22 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)

  }

+static virDrvOpenStatus
+phypStorageOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
+                virConnectAuthPtr auth ATTRIBUTE_UNUSED,
+                int flags)
+{
+    virCheckFlags(0, VIR_DRV_OPEN_ERROR);
+
+    return VIR_DRV_OPEN_SUCCESS;
+}
+
+static int
+phypStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
+{
+    return 0;
+}
+
  static virDriver phypDriver = {
      VIR_DRV_PHYP, "PHYP", phypOpen,     /* open */
      phypClose,                  /* close */
@@ -2364,9 +2381,54 @@ static virDriver phypDriver = {
      NULL,                       /* domainSnapshotDelete */
  };

+static virStorageDriver phypStorageDriver = {
+    .name = "PHYP",
+    .open = phypStorageOpen,
+    .close = phypStorageClose,
+
+    .numOfPools = NULL,
+    .listPools = NULL,
+    .numOfDefinedPools = NULL,
+    .listDefinedPools = NULL,
+    .findPoolSources = NULL,
+    .poolLookupByName = NULL,
+    .poolLookupByUUID = NULL,
+    .poolLookupByVolume = NULL,
+    .poolCreateXML = NULL,
+    .poolDefineXML = NULL,
+    .poolBuild = NULL,
+    .poolUndefine = NULL,
+    .poolCreate = NULL,
+    .poolDestroy = NULL,
+    .poolDelete = NULL,
+    .poolRefresh = NULL,
+    .poolGetInfo = NULL,
+    .poolGetXMLDesc = NULL,
+    .poolGetAutostart = NULL,
+    .poolSetAutostart = NULL,
+    .poolNumOfVolumes = NULL,
+    .poolListVolumes = NULL,
+
+    .volLookupByName = NULL,
+    .volLookupByKey = NULL,
+    .volLookupByPath = NULL,
+    .volCreateXML = NULL,
+    .volCreateXMLFrom = NULL,
+    .volDelete = NULL,
+    .volGetInfo = NULL,
+    .volGetXMLDesc = NULL,
+    .volGetPath = NULL,
+    .poolIsActive = NULL,
+    .poolIsPersistent = NULL
+};
+
  int
  phypRegister(void)
  {
-    virRegisterDriver(&phypDriver);
+    if (virRegisterDriver(&phypDriver)<  0)
+        return -1;
+    if (virRegisterStorageDriver(&phypStorageDriver)<  0)
+        return -1;
+
      return 0;
  }


ACK.


--
Eduardo Otubo
Software Engineer
Linux Technology Center
IBM Systems & Technology Group
Mobile: +55 19 8135 0885
eotubo linux vnet ibm com


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