qemuDomainChangeNet: Check changed virtio network driver options

Changes to a virtio network device such as
  <interface type="network">
    <model type="virtio"/>
    <driver iommu="on" ats="on"/> <!-- this line added -->
    ...
  </interface>
were quietly dismissed by `virsh update-device ... --live`.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-01-06 12:12:40 +01:00 committed by Michal Privoznik
parent 3e883cf07e
commit b44caea0b2

View File

@ -3600,6 +3600,16 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
goto cleanup;
}
if (!!olddev->virtio != !!newdev->virtio ||
(olddev->virtio && newdev->virtio &&
(olddev->virtio->iommu != newdev->virtio->iommu ||
olddev->virtio->ats != newdev->virtio->ats ||
olddev->virtio->packed != newdev->virtio->packed))) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify virtio network device driver options"));
goto cleanup;
}
/* data: this union will be examined later, after allocating new actualdev */
/* virtPortProfile: will be examined later, after allocating new actualdev */