Part of a series of cleanups to use new accessor methods.
* src/bhyve/bhyve_command.c (bhyveBuildDiskArgStr)
(virBhyveProcessBuildLoadCmd): Use accessors.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
I haven't actually compile-tested this one yet, but unless
my grep was off, I think I got it correctly.
src/bhyve/bhyve_command.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index 15029cd..cfb577c 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -214,14 +214,15 @@ bhyveBuildDiskArgStr(const virDomainDef *def, virCommandPtr cmd)
return -1;
}
- if (disk->type != VIR_DOMAIN_DISK_TYPE_FILE) {
+ if (virDomainDiskGetType(disk) != VIR_DOMAIN_DISK_TYPE_FILE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported disk type"));
return -1;
}
virCommandAddArg(cmd, "-s");
- virCommandAddArgFormat(cmd, "2:0,%s,%s", bus_type, disk->src);
+ virCommandAddArgFormat(cmd, "2:0,%s,%s", bus_type,
+ virDomainDiskGetSource(disk));
return 0;
}
@@ -317,7 +318,7 @@ virBhyveProcessBuildLoadCmd(bhyveConnPtr driver ATTRIBUTE_UNUSED,
return NULL;
}
- if (disk->type != VIR_DOMAIN_DISK_TYPE_FILE) {
+ if (virDomainDiskGetType(disk) != VIR_DOMAIN_DISK_TYPE_FILE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported disk type"));
return NULL;
@@ -332,7 +333,7 @@ virBhyveProcessBuildLoadCmd(bhyveConnPtr driver ATTRIBUTE_UNUSED,
/* Image path */
virCommandAddArg(cmd, "-d");
- virCommandAddArg(cmd, disk->src);
+ virCommandAddArg(cmd, virDomainDiskGetSource(disk));
/* VM name */
virCommandAddArg(cmd, vm->def->name);
--
1.8.5.3