Marek Marczykowski-Górecki wrote:
Signed-off-by: Marek Marczykowski-Górecki
<marmarek(a)invisiblethingslab.com>
---
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 1313d2e..d7f5dac 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1456,11 +1456,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, cfg, from, &def, &hdr);
if (fd < 0)
@@ -1469,6 +1464,18 @@ libxlDomainRestoreFlags(virConnectPtr conn, const char *from,
if (virDomainRestoreFlagsEnsureACL(conn, def) < 0)
goto cleanup_unlock;
+ if (dxml) {
+ virDomainDefPtr def2 = NULL;
+
+ if (!(def2 = virDomainDefParseString(dxml, cfg->caps, driver->xmlopt,
+ 1 << VIR_DOMAIN_VIRT_XEN,
+ VIR_DOMAIN_XML_INACTIVE))) {
+ goto cleanup;
+ }
+ virDomainDefFree(def);
+ def = def2;
+ }
+
This patch looks good and I'm fine with committing it, even though I do
worry a bit about future bug reports where users have changed the config
in incompatible ways and the domain fails to restore. As before, I'd
like to hear what others have to say. Did the qemu driver experience
similar bug reports before checking ABI stability?
One possible solution is to have virDomainDefCheckMetaABIStability() and
virDomainDefCheckDeviceABIStability() functions. The latter could be
used by callers wanting virtual hardware and device ABI stability only.
Together, they provide virDomainDefCheckABIStability() for callers
wanting "strict" ABI stability.
Regards,
Jim