On 2022/09/04 02:35, Brad Smith wrote: > Here is an update to QEMU 7.1.0.
Would make sense to add DEBUG_PACKAGES=${BUILD_PACKAGES} I think. > Note upstream made a bunch of changes to QGA including moving the > function to retrieve network interfaces using getifaddrs() from > Linux specific to being OS agnostic. Builds but is not tested. > > Definitely need someone to double check qmp_guest_network_get_interfaces() > which I based on the mostly duplicate function provided in the patch. That doesn't work, I haven't figured out all the details yet but here's a trace, (gdb) set args -v -t /var/run/qemu-ga -f /var/run/qemu-ga/qemu-ga.pid (gdb) r Starting program: /usr/local/bin/qemu-ga -v -t /var/run/qemu-ga -f /var/run/qemu-ga/qemu-ga.pid 1662640390.016895: debug: Guest agent version 7.1.0 started 1662640390.017001: debug: disabling command: guest-suspend-disk 1662640390.017009: debug: disabling command: guest-suspend-ram 1662640390.017016: debug: disabling command: guest-suspend-hybrid 1662640390.017022: debug: disabling command: guest-set-vcpus 1662640390.017028: debug: disabling command: guest-get-memory-blocks 1662640390.017034: debug: disabling command: guest-set-memory-blocks 1662640390.017041: debug: disabling command: guest-get-memory-block-size 1662640390.017048: debug: disabling command: guest-get-memory-block-info 1662640390.017054: debug: disabling command: guest-fsfreeze-status 1662640390.017059: debug: disabling command: guest-fsfreeze-freeze 1662640390.017065: debug: disabling command: guest-fsfreeze-freeze-list 1662640390.017077: debug: disabling command: guest-fsfreeze-thaw 1662640390.017083: debug: disabling command: guest-get-disks 1662640390.017088: debug: disabling command: guest-fstrim 1662640390.017094: debug: disabling command: guest-get-devices 1662640395.292635: debug: read data, count: 105, data: {"arguments":{"id":2453796021},"execute":"guest-sync-delimited"} {"arguments":{},"execute":"guest-ping"} 1662640395.292744: debug: process_event: called 1662640395.292754: debug: processing command 1662640395.292797: debug: sending data, count: 24 1662640395.292909: debug: process_event: called 1662640395.292937: debug: processing command 1662640395.293006: debug: sending data, count: 15 1662640395.295360: debug: read data, count: 14, data: {"arguments":{ 1662640395.295440: debug: read data, count: 109, data: "id":2453796022},"execute":"guest-sync-delimited"} {"execute":"guest-network-get-interfaces","arguments":{}} 1662640395.295470: debug: process_event: called 1662640395.295480: debug: processing command 1662640395.295555: debug: sending data, count: 24 1662640395.295670: debug: process_event: called 1662640395.295702: debug: processing command 1662640395.295782: debug: Processing lo0 interface 1662640395.295793: debug: Processing lo0 interface 1662640395.295802: debug: Network stats reporting available only for Linux 1662640395.295807: debug: Processing lo0 interface 1662640395.295814: debug: Network stats reporting available only for Linux 1662640395.295820: debug: Processing lo0 interface 1662640395.295827: debug: Network stats reporting available only for Linux 1662640395.295833: debug: Processing vio0 interface [New thread 355504] Thread 1 received signal SIGSEGV, Segmentation fault. 0x000009a3ee9be144 in _libc_snprintf (str=<optimized out>, n=<optimized out>, fmt=<optimized out>) at /usr/src/lib/libc/stdio/snprintf.c:65 65 *f._p = '\0'; (gdb) bt #0 0x000009a3ee9be144 in _libc_snprintf (str=<optimized out>, n=<optimized out>, fmt=<optimized out>) at /usr/src/lib/libc/stdio/snprintf.c:65 #1 0x000009a1042d65e1 in qmp_guest_network_get_interfaces (errp=0x7f7fffff8e18) at ../qemu-7.1.0/qga/commands-posix.c:3402 #2 0x000009a1042c7d31 in qmp_marshal_guest_network_get_interfaces (args=<optimized out>, ret=0x7f7fffff8ec0, errp=0x7f7fffff8ed0) at qga/qga-qapi-commands.c:877 #3 0x000009a10430dd46 in qmp_dispatch (cmds=<optimized out>, request=<optimized out>, allow_oob=<optimized out>, cur_mon=<optimized out>) at ../qemu-7.1.0/qapi/qmp-dispatch.c:210 #4 0x000009a1042d4123 in process_event (opaque=0x9a34bf33a00, obj=0x9a3ec8a0000, err=0x0) at ../qemu-7.1.0/qga/main.c:582 #5 0x000009a104312053 in json_message_process_token (lexer=0x9a34bf33a18, input=<optimized out>, type=<optimized out>, x=57, y=<optimized out>) at ../qemu-7.1.0/qobject/json-streamer.c:99 #6 0x000009a104312433 in json_lexer_feed_char (lexer=0x9a34bf33a18, ch=125 '}', flush=<optimized out>) at ../qemu-7.1.0/qobject/json-lexer.c:313 #7 0x000009a10431229f in json_lexer_feed (lexer=0x9a34bf33a18, buffer=0x7f7fffff9040 "\"id\":2453796022},\"execute\":\"guest-sync-delimited\"}\n{\"execute\":\"guest-network-get-interfaces\",\"arguments\":{}}\n", size=109) at ../qemu-7.1.0/qobject/json-lexer.c:350 #8 0x000009a1042d43f4 in channel_event_cb (condition=<optimized out>, data=0x9a34bf33a00) at ../qemu-7.1.0/qga/main.c:608 #9 0x000009a1042d4b3f in ga_channel_client_event (channel=<optimized out>, condition=<optimized out>, data=0x9a34bf2f600) at ../qemu-7.1.0/qga/channel-posix.c:94 #10 0x000009a34619b2ff in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.4201.8 #11 0x000009a34619b6ba in g_main_context_iterate () from /usr/local/lib/libglib-2.0.so.4201.8 #12 0x000009a34619baea in g_main_loop_run () from /usr/local/lib/libglib-2.0.so.4201.8 --Type <RET> for more, q to quit, c to continue without paging--q Quit (gdb) frame 1 #1 0x000009a1042d65e1 in qmp_guest_network_get_interfaces (errp=0x7f7fffff8e18) at ../qemu-7.1.0/qga/commands-posix.c:3402 3402 snprintf(mac_addr, 18, "%s", (gdb) list 3397 3398 info->has_hardware_address = false; 3399 3400 if (sdl->sdl_type == IFT_ETHER && 3401 sdl->sdl_alen == ETHER_ADDR_LEN) { 3402 snprintf(mac_addr, 18, "%s", 3403 ether_ntoa((struct ether_addr *)LLADDR(sdl))); 3404 info->has_hardware_address = true; 3405 } else { 3406 info->has_hardware_address = true; (gdb) p sdl $1 = <optimized out>