-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
0004-libxl-support-domain-config-modification-in-virDomai.patch
52 lines (46 loc) · 1.75 KB
/
0004-libxl-support-domain-config-modification-in-virDomai.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From aa2d0b1e9bbeb616bd3e725a39cd4b8dbb6ab8fa Mon Sep 17 00:00:00 2001
From: Marek Marczykowski <[email protected]>
Date: Sun, 14 Apr 2013 04:28:00 +0200
Subject: [PATCH] libxl: support domain config modification in
virDomainRestoreFlags
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
src/libxl/libxl_driver.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 7dcae58413..2feaefc00c 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1947,11 +1947,6 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
#endif
virCheckFlags(VIR_DOMAIN_SAVE_PAUSED, -1);
- if (dxml) {
- virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
- _("xml modification unsupported"));
- return -1;
- }
fd = libxlDomainSaveImageOpen(driver, from, &def, &hdr);
if (fd < 0)
@@ -1960,6 +1955,18 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
if (virDomainRestoreFlagsEnsureACL(conn, def) < 0)
goto cleanup;
+ if (dxml) {
+ virDomainDef *def2 = NULL;
+
+ if (!(def2 = virDomainDefParseString(dxml,
+ driver->xmlopt, NULL,
+ VIR_DOMAIN_DEF_PARSE_INACTIVE))) {
+ goto cleanup;
+ }
+ virDomainDefFree(def);
+ def = def2;
+ }
+
if (!(vm = virDomainObjListAdd(driver->domains, &def,
driver->xmlopt,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
--
2.45.2