mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
3cbd3b8e3a
commit
d9a099a4c5
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue