Skip to contentSkip to conversation

Misc changes guest agent

GIT PULL Applied Konstantin Kostiuk 2 participants 6 messages Jan 30, 2024 – Jan 31, 2024

lore
Share & tools
lore
#0 lore raw

The following changes since commit 11be70677c70fdccd452a3233653949b79e97908:

Merge tag 'pull-vfio-20240129' of https://github.com/legoater/qemu into staging (2024-01-29 10:53:56 +0000)

are available in the Git repository at:

https://github.com/kostyanf14/qemu.git tags/qga-pull-2024-01-30

for you to fetch changes up to b3e0f64487a4b937d871ce4ce9c259e02ec02191:

qga: Solaris has net/if_arp.h and netinet/if_ether.h but not ETHER_ADDR_LEN (2024-01-30 12:14:28 +0200)

----------------------------------------------------------------
qga-pull-2024-01-30

----------------------------------------------------------------
Angel M. Villegas (1):

      guest-agent: improve help for --allow-rpcs and --block-rpcs

Nick Briggs (1):
qga: Solaris has net/if_arp.h and netinet/if_ether.h but not ETHER_ADDR_LEN

Peng Ji (1):
qga-win: Fix guest-get-fsinfo multi-disks collection

Samuel Tardieu (1):
tests/unit/test-qga: do not qualify executable paths

 docs/interop/qemu-ga.rst | 8 ++++----
 qga/commands-posix.c     | 5 ++++-
 qga/commands-win32.c     | 2 ++
 qga/main.c               | 4 ++--
 tests/unit/test-qga.c    | 6 +++---
 5 files changed, 15 insertions(+), 10 deletions(-)

--
2.42.0

#1 lore raw

[PULL 1/4] guest-agent: improve help for --allow-rpcs and --block-rpcs

From: "Angel M. Villegas" <[email protected]>

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1757

Updates to qga help output and documentation for --allow-rpcs and --blocks-rpcs

---
 docs/interop/qemu-ga.rst | 8 ++++----
 qga/main.c               | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
docs/interop/qemu-ga.rst +4 -4
index 461c5a35ee..72fb75a6f5 100644
@@ -81,13 +81,13 @@ Options
 
 .. option:: -b, --block-rpcs=LIST
 
-  Comma-separated list of RPCs to disable (no spaces, use ``help`` to
-  list available RPCs).
+  Comma-separated list of RPCs to disable (no spaces, use ``--block-rpcs=help``
+  to list available RPCs).
 
 .. option:: -a, --allow-rpcs=LIST
 
-  Comma-separated list of RPCs to enable (no spaces, use ``help`` to
-  list available RPCs).
+  Comma-separated list of RPCs to enable (no spaces, use ``--allow-rpcs=help``
+  to list available RPCs).
 
 .. option:: -D, --dump-conf
 
qga/main.c +2 -2
index 8668b9f3d3..bdf5344584 100644
@@ -261,9 +261,9 @@ QEMU_COPYRIGHT "\n"
 "  -s, --service     service commands: install, uninstall, vss-install, vss-uninstall\n"
 #endif
 "  -b, --block-rpcs  comma-separated list of RPCs to disable (no spaces,\n"
-"                    use \"help\" to list available RPCs)\n"
+"                    use \"--block-rpcs=help\" to list available RPCs)\n"
 "  -a, --allow-rpcs  comma-separated list of RPCs to enable (no spaces,\n"
-"                    use \"help\" to list available RPCs)\n"
+"                    use \"--allow-rpcs=help\" to list available RPCs)\n"
 "  -D, --dump-conf   dump a qemu-ga config file based on current config\n"
 "                    options / command-line parameters to stdout\n"
 "  -r, --retry-path  attempt re-opening path if it's unavailable or closed\n"
Signature · 1 line
2.42.0
#2 lore raw

[PULL 2/4] tests/unit/test-qga: do not qualify executable paths

In reply to Konstantin Kostiuk

From: Samuel Tardieu <[email protected]>

guest-exec invocation does not need the full path of the executable to execute. Using only the command names ensures correct execution of the test on systems not adhering to the FHS.

---
 tests/unit/test-qga.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/unit/test-qga.c +3 -3
index 671e83cb86..8cddf5dc37 100644
@@ -822,7 +822,7 @@ static void test_qga_guest_exec(gconstpointer fix)
 
     /* exec 'echo foo bar' */
     ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {"
-                 " 'path': '/bin/echo', 'arg': [ '-n', '\" test_str \"' ],"
+                 " 'path': 'echo', 'arg': [ '-n', '\" test_str \"' ],"
                  " 'capture-output': true } }");
     g_assert_nonnull(ret);
     qmp_assert_no_error(ret);
@@ -883,7 +883,7 @@ static void test_qga_guest_exec_separated(gconstpointer fix)
 
     /* exec 'echo foo bar' */
     ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {"
-                 " 'path': '/bin/bash',"
+                 " 'path': 'bash',"
                  " 'arg': [ '-c', 'for i in $(seq 4); do if (( $i %% 2 )); then echo stdout; else echo stderr 1>&2; fi; done;' ],"
                  " 'capture-output': 'separated' } }");
     g_assert_nonnull(ret);
@@ -924,7 +924,7 @@ static void test_qga_guest_exec_merged(gconstpointer fix)
 
     /* exec 'echo foo bar' */
     ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', 'arguments': {"
-                 " 'path': '/bin/bash',"
+                 " 'path': 'bash',"
                  " 'arg': [ '-c', 'for i in $(seq 4); do if (( $i %% 2 )); then echo stdout; else echo stderr 1>&2; fi; done;' ],"
                  " 'capture-output': 'merged' } }");
     g_assert_nonnull(ret);
Signature · 1 line
2.42.0
#3 lore raw

[PULL 4/4] qga: Solaris has net/if_arp.h and netinet/if_ether.h but not ETHER_ADDR_LEN

In reply to Konstantin Kostiuk

From: Nick Briggs <[email protected]>

Solaris has net/if_arp.h and netinet/if_ether.h rather than net/ethernet.h, but does not define ETHER_ADDR_LEN, instead providing ETHERADDRL.

---
 qga/commands-posix.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
qga/commands-posix.c +4 -1
index 6169bbf7a0..26008db497 100644
@@ -45,9 +45,12 @@
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <net/if.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(CONFIG_SOLARIS)
 #include <net/if_arp.h>
 #include <netinet/if_ether.h>
+#if !defined(ETHER_ADDR_LEN) && defined(ETHERADDRL)
+#define ETHER_ADDR_LEN ETHERADDRL
+#endif
 #else
 #include <net/ethernet.h>
 #endif
Signature · 1 line
2.42.0
#4 lore raw

[PULL 3/4] qga-win: Fix guest-get-fsinfo multi-disks collection

In reply to Konstantin Kostiuk

From: Peng Ji <[email protected]>

When a volume has more than one disk, all disks cannot be returned correctly because there is not enough malloced memory for disk extents, so before executing DeviceIoControl for the second time, get the correct size of the required memory space to store all disk extents.

Details:
https://learn.microsoft.com/en-us/windows/win32/api/winioctl/ns-winioctl-volume_disk_extents

---
 qga/commands-win32.c | 2 ++
 1 file changed, 2 insertions(+)
qga/commands-win32.c +2 -0
index 697c65507c..a1015757d8 100644
@@ -935,6 +935,8 @@ static GuestDiskAddressList *build_guest_disk_info(char *guid, Error **errp)
         DWORD last_err = GetLastError();
         if (last_err == ERROR_MORE_DATA) {
             /* Try once more with big enough buffer */
+            size = sizeof(VOLUME_DISK_EXTENTS) +
+               (sizeof(DISK_EXTENT) * (extents->NumberOfDiskExtents - 1));
             g_free(extents);
             extents = g_malloc0(size);
             if (!DeviceIoControl(
Signature · 1 line
2.42.0
#5 lore raw
In reply to Konstantin Kostiuk
Quoted 7 lines · Konstantin Kostiuk

The following changes since commit 11be70677c70fdccd452a3233653949b79e97908:

Merge tag 'pull-vfio-20240129' of https://github.com/legoater/qemu into staging (2024-01-29 10:53:56 +0000)

are available in the Git repository at:

Quoted 8 lines

https://github.com/kostyanf14/qemu.git tags/qga-pull-2024-01-30

for you to fetch changes up to b3e0f64487a4b937d871ce4ce9c259e02ec02191:

qga: Solaris has net/if_arp.h and netinet/if_ether.h but not ETHER_ADDR_LEN (2024-01-30 12:14:28 +0200)

----------------------------------------------------------------
qga-pull-2024-01-30

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0
for any user-visible changes.

-- PMM