Signed-off-by: Shi Lei <shi_lei@xxxxxxxxxxxxxx> --- src/conf/network_conf.c | 4 ++-- src/conf/network_conf.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 964a8a7..b807bac 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -2280,8 +2280,8 @@ virNetworkDNSDefFormat(virBufferPtr buf, } for (i = 0; i < def->ntxts; i++) { - virBufferEscapeString(buf, "<txt name='%s' ", def->txts[i].name); - virBufferEscapeString(buf, "value='%s'/>\n", def->txts[i].value); + if (virNetworkDNSTxtDefFormatBuf(buf, "txt", &def->txts[i], NULL) < 0) + return -1; } for (i = 0; i < def->nsrvs; i++) { diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index eac8a76..b3c2895 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -130,7 +130,7 @@ struct _virNetworkDHCPHostDef { typedef struct _virNetworkDNSTxtDef virNetworkDNSTxtDef; typedef virNetworkDNSTxtDef *virNetworkDNSTxtDefPtr; -struct _virNetworkDNSTxtDef { /* genparse:concisehook */ +struct _virNetworkDNSTxtDef { /* genparse:concisehook, genformat */ char *name; /* xmlattr, required */ char *value; /* xmlattr */ }; -- 2.17.1