mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu_hotplug: Do not allow absent values in rom settings
If there are absent values in an already existing element specifying rom settings, we simply use the old ones. This behaviour is not desired, as users might think that deleting the element from XML would delete the setting (because the hotplug succeeds) - which does not happen. Because of that, we should not accept an interface without elements that cannot be changed. Therefore, we should not allow absent values for already existing rom setting during hotplug. Resolves: https://issues.redhat.com/browse/RHEL-7109 Signed-off-by: Kristina Hanicova <khanicov@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
b53e9f834b
commit
e5eb64e9fd
@ -3838,16 +3838,12 @@ qemuDomainChangeNet(virQEMUDriver *driver,
|
||||
|
||||
/* device alias is checked already in virDomainDefCompatibleDevice */
|
||||
|
||||
if (newdev->info.rombar == VIR_TRISTATE_SWITCH_ABSENT)
|
||||
newdev->info.rombar = olddev->info.rombar;
|
||||
if (olddev->info.rombar != newdev->info.rombar) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network device rom bar setting"));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!newdev->info.romfile)
|
||||
newdev->info.romfile = g_strdup(olddev->info.romfile);
|
||||
if (STRNEQ_NULLABLE(olddev->info.romfile, newdev->info.romfile)) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network rom file"));
|
||||
@ -3860,8 +3856,6 @@ qemuDomainChangeNet(virQEMUDriver *driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (newdev->info.romenabled == VIR_TRISTATE_BOOL_ABSENT)
|
||||
newdev->info.romenabled = olddev->info.romenabled;
|
||||
if (olddev->info.romenabled != newdev->info.romenabled) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("cannot modify network device rom enabled setting"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user