diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 17c9e26210..3cb780d153 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11696,6 +11696,36 @@ virDomainMemballoonDefCheckABIStability(virDomainMemballoonDefPtr src, } +static bool +virDomainRNGDefCheckABIStability(virDomainRNGDefPtr src, + virDomainRNGDefPtr dst) +{ + if (!src && !dst) + return true; + + if (!src || !dst) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target domain RNG device count '%d' " + "does not match source count '%d'"), + src ? 1 : 0, dst ? 1 : 0); + return false; + } + + if (src->model != dst->model) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target RNG model '%s' does not match source '%s'"), + virDomainRNGModelTypeToString(dst->model), + virDomainRNGModelTypeToString(src->model)); + return false; + } + + if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) + return false; + + return true; +} + + static bool virDomainHubDefCheckABIStability(virDomainHubDefPtr src, virDomainHubDefPtr dst) @@ -12097,6 +12127,9 @@ virDomainDefCheckABIStability(virDomainDefPtr src, dst->memballoon)) return false; + if (!virDomainRNGDefCheckABIStability(src->rng, dst->rng)) + return false; + return true; }