Exercise the ABI stability check code in test suite

Any test suite which involves a virDomainDefPtr should
call virDomainDefCheckABIStability with itself just as
a basic sanity check that the identity-comparison always
succeeds. This would have caught the recent NULL pointer
access crash.

Make sure we cope with def->name being NULL since the
VMWare config parser produces NULL names.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2014-01-10 17:18:03 +00:00
parent dd0dda2e4a
commit 53a699a07b
11 changed files with 51 additions and 1 deletions

View File

@@ -77,6 +77,11 @@ testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion)
VIR_DOMAIN_XML_INACTIVE)))
goto fail;
if (!virDomainDefCheckABIStability(def, def)) {
fprintf(stderr, "ABI stability check failed on %s", xml);
goto fail;
}
if (!(conf = xenFormatXM(conn, def, xendConfigVersion)))
goto fail;