mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Add redirdevs to ABI stability check
Check the bus, type of the source device (tcp vs. spicevmc) and the device address visible in the guest. https://bugzilla.redhat.com/show_bug.cgi?id=1035128
This commit is contained in:
parent
904e6e906b
commit
c9123fbe85
@ -13699,6 +13699,42 @@ virDomainHubDefCheckABIStability(virDomainHubDefPtr src,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static bool
|
||||||
|
virDomainRedirdevDefCheckABIStability(virDomainRedirdevDefPtr src,
|
||||||
|
virDomainRedirdevDefPtr dst)
|
||||||
|
{
|
||||||
|
if (src->bus != dst->bus) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Target redirected device bus %s does not match "
|
||||||
|
"source %s"),
|
||||||
|
virDomainRedirdevBusTypeToString(dst->bus),
|
||||||
|
virDomainRedirdevBusTypeToString(src->bus));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ((enum virDomainRedirdevBus) src->bus) {
|
||||||
|
case VIR_DOMAIN_REDIRDEV_BUS_USB:
|
||||||
|
if (src->source.chr.type != dst->source.chr.type) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Target redirected device source type %s does "
|
||||||
|
"not match source device source type %s"),
|
||||||
|
virDomainChrTypeToString(dst->source.chr.type),
|
||||||
|
virDomainChrTypeToString(src->source.chr.type));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VIR_DOMAIN_REDIRDEV_BUS_LAST:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
virDomainRedirFilterDefCheckABIStability(virDomainRedirFilterDefPtr src,
|
virDomainRedirFilterDefCheckABIStability(virDomainRedirFilterDefPtr src,
|
||||||
virDomainRedirFilterDefPtr dst)
|
virDomainRedirFilterDefPtr dst)
|
||||||
@ -14139,6 +14175,20 @@ virDomainDefCheckABIStability(virDomainDefPtr src,
|
|||||||
if (!virDomainHubDefCheckABIStability(src->hubs[i], dst->hubs[i]))
|
if (!virDomainHubDefCheckABIStability(src->hubs[i], dst->hubs[i]))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
if (src->nredirdevs != dst->nredirdevs) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Target domain redirected devices count %zu "
|
||||||
|
"does not match source %zu"),
|
||||||
|
dst->nconsoles, src->nconsoles);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < src->nredirdevs; i++) {
|
||||||
|
if (!virDomainRedirdevDefCheckABIStability(src->redirdevs[i],
|
||||||
|
dst->redirdevs[i]))
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
if ((!src->redirfilter && dst->redirfilter) ||
|
if ((!src->redirfilter && dst->redirfilter) ||
|
||||||
(src->redirfilter && !dst->redirfilter)) {
|
(src->redirfilter && !dst->redirfilter)) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user