[PATCHv2 0/2] ch: minor fixes - segfault and last meaningful error preservation

Kirill Shchetiniuk posted 2 patches 9 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20250314115236.53057-2-kshcheti@redhat.com
src/ch/ch_events.c  | 4 ++--
src/ch/ch_process.c | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
[PATCHv2 0/2] ch: minor fixes - segfault and last meaningful error preservation
Posted by Kirill Shchetiniuk 9 months, 1 week ago
During fixing some other issue found out a few minor bugs
related to CH driver.

First bug is related to monitor object ref count
in virCHStartEventHandler and virCHEventHandlerLoop, as
object was unrefed by parent while is still used by child
thread. Moved object unref to the correct place to the
correct thread.

Second bug is related to v object ref count in
virCHStartEventHandler, as vm object was unrefed,
while is still used later, move object unref to
after its last usage.

Third bug is related to error handling and
propagation. Last meaninful error was reset
by virCHProcessStop, which have led to
unknown error message in virsh. Add error
preservation at the begining of the function
and restoring it at the end to keep
consistent error output


Kirill Shchetiniuk (2):
  ch: virCHProcessStop preserve last meaningful error
  ch: ref count fix in virCHEventHandlerLoop and virCHStartEventHandler

 src/ch/ch_events.c  | 4 ++--
 src/ch/ch_process.c | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

-- 
2.48.1
Re: [PATCHv2 0/2] ch: minor fixes - segfault and last meaningful error preservation
Posted by Michal Prívozník via Devel 9 months ago
On 3/14/25 12:51, Kirill Shchetiniuk wrote:
> During fixing some other issue found out a few minor bugs
> related to CH driver.
> 
> First bug is related to monitor object ref count
> in virCHStartEventHandler and virCHEventHandlerLoop, as
> object was unrefed by parent while is still used by child
> thread. Moved object unref to the correct place to the
> correct thread.
> 
> Second bug is related to v object ref count in
> virCHStartEventHandler, as vm object was unrefed,
> while is still used later, move object unref to
> after its last usage.
> 
> Third bug is related to error handling and
> propagation. Last meaninful error was reset
> by virCHProcessStop, which have led to
> unknown error message in virsh. Add error
> preservation at the begining of the function
> and restoring it at the end to keep
> consistent error output
> 
> 
> Kirill Shchetiniuk (2):
>   ch: virCHProcessStop preserve last meaningful error
>   ch: ref count fix in virCHEventHandlerLoop and virCHStartEventHandler
> 
>  src/ch/ch_events.c  | 4 ++--
>  src/ch/ch_process.c | 5 +++++
>  2 files changed, 7 insertions(+), 2 deletions(-)
> 

I've reworded commit messages a bit and merged.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Congratulations on your first libvirt contribution!

Michal