We can't change the attribute names in the public XML schema
without breaking back compat, so the best we can do is replace
the terms in our internal structs.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/bhyve/bhyve_driver.c | 2 +-
src/bhyve/bhyve_parse_command.c | 20 ++++++++++----------
src/conf/domain_conf.c | 24 ++++++++++++------------
src/conf/domain_conf.h | 4 ++--
src/util/virnetdevtap.c | 2 +-
src/vbox/vbox_common.c | 4 ++--
6 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index b6204c7fb9..5a8be9fd0f 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1072,7 +1072,7 @@ bhyveDomainOpenConsole(virDomainPtr dom,
chr = vm->def->serials[0];
- if (virFDStreamOpenPTY(st, chr->source->data.nmdm.slave,
+ if (virFDStreamOpenPTY(st, chr->source->data.nmdm.secondary,
0, 0, O_RDWR) < 0)
goto cleanup;
diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_command.c
index 76423730d9..3daf2572cb 100644
--- a/src/bhyve/bhyve_parse_command.c
+++ b/src/bhyve/bhyve_parse_command.c
@@ -290,8 +290,8 @@ bhyveParseBhyveLPCArg(virDomainDefPtr def,
goto error;
chr->source->type = VIR_DOMAIN_CHR_TYPE_NMDM;
- chr->source->data.nmdm.master = NULL;
- chr->source->data.nmdm.slave = NULL;
+ chr->source->data.nmdm.primary = NULL;
+ chr->source->data.nmdm.secondary = NULL;
chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
if (!STRPREFIX(param, "/dev/nmdm")) {
@@ -301,24 +301,24 @@ bhyveParseBhyveLPCArg(virDomainDefPtr def,
goto error;
}
- chr->source->data.nmdm.master = g_strdup(param);
- chr->source->data.nmdm.slave =
g_strdup(chr->source->data.file.path);
+ chr->source->data.nmdm.primary = g_strdup(param);
+ chr->source->data.nmdm.secondary =
g_strdup(chr->source->data.file.path);
- /* If the last character of the master is 'A', the slave will be
'B'
+ /* If the last character of the primary is 'A', the secondary will be
'B'
* and vice versa */
- last = strlen(chr->source->data.nmdm.master) - 1;
+ last = strlen(chr->source->data.nmdm.primary) - 1;
switch (chr->source->data.file.path[last]) {
case 'A':
- chr->source->data.nmdm.slave[last] = 'B';
+ chr->source->data.nmdm.secondary[last] = 'B';
break;
case 'B':
- chr->source->data.nmdm.slave[last] = 'A';
+ chr->source->data.nmdm.secondary[last] = 'A';
break;
default:
virReportError(VIR_ERR_OPERATION_FAILED,
- _("Failed to set slave for %s: last letter not
"
+ _("Failed to set secondary for %s: last letter not
"
"'A' or 'B'"),
- NULLSTR(chr->source->data.nmdm.master));
+ NULLSTR(chr->source->data.nmdm.primary));
goto error;
}
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e9336fd72d..2e272c44ea 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2596,8 +2596,8 @@ virDomainChrSourceDefClear(virDomainChrSourceDefPtr def)
break;
case VIR_DOMAIN_CHR_TYPE_NMDM:
- VIR_FREE(def->data.nmdm.master);
- VIR_FREE(def->data.nmdm.slave);
+ VIR_FREE(def->data.nmdm.primary);
+ VIR_FREE(def->data.nmdm.secondary);
break;
case VIR_DOMAIN_CHR_TYPE_UDP:
@@ -2671,8 +2671,8 @@ virDomainChrSourceDefCopy(virDomainChrSourceDefPtr dest,
break;
case VIR_DOMAIN_CHR_TYPE_NMDM:
- dest->data.nmdm.master = g_strdup(src->data.nmdm.master);
- dest->data.nmdm.slave = g_strdup(src->data.nmdm.slave);
+ dest->data.nmdm.primary = g_strdup(src->data.nmdm.primary);
+ dest->data.nmdm.secondary = g_strdup(src->data.nmdm.secondary);
break;
}
@@ -2724,8 +2724,8 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src,
return STREQ_NULLABLE(src->data.file.path, tgt->data.file.path);
break;
case VIR_DOMAIN_CHR_TYPE_NMDM:
- return STREQ_NULLABLE(src->data.nmdm.master, tgt->data.nmdm.master)
&&
- STREQ_NULLABLE(src->data.nmdm.slave, tgt->data.nmdm.slave);
+ return STREQ_NULLABLE(src->data.nmdm.primary, tgt->data.nmdm.primary)
&&
+ STREQ_NULLABLE(src->data.nmdm.secondary, tgt->data.nmdm.secondary);
break;
case VIR_DOMAIN_CHR_TYPE_UDP:
return STREQ_NULLABLE(src->data.udp.bindHost, tgt->data.udp.bindHost)
&&
@@ -6220,13 +6220,13 @@ virDomainChrSourceDefValidate(const virDomainChrSourceDef
*src_def,
break;
case VIR_DOMAIN_CHR_TYPE_NMDM:
- if (!src_def->data.nmdm.master) {
+ if (!src_def->data.nmdm.primary) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing master path attribute for nmdm
device"));
return -1;
}
- if (!src_def->data.nmdm.slave) {
+ if (!src_def->data.nmdm.secondary) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing slave path attribute for nmdm device"));
return -1;
@@ -13253,8 +13253,8 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def,
break;
case VIR_DOMAIN_CHR_TYPE_NMDM:
- def->data.nmdm.master = virXMLPropString(cur, "master");
- def->data.nmdm.slave = virXMLPropString(cur, "slave");
+ def->data.nmdm.primary = virXMLPropString(cur, "master");
+ def->data.nmdm.secondary = virXMLPropString(cur, "slave");
break;
case VIR_DOMAIN_CHR_TYPE_LAST:
@@ -26853,8 +26853,8 @@ virDomainChrSourceDefFormat(virBufferPtr buf,
case VIR_DOMAIN_CHR_TYPE_NMDM:
virBufferEscapeString(buf, "<source master='%s' ",
- def->data.nmdm.master);
- virBufferEscapeString(buf, "slave='%s'/>\n",
def->data.nmdm.slave);
+ def->data.nmdm.primary);
+ virBufferEscapeString(buf, "slave='%s'/>\n",
def->data.nmdm.secondary);
break;
case VIR_DOMAIN_CHR_TYPE_UDP:
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 41715c75f2..00a0e02cd1 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1201,8 +1201,8 @@ struct _virDomainChrSourceDef {
int append; /* enum virTristateSwitch */
} file; /* pty, file, pipe, or device */
struct {
- char *master;
- char *slave;
+ char *primary;
+ char *secondary;
} nmdm;
struct {
char *host;
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 7bd30ea0f9..6272e03f42 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -687,7 +687,7 @@ int virNetDevTapCreateInBridgePort(const char *brname,
/* We need to set the interface MAC before adding it
* to the bridge, because the bridge assumes the lowest
- * MAC of all enslaved interfaces & we don't want it
+ * MAC of all member interfaces & we don't want it
* seeing the kernel allocate random MAC for the TAP
* device before we set our static MAC.
*/
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 15f8eb074a..493639d6d9 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -3344,8 +3344,8 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data, IMachine
*machine)
switch ((enum StorageBus) storageBus) {
case StorageBus_IDE:
disk->bus = VIR_DOMAIN_DISK_BUS_IDE;
- disk->info.addr.drive.bus = devicePort; /* primary, secondary */
- disk->info.addr.drive.unit = deviceSlot; /* master, slave */
+ disk->info.addr.drive.bus = devicePort;
+ disk->info.addr.drive.unit = deviceSlot;
break;
case StorageBus_SATA:
--
2.24.1