Signed-off-by: Shi Lei <shi_...@massclouds.com> --- src/conf/network_conf.c | 18 ++---------------- src/conf/network_conf.h | 2 +- 2 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index cb2f3163..146c4977 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2191,22 +2191,8 @@ virNetworkDNSDefFormat(virBuffer *buf, for (i = 0; i < def->nsrvs; i++) { if (def->srvs[i].service && def->srvs[i].protocol) { - virBufferEscapeString(buf, "<srv service='%s' ", - def->srvs[i].service); - virBufferEscapeString(buf, "protocol='%s'", def->srvs[i].protocol); - - if (def->srvs[i].domain) - virBufferEscapeString(buf, " domain='%s'", def->srvs[i].domain); - if (def->srvs[i].target) - virBufferEscapeString(buf, " target='%s'", def->srvs[i].target); - if (def->srvs[i].port) - virBufferAsprintf(buf, " port='%d'", def->srvs[i].port); - if (def->srvs[i].priority) - virBufferAsprintf(buf, " priority='%d'", def->srvs[i].priority); - if (def->srvs[i].weight) - virBufferAsprintf(buf, " weight='%d'", def->srvs[i].weight); - - virBufferAddLit(buf, "/>\n"); + if (virNetworkDNSSrvDefFormatBuf(buf, "srv", &def->srvs[i], def, NULL) < 0) + return -1; } } diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index a58d8953..052ccb58 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -131,7 +131,7 @@ struct _virNetworkDNSTxtDef { /* genparse, genformat */ }; typedef struct _virNetworkDNSSrvDef virNetworkDNSSrvDef; -struct _virNetworkDNSSrvDef { /* genparse */ +struct _virNetworkDNSSrvDef { /* genparse, genformat */ char *service; /* xmlattr */ char *protocol; /* xmlattr */ char *domain; /* xmlattr */ -- 2.25.1