iSCSI subsystem hostdevs store the data as a virStorageSource. Format the private data part of the virStorageSource in the appropriate place. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/conf/domain_conf.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d14485f18d..bda9375f13 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -25987,7 +25987,8 @@ static int virDomainHostdevDefFormatSubsys(virBufferPtr buf, virDomainHostdevDefPtr def, unsigned int flags, - bool includeTypeInAddr) + bool includeTypeInAddr, + virDomainXMLOptionPtr xmlopt) { bool closedSource = false; virDomainHostdevSubsysUSBPtr usbsrc = &def->source.subsys.u.usb; @@ -26086,6 +26087,10 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf, if (iscsisrc->src->hosts[0].port) virBufferAsprintf(buf, " port='%u'", iscsisrc->src->hosts[0].port); virBufferAddLit(buf, "/>\n"); + + if (virDomainDiskSourceFormatPrivateData(buf, iscsisrc->src, + flags, xmlopt) < 0) + return -1; } else { virBufferAsprintf(buf, "<adapter name='%s'/>\n", scsihostsrc->adapter); @@ -26167,13 +26172,14 @@ static int virDomainActualNetDefContentsFormat(virBufferPtr buf, virDomainNetDefPtr def, bool inSubelement, - unsigned int flags) + unsigned int flags, + virDomainXMLOptionPtr xmlopt) { virDomainNetType actualType = virDomainNetGetActualType(def); if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) { if (virDomainHostdevDefFormatSubsys(buf, virDomainNetGetActualHostdev(def), - flags, true) < 0) { + flags, true, xmlopt) < 0) { return -1; } } else { @@ -26253,7 +26259,8 @@ virDomainActualNetDefContentsFormat(virBufferPtr buf, static int virDomainActualNetDefFormat(virBufferPtr buf, virDomainNetDefPtr def, - unsigned int flags) + unsigned int flags, + virDomainXMLOptionPtr xmlopt) { virDomainNetType type; const char *typeStr; @@ -26281,7 +26288,7 @@ virDomainActualNetDefFormat(virBufferPtr buf, virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); - if (virDomainActualNetDefContentsFormat(buf, def, true, flags) < 0) + if (virDomainActualNetDefContentsFormat(buf, def, true, flags, xmlopt) < 0) return -1; virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "</actual>\n"); @@ -26479,7 +26486,7 @@ virDomainNetDefFormat(virBufferPtr buf, * the standard place... (this is for public reporting of * interface status) */ - if (virDomainActualNetDefContentsFormat(buf, def, false, flags) < 0) + if (virDomainActualNetDefContentsFormat(buf, def, false, flags, xmlopt) < 0) return -1; } else { /* ...but if we've asked for the inactive XML (rather than @@ -26581,7 +26588,7 @@ virDomainNetDefFormat(virBufferPtr buf, case VIR_DOMAIN_NET_TYPE_HOSTDEV: if (virDomainHostdevDefFormatSubsys(buf, &def->data.hostdev.def, - flags, true) < 0) { + flags, true, xmlopt) < 0) { return -1; } break; @@ -26627,7 +26634,7 @@ virDomainNetDefFormat(virBufferPtr buf, */ if (def->type == VIR_DOMAIN_NET_TYPE_NETWORK && (flags & VIR_DOMAIN_DEF_FORMAT_ACTUAL_NET) && - (virDomainActualNetDefFormat(buf, def, flags) < 0)) + (virDomainActualNetDefFormat(buf, def, flags, xmlopt) < 0)) return -1; } @@ -28204,7 +28211,8 @@ virDomainGraphicsDefFormat(virBufferPtr buf, static int virDomainHostdevDefFormat(virBufferPtr buf, virDomainHostdevDefPtr def, - unsigned int flags) + unsigned int flags, + virDomainXMLOptionPtr xmlopt) { const char *mode = virDomainHostdevModeTypeToString(def->mode); virDomainHostdevSubsysSCSIPtr scsisrc = &def->source.subsys.u.scsi; @@ -28283,7 +28291,7 @@ virDomainHostdevDefFormat(virBufferPtr buf, switch (def->mode) { case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS: - if (virDomainHostdevDefFormatSubsys(buf, def, flags, false) < 0) + if (virDomainHostdevDefFormatSubsys(buf, def, flags, false, xmlopt) < 0) return -1; break; case VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES: @@ -29893,7 +29901,7 @@ virDomainDefFormatInternalSetRootName(virDomainDefPtr def, * and will have already been formatted there. */ if (!def->hostdevs[n]->parentnet && - virDomainHostdevDefFormat(buf, def->hostdevs[n], flags) < 0) { + virDomainHostdevDefFormat(buf, def->hostdevs[n], flags, xmlopt) < 0) { return -1; } } @@ -31016,7 +31024,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src, rc = virDomainVideoDefFormat(&buf, src->data.video, flags); break; case VIR_DOMAIN_DEVICE_HOSTDEV: - rc = virDomainHostdevDefFormat(&buf, src->data.hostdev, flags); + rc = virDomainHostdevDefFormat(&buf, src->data.hostdev, flags, xmlopt); break; case VIR_DOMAIN_DEVICE_WATCHDOG: rc = virDomainWatchdogDefFormat(&buf, src->data.watchdog, flags); -- 2.26.2