87ed8b2c | 25-May-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: throw an Error in ga_channel_open()
Allow for a single point of error reporting, and further refactoring.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Arm
qga: throw an Error in ga_channel_open()
Allow for a single point of error reporting, and further refactoring.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220525144140.591926-8-marcandre.lureau@redhat.com>
show more ...
|
1a89a17b | 25-May-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: use qga_open_cloexec() for safe_open_or_create()
The function takes care of setting CLOEXEC.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armb
qga: use qga_open_cloexec() for safe_open_or_create()
The function takes care of setting CLOEXEC.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220525144140.591926-7-marcandre.lureau@redhat.com>
show more ...
|
0edbfbe3 | 25-May-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: add qga_open_cloexec() helper
QGA calls qemu_open_old() in various places. Calling qemu_open() instead isn't a great alternative, as it has special "/dev/fdset" handling and depends on QEMU int
qga: add qga_open_cloexec() helper
QGA calls qemu_open_old() in various places. Calling qemu_open() instead isn't a great alternative, as it has special "/dev/fdset" handling and depends on QEMU internal monitor data structures.
Instead, provide a simple helper for QGA needs, with Error* support. The following patches will make use of it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220525144140.591926-6-marcandre.lureau@redhat.com>
show more ...
|
69f56c14 | 25-May-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: flatten safe_open_or_create()
There is a bit too much nesting in the function, this can be simplified a bit to improve readability.
This also helps with the following error handling changes.
qga: flatten safe_open_or_create()
There is a bit too much nesting in the function, this can be simplified a bit to improve readability.
This also helps with the following error handling changes.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220525144140.591926-5-marcandre.lureau@redhat.com>
show more ...
|
b9a00260 | 24-May-2022 |
Konstantin Kostiuk <kkostiuk@redhat.com> |
qga-win32: Add support for NVME bus type
Bus type spaces (Indicates a storage spaces bus) is not supported, so return it as unknown.
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed
qga-win32: Add support for NVME bus type
Bus type spaces (Indicates a storage spaces bus) is not supported, so return it as unknown.
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220524154344.869638-2-kkostiuk@redhat.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
show more ...
|
323f3a8f | 23-May-2022 |
Konstantin Kostiuk <kkostiuk@redhat.com> |
trivial: qga: Log version on start
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220523191644.823726-2-kkostiuk@
trivial: qga: Log version on start
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220523191644.823726-2-kkostiuk@redhat.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
show more ...
|
3569664e | 20-May-2022 |
luzhipeng <luzhipeng@cestc.cn> |
qga: add guest-get-diskstats command for Linux guests
Add a new 'guest-get-diskstats' command for report disk io statistics for Linux guests. This can be useful for getting io flow or handling IO fa
qga: add guest-get-diskstats command for Linux guests
Add a new 'guest-get-diskstats' command for report disk io statistics for Linux guests. This can be useful for getting io flow or handling IO fault, no need to enter guests.
Signed-off-by: luzhipeng <luzhipeng@cestc.cn> Message-Id: <20220520021935.676-1-luzhipeng@cestc.cn> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
show more ...
|
433a4fdc | 22-Apr-2022 |
Markus Armbruster <armbru@redhat.com> |
qapi: Fix malformed "Since:" section tags
"Since X.Y" is not recognized as a tagged section, and therefore not formatted as such in generated documentation. Fix by adding the required colon.
Signe
qapi: Fix malformed "Since:" section tags
"Since X.Y" is not recognized as a tagged section, and therefore not formatted as such in generated documentation. Fix by adding the required colon.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220422132807.1704411-1-armbru@redhat.com> Reviewed-by: Andrea Bolognani <abologna@redhat.com>
show more ...
|
6c1d88c7 | 12-May-2022 |
Konstantin Kostiuk <kkostiuk@redhat.com> |
qga-vss: Use the proper operator to free memory
volume_name_wchar is allocated by 'void* operator new [](long long unsigned int)
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by:
qga-vss: Use the proper operator to free memory
volume_name_wchar is allocated by 'void* operator new [](long long unsigned int)
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220512154909.331481-1-kkostiuk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
580ea136 | 12-May-2022 |
Konstantin Kostiuk <kkostiuk@redhat.com> |
qga-vss: Add auto generated headers to dependencies
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Message-Id: <20220512154906.331399-1-kkostiuk@redhat.com> Signed-off-by: Paolo Bonzini <pb
qga-vss: Add auto generated headers to dependencies
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Message-Id: <20220512154906.331399-1-kkostiuk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
f780a3f4 | 28-Apr-2022 |
Konstantin Kostiuk <kkostiuk@redhat.com> |
qga-vss: always build qga-vss.tlb when qga-vss.dll is built
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Message-Id: <20220428181541.300619-1-kkostiuk@redhat.com> Reviewed-by: Marc-André
qga-vss: always build qga-vss.tlb when qga-vss.dll is built
Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com> Message-Id: <20220428181541.300619-1-kkostiuk@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
22668881 | 20-Apr-2022 |
zhenwei pi <pizhenwei@bytedance.com> |
qga: Introduce disk smart
After assigning a NVMe/SCSI controller to guest by VFIO, we lose everything on the host side. A guest uses these devices exclusively, we usually don't care the actions on t
qga: Introduce disk smart
After assigning a NVMe/SCSI controller to guest by VFIO, we lose everything on the host side. A guest uses these devices exclusively, we usually don't care the actions on these devices. But there is a low probability that hitting physical hardware warning, we need a chance to get the basic smart log info.
Introduce disk smart, and implement NVMe smart on linux.
Thanks to Keith and Marc-André.
CC: Keith Busch <kbusch@kernel.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Message-Id: <20220420022610.418052-3-pizhenwei@bytedance.com>
show more ...
|
d48f61c8 | 20-Apr-2022 |
zhenwei pi <pizhenwei@bytedance.com> |
qga: Introduce NVMe disk bus type
Assigning a NVMe disk by VFIO or emulating a NVMe controller by QEMU, a NVMe disk get exposed in guest side. Support NVMe disk bus type and implement posix version.
qga: Introduce NVMe disk bus type
Assigning a NVMe disk by VFIO or emulating a NVMe controller by QEMU, a NVMe disk get exposed in guest side. Support NVMe disk bus type and implement posix version.
Test PCI passthrough case: ~#virsh qemu-agent-command buster '{"execute":"guest-get-disks"}' | jq ... { "name": "/dev/nvme0n1", "dependencies": [], "partition": false, "address": { "serial": "SAMSUNG MZQL23T8HCLS-00A07_S64HNE0N500076", "bus-type": "nvme", "bus": 0, "unit": 0, "pci-controller": { "bus": 0, "slot": 22, "domain": 0, "function": 0 }, "dev": "/dev/nvme0n1", "target": 0 } ...
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Message-Id: <20220420022610.418052-2-pizhenwei@bytedance.com>
show more ...
|
c8ec041d | 26-Apr-2022 |
Andrew Deason <adeason@sinenomine.net> |
qga/commands-posix: 'guest-shutdown' for Solaris
On Solaris, instead of the -P, -H, and -r flags, we need to provide the target init state to the 'shutdown' command: state 5 is poweroff, 0 is halt,
qga/commands-posix: 'guest-shutdown' for Solaris
On Solaris, instead of the -P, -H, and -r flags, we need to provide the target init state to the 'shutdown' command: state 5 is poweroff, 0 is halt, and 6 is reboot. We also need to pass -g0 to avoid the default 60-second delay, and -y to avoid a confirmation prompt.
Implement this logic under an #ifdef CONFIG_SOLARIS, so the 'guest-shutdown' command works properly on Solaris.
Signed-off-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220426195526.7699-6-adeason@sinenomine.net>
show more ...
|
a539dc8a | 26-Apr-2022 |
Andrew Deason <adeason@sinenomine.net> |
qga/commands-posix: Log all net stats failures
guest_get_network_stats can silently fail in a couple of ways. Add debug messages to these cases, so we're never completely silent on failure.
Signed-
qga/commands-posix: Log all net stats failures
guest_get_network_stats can silently fail in a couple of ways. Add debug messages to these cases, so we're never completely silent on failure.
Signed-off-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220426195526.7699-5-adeason@sinenomine.net>
show more ...
|
70335c46 | 26-Apr-2022 |
Andrew Deason <adeason@sinenomine.net> |
qga/commands-posix: Fix listing ifaces for Solaris
The code for guest-network-get-interfaces needs a couple of small adjustments for Solaris:
- The results from SIOCGIFHWADDR are documented as bein
qga/commands-posix: Fix listing ifaces for Solaris
The code for guest-network-get-interfaces needs a couple of small adjustments for Solaris:
- The results from SIOCGIFHWADDR are documented as being in ifr_addr, not ifr_hwaddr (ifr_hwaddr doesn't exist on Solaris).
- The implementation of guest_get_network_stats is Linux-specific, so hide it under #ifdef CONFIG_LINUX. On non-Linux, we just won't provide network interface stats.
Signed-off-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Message-Id: <20220426195526.7699-4-adeason@sinenomine.net>
show more ...
|
aec0730e | 26-Apr-2022 |
Andrew Deason <adeason@sinenomine.net> |
qga/commands-posix: Fix iface hw address detection
Since its introduction in commit 3424fc9f16a1 ("qemu-ga: add guest-network-get-interfaces command"), guest-network-get-interfaces seems to check if
qga/commands-posix: Fix iface hw address detection
Since its introduction in commit 3424fc9f16a1 ("qemu-ga: add guest-network-get-interfaces command"), guest-network-get-interfaces seems to check if a given interface has a hardware address by checking 'ifa->ifa_flags & SIOCGIFHWADDR'. But ifa_flags is a field for IFF_* flags (IFF_UP, IFF_LOOPBACK, etc), and comparing it to an ioctl like SIOCGIFHWADDR doesn't make sense.
On Linux, this isn't a big deal, since SIOCGIFHWADDR has so many bits set (0x8927), 'ifa->ifa_flags & SIOCGIFHWADDR' will usually have a nonzero result for any 'normal'-looking interfaces: anything with IFF_UP (0x1) or IFF_BROADCAST (0x2) set, as well as several less-common flags. This means we'll try to get the hardware address for most/all interfaces, even those that don't really have one (like the loopback device). For those interfaces, Linux just returns a hardware address of all zeroes.
On Solaris, however, trying to get the hardware address for a loopback device returns an EADDRNOTAVAIL error. This causes us to return an error and the entire guest-network-get-interfaces call fails.
Change this logic to always try to get the hardware address for each interface, and don't return an error if we fail to get it. Instead, just don't include the 'hardware-address' field in the result if we can't get the hardware address.
Signed-off-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Message-Id: <20220426195526.7699-3-adeason@sinenomine.net>
show more ...
|
59e35c7b | 26-Apr-2022 |
Andrew Deason <adeason@sinenomine.net> |
qga/commands-posix: Use getifaddrs when available
Currently, commands-posix.c assumes that getifaddrs() is only available on Linux, and so the related guest agent command guest-network-get-interface
qga/commands-posix: Use getifaddrs when available
Currently, commands-posix.c assumes that getifaddrs() is only available on Linux, and so the related guest agent command guest-network-get-interfaces is only implemented for #ifdef __linux__. This function does exist on other platforms, though, such as Solaris. So, add a meson check for getifaddrs(), and move the code for guest-network-get-interfaces to be built whenever getifaddrs() is available.
The implementation for guest-network-get-interfaces still has some Linux-specific code, which is not fixed in this commit. This commit moves the relevant big chunks of code around without changing them, so a future commit can change the code in place.
Signed-off-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Message-Id: <20220426195526.7699-2-adeason@sinenomine.net>
show more ...
|
ff5927ba | 25-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
util: rename qemu_*block() socket functions
The qemu_*block() functions are meant to be be used with sockets (the win32 implementation expects SOCKET)
Over time, those functions where used with Win
util: rename qemu_*block() socket functions
The qemu_*block() functions are meant to be be used with sockets (the win32 implementation expects SOCKET)
Over time, those functions where used with Win32 SOCKET or file-descriptors interchangeably. But for portability, they must only be used with socket-like file-descriptors. FDs can use g_unix_set_fd_nonblocking() instead.
Rename the functions with "socket" in the name to prevent bad usages.
This is effectively reverting commit f9e8cacc5557e43 ("oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()").
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
b0a8f9ad | 25-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: replace qemu_set_nonblock()
The call is POSIX-specific. Use the dedicated GLib API.
(this is a preliminary patch before renaming qemu_set_nonblock())
Signed-off-by: Marc-André Lureau <marcand
qga: replace qemu_set_nonblock()
The call is POSIX-specific. Use the dedicated GLib API.
(this is a preliminary patch before renaming qemu_set_nonblock())
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
ed78331d | 22-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: replace pipe() with g_unix_open_pipe(CLOEXEC)
Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berran
qga: replace pipe() with g_unix_open_pipe(CLOEXEC)
Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
6e444209 | 20-Apr-2022 |
Paolo Bonzini <pbonzini@redhat.com> |
qga: wixl: get path to sysroot from pkg-config as intended
The .wxs file uses $(var.Mingw_bin) while configure/meson have always used Mingw_dlls. Fix them to match what was probably intended.
Revi
qga: wixl: get path to sysroot from pkg-config as intended
The .wxs file uses $(var.Mingw_bin) while configure/meson have always used Mingw_dlls. Fix them to match what was probably intended.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
55fa0170 | 07-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: use fixed-length and GDateTime for log timestamp
The old code is kind of wrong. Say it's 1649309843.000001 seconds past the epoch. Prints "1649309843.1". 9us later, it prints "1649309843.10". S
qga: use fixed-length and GDateTime for log timestamp
The old code is kind of wrong. Say it's 1649309843.000001 seconds past the epoch. Prints "1649309843.1". 9us later, it prints "1649309843.10". Should really use %06lu for the microseconds part.
Use GDateTime instead, as suggested by Daniel.
Suggested-by: Markus Armbruster <armbru@redhat.com> Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
c267d750 | 20-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: remove need for QEMU atomic.h
Since the introduction of guest-exec in/out/err redirections in commit a1853dca74 ("qga: guest-exec simple stdin/stdout/stderr redirection"), some execution state
qga: remove need for QEMU atomic.h
Since the introduction of guest-exec in/out/err redirections in commit a1853dca74 ("qga: guest-exec simple stdin/stdout/stderr redirection"), some execution state variables are handled with atomic ops. However, there are no threads involved in this code (and glib sources are dispatched in the same thread), and no other obvious reason to use them.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-40-marcandre.lureau@redhat.com>
show more ...
|
1fbf2665 | 20-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
util: replace qemu_get_local_state_pathname()
Simplify the function to only return the directory path. Callers are adjusted to use the GLib function to build paths, g_build_filename().
Signed-off-b
util: replace qemu_get_local_state_pathname()
Simplify the function to only return the directory path. Callers are adjusted to use the GLib function to build paths, g_build_filename().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-39-marcandre.lureau@redhat.com>
show more ...
|