libxl: introduce libxlDomainDefCheckABIStability

Introduce a simple libxlDomainDefCheckABIStability() function that
can be used check ABI stability between two virDomainDef objects.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2014-06-04 14:02:27 -06:00
parent 3cbd3b8e3a
commit d9a099a4c5
2 changed files with 28 additions and 0 deletions

View File

@ -1256,3 +1256,26 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
virObjectUnref(cfg);
return ret;
}
bool
libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
virDomainDefPtr src,
virDomainDefPtr dst)
{
virDomainDefPtr migratableDefSrc = NULL;
virDomainDefPtr migratableDefDst = NULL;
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
bool ret = false;
if (!(migratableDefSrc = virDomainDefCopy(src, cfg->caps, driver->xmlopt, true)) ||
!(migratableDefDst = virDomainDefCopy(dst, cfg->caps, driver->xmlopt, true)))
goto cleanup;
ret = virDomainDefCheckABIStability(migratableDefSrc, migratableDefDst);
cleanup:
virDomainDefFree(migratableDefSrc);
virDomainDefFree(migratableDefDst);
virObjectUnref(cfg);
return ret;
}

View File

@ -139,4 +139,9 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
bool start_paused,
int restore_fd);
bool
libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
virDomainDefPtr src,
virDomainDefPtr dst);
#endif /* LIBXL_DOMAIN_H */