mirror of https://gitee.com/openkylin/libvirt.git
conf: use disk source accessors in phyp/
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@redhat.com>
This commit is contained in:
parent
e04a4ab926
commit
73f4ae2a1f
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2010-2013 Red Hat, Inc.
|
* Copyright (C) 2010-2014 Red Hat, Inc.
|
||||||
* Copyright IBM Corp. 2009
|
* Copyright IBM Corp. 2009
|
||||||
*
|
*
|
||||||
* phyp_driver.c: ssh layer to access Power Hypervisors
|
* phyp_driver.c: ssh layer to access Power Hypervisors
|
||||||
|
@ -1709,7 +1709,7 @@ phypDomainAttachDevice(virDomainPtr domain, const char *xml)
|
||||||
managed_system, vios_id);
|
managed_system, vios_id);
|
||||||
|
|
||||||
virBufferAsprintf(&buf, "mkvdev -vdev %s -vadapter %s",
|
virBufferAsprintf(&buf, "mkvdev -vdev %s -vadapter %s",
|
||||||
dev->data.disk->src, scsi_adapter);
|
virDomainDiskGetSource(dev->data.disk), scsi_adapter);
|
||||||
|
|
||||||
if (system_type == HMC)
|
if (system_type == HMC)
|
||||||
virBufferAddChar(&buf, '\'');
|
virBufferAddChar(&buf, '\'');
|
||||||
|
@ -1730,7 +1730,7 @@ phypDomainAttachDevice(virDomainPtr domain, const char *xml)
|
||||||
virBufferAsprintf(&buf, " -m %s", managed_system);
|
virBufferAsprintf(&buf, " -m %s", managed_system);
|
||||||
virBufferAsprintf(&buf,
|
virBufferAsprintf(&buf,
|
||||||
" slot_num,backing_device|grep %s|cut -d, -f1",
|
" slot_num,backing_device|grep %s|cut -d, -f1",
|
||||||
dev->data.disk->src);
|
virDomainDiskGetSource(dev->data.disk));
|
||||||
if (phypExecInt(session, &buf, conn, &slot) < 0)
|
if (phypExecInt(session, &buf, conn, &slot) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -3488,7 +3488,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!def->disks[0]->src) {
|
if (!virDomainDiskGetSource(def->disks[0])) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("Field <src> under <disk> on the domain XML file is "
|
_("Field <src> under <disk> on the domain XML file is "
|
||||||
"missing."));
|
"missing."));
|
||||||
|
@ -3502,7 +3502,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
|
||||||
"max_mem=%lld,desired_procs=%d,virtual_scsi_adapters=%s",
|
"max_mem=%lld,desired_procs=%d,virtual_scsi_adapters=%s",
|
||||||
def->name, def->mem.cur_balloon,
|
def->name, def->mem.cur_balloon,
|
||||||
def->mem.cur_balloon, def->mem.max_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);
|
ret = phypExecBuffer(session, &buf, &exit_status, conn, false);
|
||||||
|
|
||||||
if (exit_status < 0) {
|
if (exit_status < 0) {
|
||||||
|
|
Loading…
Reference in New Issue