mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
Revert "qemu: Fix integer/boolean logic in qemuSetUnprivSGIO"
This reverts commit 69b850fe2a19d0c32ae2f209e8d8463df6ead665. This change broke the ability to "clear" or reset unfiltered back to filtered.
This commit is contained in:
parent
3b2db51430
commit
ec6754db57
@ -1433,7 +1433,7 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
|
||||
virDomainHostdevDefPtr hostdev = NULL;
|
||||
char *sysfs_path = NULL;
|
||||
const char *path = NULL;
|
||||
bool val;
|
||||
int val = -1;
|
||||
int ret = -1;
|
||||
|
||||
/* "sgio" is only valid for block disk; cdrom
|
||||
@ -1475,12 +1475,8 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev)
|
||||
* whitelist is enabled. But if requesting unfiltered access, always call
|
||||
* virSetDeviceUnprivSGIO, to report an error for unsupported unpriv_sgio.
|
||||
*/
|
||||
if (!val || !virFileExists(sysfs_path)) {
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virSetDeviceUnprivSGIO(path, NULL, 1) < 0)
|
||||
if ((virFileExists(sysfs_path) || val == 1) &&
|
||||
virSetDeviceUnprivSGIO(path, NULL, val) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user