* [PULL 1/3] qga: skip bind mounts in fs list
2024-12-18 12:03 [PULL 0/3] Misc QGA patches for 2024-12-18 Konstantin Kostiuk
@ 2024-12-18 12:03 ` Konstantin Kostiuk
2024-12-18 12:03 ` [PULL 2/3] qemu-ga-win: Fix a typo error Konstantin Kostiuk
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Konstantin Kostiuk @ 2024-12-18 12:03 UTC (permalink / raw)
To: qemu-devel, Peter Maydell, Stefan Hajnoczi
From: Jean-Louis Dupond <jean-louis@dupond.be>
The filesystem list in build_fs_mount_list should skip bind mounts.
This because we end up in locking situations when doing fsFreeze. Like
mentioned in [1] and [2].
Next to that, the build_fs_mount_list call did a fallback via
build_fs_mount_list_from_mtab if mountinfo did not exist.
There it skipped bind mounts, but this is broken for newer OS.
This as mounts does not return the path of the bind mount but the
underlying dev/partition, so S_ISDIR will never return true in
dev_major_minor call.
This patch simply checks the existing devmajor:devminor tuple in the
mounts, and if it already exists, this means we have the same devices
mounted again, a bind mount. So skip this.
Same approach is used in open-vm-tools [3].
[1]: https://gitlab.com/qemu-project/qemu/-/issues/592
[2]: https://gitlab.com/qemu-project/qemu/-/issues/520
[3]: https://github.com/vmware/open-vm-tools/commit/d58847b497e212737007958c945af1df22a8ab58
Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20241002100634.162499-2-jean-louis@dupond.be
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
---
qga/commands-linux.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/qga/commands-linux.c b/qga/commands-linux.c
index cf077eb03d..9e8a934b9a 100644
--- a/qga/commands-linux.c
+++ b/qga/commands-linux.c
@@ -58,6 +58,22 @@ static int dev_major_minor(const char *devpath,
return -1;
}
+/*
+ * Check if we already have the devmajor:devminor in the mounts
+ * If thats the case return true.
+ */
+static bool dev_exists(FsMountList *mounts, unsigned int devmajor, unsigned int devminor)
+{
+ FsMount *mount;
+
+ QTAILQ_FOREACH(mount, mounts, next) {
+ if (mount->devmajor == devmajor && mount->devminor == devminor) {
+ return true;
+ }
+ }
+ return false;
+}
+
static bool build_fs_mount_list_from_mtab(FsMountList *mounts, Error **errp)
{
struct mntent *ment;
@@ -88,6 +104,10 @@ static bool build_fs_mount_list_from_mtab(FsMountList *mounts, Error **errp)
/* Skip bind mounts */
continue;
}
+ if (dev_exists(mounts, devmajor, devminor)) {
+ /* Skip already existing devices (bind mounts) */
+ continue;
+ }
mount = g_new0(FsMount, 1);
mount->dirname = g_strdup(ment->mnt_dir);
@@ -171,6 +191,11 @@ bool build_fs_mount_list(FsMountList *mounts, Error **errp)
}
}
+ if (dev_exists(mounts, devmajor, devminor)) {
+ /* Skip already existing devices (bind mounts) */
+ continue;
+ }
+
mount = g_new0(FsMount, 1);
mount->dirname = g_strdup(line + dir_s);
mount->devtype = g_strdup(dash + type_s);
--
2.47.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PULL 2/3] qemu-ga-win: Fix a typo error
2024-12-18 12:03 [PULL 0/3] Misc QGA patches for 2024-12-18 Konstantin Kostiuk
2024-12-18 12:03 ` [PULL 1/3] qga: skip bind mounts in fs list Konstantin Kostiuk
@ 2024-12-18 12:03 ` Konstantin Kostiuk
2024-12-18 12:03 ` [PULL 3/3] qga: Don't access global variable in run_agent_once() Konstantin Kostiuk
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Konstantin Kostiuk @ 2024-12-18 12:03 UTC (permalink / raw)
To: qemu-devel, Peter Maydell, Stefan Hajnoczi
From: Dehan Meng <demeng@redhat.com>
There is a typo error for api 'guest-get-osinfo',
the win2025's version in WIN_10_0_SERVER_VERSION_MATRIX
should be adjusted.
Signed-off-by: Dehan Meng <demeng@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/20241210054616.260386-1-demeng@redhat.com
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
---
qga/commands-win32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 038beb8cfa..99c026c0a0 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -2088,7 +2088,7 @@ static const ga_win_10_0_t WIN_10_0_SERVER_VERSION_MATRIX[] = {
{14393, "Microsoft Windows Server 2016", "2016"},
{17763, "Microsoft Windows Server 2019", "2019"},
{20344, "Microsoft Windows Server 2022", "2022"},
- {26040, "MIcrosoft Windows Server 2025", "2025"},
+ {26040, "Microsoft Windows Server 2025", "2025"},
{ }
};
--
2.47.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PULL 3/3] qga: Don't access global variable in run_agent_once()
2024-12-18 12:03 [PULL 0/3] Misc QGA patches for 2024-12-18 Konstantin Kostiuk
2024-12-18 12:03 ` [PULL 1/3] qga: skip bind mounts in fs list Konstantin Kostiuk
2024-12-18 12:03 ` [PULL 2/3] qemu-ga-win: Fix a typo error Konstantin Kostiuk
@ 2024-12-18 12:03 ` Konstantin Kostiuk
2024-12-18 12:07 ` [PULL 0/3] Misc QGA patches for 2024-12-18 Daniel P. Berrangé
2024-12-19 12:30 ` Stefan Hajnoczi
4 siblings, 0 replies; 7+ messages in thread
From: Konstantin Kostiuk @ 2024-12-18 12:03 UTC (permalink / raw)
To: qemu-devel, Peter Maydell, Stefan Hajnoczi
From: Michal Privoznik <mprivozn@redhat.com>
The run_agent_once() function is already given GAState via an
argument. There's no need to access the global ga_state variable
which points to the argument anyways (thanks to
initialize_agent()). Worse, some parts of the function use the
argument and the other use the global variable. Stick with the
function argument.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Link: https://lore.kernel.org/r/8ae7f5d5032b14a5b956fe8aaf47bae5ca401699.1733414906.git.mprivozn@redhat.com
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
---
qga/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qga/main.c b/qga/main.c
index 50186760bf..4a695235f0 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -1519,7 +1519,7 @@ static int run_agent_once(GAState *s)
return EXIT_FAILURE;
}
- g_main_loop_run(ga_state->main_loop);
+ g_main_loop_run(s->main_loop);
if (s->channel) {
ga_channel_free(s->channel);
--
2.47.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PULL 0/3] Misc QGA patches for 2024-12-18
2024-12-18 12:03 [PULL 0/3] Misc QGA patches for 2024-12-18 Konstantin Kostiuk
` (2 preceding siblings ...)
2024-12-18 12:03 ` [PULL 3/3] qga: Don't access global variable in run_agent_once() Konstantin Kostiuk
@ 2024-12-18 12:07 ` Daniel P. Berrangé
2024-12-18 12:12 ` Konstantin Kostiuk
2024-12-19 12:30 ` Stefan Hajnoczi
4 siblings, 1 reply; 7+ messages in thread
From: Daniel P. Berrangé @ 2024-12-18 12:07 UTC (permalink / raw)
To: Konstantin Kostiuk; +Cc: qemu-devel, Peter Maydell, Stefan Hajnoczi
Any reason this skipped inclusion of my patch:
Subject: [PATCH] qga: implement a 'guest-get-load' command
which you already acked ?
On Wed, Dec 18, 2024 at 02:03:18PM +0200, Konstantin Kostiuk wrote:
> The following changes since commit 8032c78e556cd0baec111740a6c636863f9bd7c8:
>
> Merge tag 'firmware-20241216-pull-request' of https://gitlab.com/kraxel/qemu into staging (2024-12-16 14:20:33 -0500)
>
> are available in the Git repository at:
>
> https://github.com/kostyanf14/qemu.git tags/qga-pull-2024-12-18
>
> for you to fetch changes up to 2657a92b5479c8705b128ed1e55feb8960ed498a:
>
> qga: Don't access global variable in run_agent_once() (2024-12-18 13:46:16 +0200)
>
> ----------------------------------------------------------------
> qga-pull-2024-12-18
>
> ----------------------------------------------------------------
> Dehan Meng (1):
> qemu-ga-win: Fix a typo error
>
> Jean-Louis Dupond (1):
> qga: skip bind mounts in fs list
>
> Michal Privoznik (1):
> qga: Don't access global variable in run_agent_once()
>
> qga/commands-linux.c | 25 +++++++++++++++++++++++++
> qga/commands-win32.c | 2 +-
> qga/main.c | 2 +-
> 3 files changed, 27 insertions(+), 2 deletions(-)
>
> --
> 2.47.1
>
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PULL 0/3] Misc QGA patches for 2024-12-18
2024-12-18 12:07 ` [PULL 0/3] Misc QGA patches for 2024-12-18 Daniel P. Berrangé
@ 2024-12-18 12:12 ` Konstantin Kostiuk
0 siblings, 0 replies; 7+ messages in thread
From: Konstantin Kostiuk @ 2024-12-18 12:12 UTC (permalink / raw)
To: Daniel P. Berrangé; +Cc: qemu-devel, Peter Maydell, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 1886 bytes --]
Hi Daniel,
Sorry, I just missed it.
I will send one more PR in a few days and include it.
Best Regards,
Konstantin Kostiuk.
On Wed, Dec 18, 2024 at 2:07 PM Daniel P. Berrangé <berrange@redhat.com>
wrote:
> Any reason this skipped inclusion of my patch:
>
> Subject: [PATCH] qga: implement a 'guest-get-load' command
>
> which you already acked ?
>
> On Wed, Dec 18, 2024 at 02:03:18PM +0200, Konstantin Kostiuk wrote:
> > The following changes since commit
> 8032c78e556cd0baec111740a6c636863f9bd7c8:
> >
> > Merge tag 'firmware-20241216-pull-request' of
> https://gitlab.com/kraxel/qemu into staging (2024-12-16 14:20:33 -0500)
> >
> > are available in the Git repository at:
> >
> > https://github.com/kostyanf14/qemu.git tags/qga-pull-2024-12-18
> >
> > for you to fetch changes up to 2657a92b5479c8705b128ed1e55feb8960ed498a:
> >
> > qga: Don't access global variable in run_agent_once() (2024-12-18
> 13:46:16 +0200)
> >
> > ----------------------------------------------------------------
> > qga-pull-2024-12-18
> >
> > ----------------------------------------------------------------
> > Dehan Meng (1):
> > qemu-ga-win: Fix a typo error
> >
> > Jean-Louis Dupond (1):
> > qga: skip bind mounts in fs list
> >
> > Michal Privoznik (1):
> > qga: Don't access global variable in run_agent_once()
> >
> > qga/commands-linux.c | 25 +++++++++++++++++++++++++
> > qga/commands-win32.c | 2 +-
> > qga/main.c | 2 +-
> > 3 files changed, 27 insertions(+), 2 deletions(-)
> >
> > --
> > 2.47.1
> >
> >
>
> With regards,
> Daniel
> --
> |: https://berrange.com -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o-
> https://www.instagram.com/dberrange :|
>
>
[-- Attachment #2: Type: text/html, Size: 3287 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PULL 0/3] Misc QGA patches for 2024-12-18
2024-12-18 12:03 [PULL 0/3] Misc QGA patches for 2024-12-18 Konstantin Kostiuk
` (3 preceding siblings ...)
2024-12-18 12:07 ` [PULL 0/3] Misc QGA patches for 2024-12-18 Daniel P. Berrangé
@ 2024-12-19 12:30 ` Stefan Hajnoczi
4 siblings, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2024-12-19 12:30 UTC (permalink / raw)
To: Konstantin Kostiuk; +Cc: qemu-devel, Peter Maydell, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 116 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread