1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

node_device_udev: Don't overwrite @ret in udevProcessStorage()

Let's use a different variable for storing retvals of helper
functions. This way the usual function pattern can be restored.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2021-05-31 16:22:42 +02:00
parent 950a9b256b
commit 791b1173d0

View File

@ -927,6 +927,7 @@ udevProcessStorage(struct udev_device *device,
{
virNodeDevCapStorage *storage = &def->caps->data.storage;
int ret = -1;
int rv;
const char* devnode;
devnode = udev_device_get_devnode(device);
@ -971,22 +972,26 @@ udevProcessStorage(struct udev_device *device,
}
if (STREQ(def->caps->data.storage.drive_type, "cd")) {
ret = udevProcessCDROM(device, def);
rv = udevProcessCDROM(device, def);
} else if (STREQ(def->caps->data.storage.drive_type, "disk")) {
ret = udevProcessDisk(device, def);
rv = udevProcessDisk(device, def);
} else if (STREQ(def->caps->data.storage.drive_type, "floppy")) {
ret = udevProcessFloppy(device, def);
rv = udevProcessFloppy(device, def);
} else if (STREQ(def->caps->data.storage.drive_type, "sd")) {
ret = udevProcessSD(device, def);
rv = udevProcessSD(device, def);
} else if (STREQ(def->caps->data.storage.drive_type, "dasd")) {
ret = udevProcessDASD(device, def);
rv = udevProcessDASD(device, def);
} else {
VIR_DEBUG("Unsupported storage type '%s'",
def->caps->data.storage.drive_type);
goto cleanup;
}
if (rv < 0)
goto cleanup;
udevGenerateDeviceName(device, def, storage->serial);
ret = 0;
cleanup:
VIR_DEBUG("Storage ret=%d", ret);