[libvirt] [PATCH 09/18] conf: use disk source accessors in phyp/

Eric Blake eblake at redhat.com
Wed Mar 19 17:20:41 UTC 2014


Part of a series of cleanups to use new accessor methods.

* src/phyp/phyp_driver.c (phypDomainAttachDevice, phypBuildLpar):
Use accessors.

Signed-off-by: Eric Blake <eblake at redhat.com>
---
 src/phyp/phyp_driver.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index d97b39f..47a317e 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2013 Red Hat, Inc.
+ * Copyright (C) 2010-2014 Red Hat, Inc.
  * Copyright IBM Corp. 2009
  *
  * phyp_driver.c: ssh layer to access Power Hypervisors
@@ -1709,7 +1709,7 @@ phypDomainAttachDevice(virDomainPtr domain, const char *xml)
                           managed_system, vios_id);

     virBufferAsprintf(&buf, "mkvdev -vdev %s -vadapter %s",
-                      dev->data.disk->src, scsi_adapter);
+                      virDomainDiskGetSource(dev->data.disk), scsi_adapter);

     if (system_type == HMC)
         virBufferAddChar(&buf, '\'');
@@ -1730,7 +1730,7 @@ phypDomainAttachDevice(virDomainPtr domain, const char *xml)
         virBufferAsprintf(&buf, " -m %s", managed_system);
     virBufferAsprintf(&buf,
                       " slot_num,backing_device|grep %s|cut -d, -f1",
-                      dev->data.disk->src);
+                      virDomainDiskGetSource(dev->data.disk));
     if (phypExecInt(session, &buf, conn, &slot) < 0)
         goto cleanup;

@@ -3488,7 +3488,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
         goto cleanup;
     }

-    if (!def->disks[0]->src) {
+    if (!virDomainDiskGetSource(def->disks[0])) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
                        _("Field <src> under <disk> on the domain XML file is "
                          "missing."));
@@ -3502,7 +3502,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
                       "max_mem=%lld,desired_procs=%d,virtual_scsi_adapters=%s",
                       def->name, def->mem.cur_balloon,
                       def->mem.cur_balloon, def->mem.max_balloon,
-                      (int) def->vcpus, def->disks[0]->src);
+                      (int) def->vcpus, virDomainDiskGetSource(def->disks[0]));
     ret = phypExecBuffer(session, &buf, &exit_status, conn, false);

     if (exit_status < 0) {
-- 
1.8.5.3




More information about the libvir-list mailing list