[PATCH 0/3] fsfreeze-hook: fix bashisms, syslog fallback logic

Peter Maydell posted 3 patches 2 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260317094806.1944053-1-peter.maydell@linaro.org
Maintainers: Michael Roth <michael.roth@amd.com>, Kostiantyn Kostiuk <kkostiuk@redhat.com>
scripts/qemu-guest-agent/fsfreeze-hook | 34 ++++++++++++++++++--------
1 file changed, 24 insertions(+), 10 deletions(-)
[PATCH 0/3] fsfreeze-hook: fix bashisms, syslog fallback logic
Posted by Peter Maydell 2 weeks, 6 days ago
This patchset fixes some issues with the fsfreeze-hook guest-agent
script reported in https://gitlab.com/qemu-project/qemu/-/work_items/3339

 * the script is a #!/bin/sh one, but it uses various bash-isms.
   Most are easy fixes, but getting rid of the PIPESTATUS usage
   is a little less obvious, so that gets its own patch
 * a bug in the logic determining whether to log to file or syslog
   means that if the logfile doesn't exist on first run, the script
   will create the logfile but log to syslog (and then log to file
   on second and subsequent runs)

NB: I have tested this by setting up the script and running it
manually in a temp directory, but not as a "real world" fsfreeze.

thanks
-- PMM

Peter Maydell (3):
  scripts/qemu-guest-agent/fsfreeze-hook: Avoid bash-isms
  scripts/qemu-guest-agent/fsfreeze-hook: Avoid use of PIPESTATUS
  scripts/qemu-guest-agent/fsfreeze-hook: Fix syslog-fallback logic

 scripts/qemu-guest-agent/fsfreeze-hook | 34 ++++++++++++++++++--------
 1 file changed, 24 insertions(+), 10 deletions(-)

-- 
2.43.0
Re: [PATCH 0/3] fsfreeze-hook: fix bashisms, syslog fallback logic
Posted by Peter Maydell 1 week, 3 days ago
On Tue, 17 Mar 2026 at 09:48, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> This patchset fixes some issues with the fsfreeze-hook guest-agent
> script reported in https://gitlab.com/qemu-project/qemu/-/work_items/3339
>
>  * the script is a #!/bin/sh one, but it uses various bash-isms.
>    Most are easy fixes, but getting rid of the PIPESTATUS usage
>    is a little less obvious, so that gets its own patch
>  * a bug in the logic determining whether to log to file or syslog
>    means that if the logfile doesn't exist on first run, the script
>    will create the logfile but log to syslog (and then log to file
>    on second and subsequent runs)
>
> NB: I have tested this by setting up the script and running it
> manually in a temp directory, but not as a "real world" fsfreeze.

These have been reviewed, do you plan to take them into a pullreq ?

thanks
-- PMM
Re: [PATCH 0/3] fsfreeze-hook: fix bashisms, syslog fallback logic
Posted by Kostiantyn Kostiuk 1 week, 3 days ago
On Fri, Mar 27, 2026 at 7:03 PM Peter Maydell <peter.maydell@linaro.org>
wrote:

> On Tue, 17 Mar 2026 at 09:48, Peter Maydell <peter.maydell@linaro.org>
> wrote:
> >
> > This patchset fixes some issues with the fsfreeze-hook guest-agent
> > script reported in
> https://gitlab.com/qemu-project/qemu/-/work_items/3339
> >
> >  * the script is a #!/bin/sh one, but it uses various bash-isms.
> >    Most are easy fixes, but getting rid of the PIPESTATUS usage
> >    is a little less obvious, so that gets its own patch
> >  * a bug in the logic determining whether to log to file or syslog
> >    means that if the logfile doesn't exist on first run, the script
> >    will create the logfile but log to syslog (and then log to file
> >    on second and subsequent runs)
> >
> > NB: I have tested this by setting up the script and running it
> > manually in a temp directory, but not as a "real world" fsfreeze.
>
> These have been reviewed, do you plan to take them into a pullreq ?
>

Yes. I keep it for comments from other people.

Do you prefer to merge it into v11.0 or v11.1?


>
> thanks
> -- PMM
>
>
Re: [PATCH 0/3] fsfreeze-hook: fix bashisms, syslog fallback logic
Posted by Peter Maydell 1 week, 3 days ago
On Fri, 27 Mar 2026 at 17:40, Kostiantyn Kostiuk <kkostiuk@redhat.com> wrote:
>
>
>
> On Fri, Mar 27, 2026 at 7:03 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> On Tue, 17 Mar 2026 at 09:48, Peter Maydell <peter.maydell@linaro.org> wrote:
>> >
>> > This patchset fixes some issues with the fsfreeze-hook guest-agent
>> > script reported in https://gitlab.com/qemu-project/qemu/-/work_items/3339
>> >
>> >  * the script is a #!/bin/sh one, but it uses various bash-isms.
>> >    Most are easy fixes, but getting rid of the PIPESTATUS usage
>> >    is a little less obvious, so that gets its own patch
>> >  * a bug in the logic determining whether to log to file or syslog
>> >    means that if the logfile doesn't exist on first run, the script
>> >    will create the logfile but log to syslog (and then log to file
>> >    on second and subsequent runs)
>> >
>> > NB: I have tested this by setting up the script and running it
>> > manually in a temp directory, but not as a "real world" fsfreeze.
>>
>> These have been reviewed, do you plan to take them into a pullreq ?
>
>
> Yes. I keep it for comments from other people.
>
> Do you prefer to merge it into v11.0 or v11.1?

It's a user-reported bug, so I think 11.0 would be nice unless
you think it's too risky or needs more testing.

-- PMM