提交 1bb379ad 编写于 作者: F Fabiano Fidêncio 提交者: John Ferlan

xen_common: Change xenParseVfbs to use virConfGetValueStringList

Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 5f0c1c1e
...@@ -615,7 +615,6 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) ...@@ -615,7 +615,6 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def)
int val; int val;
char *listenAddr = NULL; char *listenAddr = NULL;
int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM; int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
virConfValuePtr list;
virDomainGraphicsDefPtr graphics = NULL; virDomainGraphicsDefPtr graphics = NULL;
if (hvm) { if (hvm) {
...@@ -671,17 +670,17 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) ...@@ -671,17 +670,17 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def)
} }
if (!hvm && def->graphics == NULL) { /* New PV guests use this format */ if (!hvm && def->graphics == NULL) { /* New PV guests use this format */
list = virConfGetValue(conf, "vfb"); VIR_AUTOPTR(virString) vfbs = NULL;
if (list && list->type == VIR_CONF_LIST && int rc;
list->list && list->list->type == VIR_CONF_STRING &&
list->list->str) { if ((rc = virConfGetValueStringList(conf, "vfb", false, &vfbs)) == 1) {
char vfb[MAX_VFB]; char vfb[MAX_VFB];
char *key = vfb; char *key = vfb;
if (virStrcpyStatic(vfb, list->list->str) < 0) { if (virStrcpyStatic(vfb, *vfbs) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("VFB %s too big for destination"), _("VFB %s too big for destination"),
list->list->str); *vfbs);
goto cleanup; goto cleanup;
} }
...@@ -751,6 +750,9 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) ...@@ -751,6 +750,9 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def)
def->graphics[0] = graphics; def->graphics[0] = graphics;
def->ngraphics = 1; def->ngraphics = 1;
graphics = NULL; graphics = NULL;
} else {
if (xenHandleConfGetValueStringListErrors(rc) < 0)
goto cleanup;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册