[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 20/29] vbox: Rewrite vboxDomainCreateXML



---
 src/vbox/vbox_common.c        |   28 ++++++++++++++++++++++++++++
 src/vbox/vbox_tmpl.c          |   28 ----------------------------
 src/vbox/vbox_uniformed_api.h |    2 ++
 3 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 4861d52..a278a37 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -2152,3 +2152,31 @@ int vboxDomainCreate(virDomainPtr dom)
 {
     return vboxDomainCreateWithFlags(dom, 0);
 }
+
+virDomainPtr vboxDomainCreateXML(virConnectPtr conn, const char *xml,
+                                 unsigned int flags)
+{
+    /* VirtualBox currently doesn't have support for running
+     * virtual machines without actually defining them and thus
+     * for time being just define new machine and start it.
+     *
+     * TODO: After the appropriate API's are added in VirtualBox
+     * change this behaviour to the expected one.
+     */
+
+    virDomainPtr dom;
+
+    virCheckFlags(0, NULL);
+
+    dom = vboxDomainDefineXML(conn, xml);
+    if (dom == NULL)
+        return NULL;
+
+    if (vboxDomainCreate(dom) < 0) {
+        vboxDomainUndefineFlags(dom, 0);
+        virObjectUnref(dom);
+        return NULL;
+    }
+
+    return dom;
+}
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 2c3097b..c4232aa 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -916,34 +916,6 @@ vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar *utf16,
     return result;
 }
 
-static virDomainPtr vboxDomainCreateXML(virConnectPtr conn, const char *xml,
-                                        unsigned int flags)
-{
-    /* VirtualBox currently doesn't have support for running
-     * virtual machines without actually defining them and thus
-     * for time being just define new machine and start it.
-     *
-     * TODO: After the appropriate API's are added in VirtualBox
-     * change this behaviour to the expected one.
-     */
-
-    virDomainPtr dom;
-
-    virCheckFlags(0, NULL);
-
-    dom = vboxDomainDefineXML(conn, xml);
-    if (dom == NULL)
-        return NULL;
-
-    if (vboxDomainCreate(dom) < 0) {
-        vboxDomainUndefineFlags(dom, 0);
-        virObjectUnref(dom);
-        return NULL;
-    }
-
-    return dom;
-}
-
 static virDomainPtr
 vboxDomainLookupByName(virConnectPtr conn, const char *name)
 {
diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h
index 7e04845..55f2eec 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -424,6 +424,8 @@ virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const char *xml);
 int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags);
 int vboxDomainCreateWithFlags(virDomainPtr dom, unsigned int flags);
 int vboxDomainCreate(virDomainPtr dom);
+virDomainPtr vboxDomainCreateXML(virConnectPtr conn, const char *xml,
+                                 unsigned int flags);
 
 /* Version specified functions for installing uniformed API */
 void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
-- 
1.7.9.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]