From 1bb379ad8e3397d4c99c4fbb7dc42f2e4936afb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 20 Sep 2018 15:28:51 +0200 Subject: [PATCH] xen_common: Change xenParseVfbs to use virConfGetValueStringList MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabiano FidĂȘncio Reviewed-by: John Ferlan --- src/xenconfig/xen_common.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index ed3d89c2c6..9cb3070d47 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -615,7 +615,6 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) int val; char *listenAddr = NULL; int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM; - virConfValuePtr list; virDomainGraphicsDefPtr graphics = NULL; if (hvm) { @@ -671,17 +670,17 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) } if (!hvm && def->graphics == NULL) { /* New PV guests use this format */ - list = virConfGetValue(conf, "vfb"); - if (list && list->type == VIR_CONF_LIST && - list->list && list->list->type == VIR_CONF_STRING && - list->list->str) { + VIR_AUTOPTR(virString) vfbs = NULL; + int rc; + + if ((rc = virConfGetValueStringList(conf, "vfb", false, &vfbs)) == 1) { char vfb[MAX_VFB]; char *key = vfb; - if (virStrcpyStatic(vfb, list->list->str) < 0) { + if (virStrcpyStatic(vfb, *vfbs) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("VFB %s too big for destination"), - list->list->str); + *vfbs); goto cleanup; } @@ -751,6 +750,9 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) def->graphics[0] = graphics; def->ngraphics = 1; graphics = NULL; + } else { + if (xenHandleConfGetValueStringListErrors(rc) < 0) + goto cleanup; } } -- GitLab