From 3bab69c30f53f06e0e139f307caba4ab9999f9d4 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 30 May 2014 15:53:12 +0100 Subject: [PATCH] libxl: Move virDomainXMLOptionNew into libxlCreateXMLConf To allow the test suite to creat the XML option object, move the virDomainXMLOptionNew call into a libxlCreateXMLConf method. Signed-off-by: Daniel P. Berrange --- src/libxl/libxl_conf.c | 8 ++++++++ src/libxl/libxl_conf.h | 3 +++ src/libxl/libxl_driver.c | 4 +--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index f9e3a1b8b6..14742decde 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1336,3 +1336,11 @@ libxlBuildDomainConfig(virPortAllocatorPtr graphicsports, return 0; } + +virDomainXMLOptionPtr +libxlCreateXMLConf(void) +{ + return virDomainXMLOptionNew(&libxlDomainDefParserConfig, + &libxlDomainXMLPrivateDataCallbacks, + NULL); +} diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h index 2dcd0b8004..433d6daf15 100644 --- a/src/libxl/libxl_conf.h +++ b/src/libxl/libxl_conf.h @@ -158,6 +158,9 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports, int libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev); +virDomainXMLOptionPtr +libxlCreateXMLConf(void); + int libxlBuildDomainConfig(virPortAllocatorPtr graphicsports, virDomainDefPtr def, diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index df7d51066d..515d5c9a6f 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -353,9 +353,7 @@ libxlStateInitialize(bool privileged, goto error; } - if (!(libxl_driver->xmlopt = virDomainXMLOptionNew(&libxlDomainDefParserConfig, - &libxlDomainXMLPrivateDataCallbacks, - NULL))) + if (!(libxl_driver->xmlopt = libxlCreateXMLConf())) goto error; /* Load running domains first. */