[PATCH 3/4] qemu_passt: Report error when getting passt PID failed
Laine Stump
laine at redhat.com
Wed Feb 15 07:24:16 UTC 2023
On 2/14/23 6:51 AM, Michal Privoznik wrote:
> If qemuPasstGetPid() fails, or the passt's PID is -1 then
> qemuPasstSetupCgroup() returns early without any error message
> set. Report an appropriate error.
>
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
Reviewed-by: Laine Stump <laine at redhat.com>
> ---
> src/qemu/qemu_passt.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c
> index 0f09bf3db8..78830fdc26 100644
> --- a/src/qemu/qemu_passt.c
> +++ b/src/qemu/qemu_passt.c
> @@ -125,8 +125,11 @@ qemuPasstSetupCgroup(virDomainObj *vm,
> {
> pid_t pid = (pid_t) -1;
>
> - if (qemuPasstGetPid(vm, net, &pid) < 0 || pid <= 0)
> + if (qemuPasstGetPid(vm, net, &pid) < 0 || pid <= 0) {
> + virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> + _("Could not get process ID of passt"));
> return -1;
> + }
>
> return virCgroupAddProcess(cgroup, pid);
> }
More information about the libvir-list
mailing list