lxc: virLXCControllerAddConsole() to void

virLXCControllerAddConsole() return value is invariant, so change
it type and remove all dependent checks.

Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Artem Chernyshev 2024-01-04 03:16:59 +03:00 committed by Michal Privoznik
parent bce48d99a7
commit 270e363046

View File

@ -313,8 +313,8 @@ static void virLXCControllerFree(virLXCController *ctrl)
}
static int virLXCControllerAddConsole(virLXCController *ctrl,
int hostFd)
static void virLXCControllerAddConsole(virLXCController *ctrl,
int hostFd)
{
VIR_EXPAND_N(ctrl->consoles, ctrl->nconsoles, 1);
ctrl->consoles[ctrl->nconsoles-1].daemon = ctrl->daemon;
@ -326,7 +326,6 @@ static int virLXCControllerAddConsole(virLXCController *ctrl,
ctrl->consoles[ctrl->nconsoles-1].epollFd = -1;
ctrl->consoles[ctrl->nconsoles-1].epollWatch = -1;
return 0;
}
@ -2655,8 +2654,7 @@ int main(int argc, char *argv[])
}
for (i = 0; i < nttyFDs; i++) {
if (virLXCControllerAddConsole(ctrl, ttyFDs[i]) < 0)
goto cleanup;
virLXCControllerAddConsole(ctrl, ttyFDs[i]);
ttyFDs[i] = -1;
}