ae7da1e5 | 19-Jul-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: process_event() simplification and leak fix
json_parser_parse_err() may return something else than a QDict, in which case we loose the object. Let's keep track of the original object to avoid l
qga: process_event() simplification and leak fix
json_parser_parse_err() may return something else than a QDict, in which case we loose the object. Let's keep track of the original object to avoid leaks.
When an error occurs, "qdict" contains the response, but we still check the "execute" key there. Untangle a bit this code, by having a clear error path.
CC: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
d9c745c1 | 15-Jul-2018 |
Paolo Bonzini <pbonzini@redhat.com> |
qga: fix file descriptor leak
The file descriptor for /sys/power/state was never closed. Reported by Coverity.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daud
qga: fix file descriptor leak
The file descriptor for /sys/power/state was never closed. Reported by Coverity.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
d43b1694 | 03-Jul-2018 |
Markus Armbruster <armbru@redhat.com> |
qmp: Use QDict * instead of QObject * for response objects
By using the more specific type, we get fewer downcasts. The downcasts are safe, but not obviously so, at least not locally.
Signed-off-b
qmp: Use QDict * instead of QObject * for response objects
By using the more specific type, we get fewer downcasts. The downcasts are safe, but not obviously so, at least not locally.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180703085358.13941-24-armbru@redhat.com>
show more ...
|
73e1d8eb | 21-Jun-2018 |
Daniel Henrique Barboza <danielhb413@gmail.com> |
qga: removing bios_supports_mode
bios_support_mode verifies if the guest has support for a certain suspend mode but it doesn't inform back which suspend tool provides it. The caller, guest_suspend,
qga: removing bios_supports_mode
bios_support_mode verifies if the guest has support for a certain suspend mode but it doesn't inform back which suspend tool provides it. The caller, guest_suspend, executes all suspend strategies in order again.
After adding systemd suspend support, bios_support_mode now will verify for support for systemd, then pmutils, then Linux sys state file. In a worst case scenario where both systemd and pmutils isn't supported but Linux sys state is:
- bios_supports_mode will check for systemd, then pmutils, then Linux sys state. It will tell guest_suspend that there is support, but it will not tell who provides it;
- guest_suspend will try to execute (and fail) systemd suspend, then pmutils suspend, to only then use the Linux sys suspend. The time spent executing systemd and pmutils suspend was wasted and could be avoided, but only bios_support_mode knew it but didn't inform it back.
A quicker approach is to nuke bios_supports_mode and control whether we found support at all with a bool flag inside guest_suspend. guest_suspend will search for suspend support and execute it as soon as possible. If the a given suspend mechanism fails, continue to the next. If no suspend support is found, the "not supported" message is still being sent back to the user.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
067927d6 | 21-Jun-2018 |
Daniel Henrique Barboza <danielhb413@gmail.com> |
qga: systemd hibernate/suspend/hybrid-sleep support
pmutils isn't being supported by newer OSes like Fedora 27 or Mint. This means that the only suspend option QGA offers for these guests are writin
qga: systemd hibernate/suspend/hybrid-sleep support
pmutils isn't being supported by newer OSes like Fedora 27 or Mint. This means that the only suspend option QGA offers for these guests are writing directly into the Linux sys state file. This also means that QGA also loses the ability to do hybrid suspend in those guests - this suspend mode is only available when using pmutils.
Newer guests can use systemd facilities to do all the suspend types QGA supports. The mapping in comparison with pmutils is:
- pm-hibernate -> systemctl hibernate - pm-suspend -> systemctl suspend - pm-suspend-hybrid -> systemctl hybrid-sleep
To discover whether systemd supports these functions, we inspect the status of the services that implements them.
With this patch, we can offer hybrid suspend again for newer guests that do not have pmutils support anymore.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
8b020b5e | 21-Jun-2018 |
Daniel Henrique Barboza <danielhb413@gmail.com> |
qga: removing switch statements, adding run_process_child
This is a cleanup of the resulting code after detaching pmutils and Linux sys state file logic:
- remove the SUSPEND_MODE_* macros and use
qga: removing switch statements, adding run_process_child
This is a cleanup of the resulting code after detaching pmutils and Linux sys state file logic:
- remove the SUSPEND_MODE_* macros and use an enumeration instead. At the same time, drop the switch statements at the start of each function and use the enumeration index to get the right binary/argument;
- create a new function called run_process_child(). This function uses g_spawn_sync() to execute a shell command, returning the exit code. This is a common operation in the pmutils functions and will be used in the systemd implementation as well, so this function will avoid code repetition.
There are more places inside commands-posix.c where this new run_process_child function can also be used, but one step at a time.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> *check/propagate local_err before setting errp directly Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
246d76eb | 21-Jun-2018 |
Daniel Henrique Barboza <danielhb413@gmail.com> |
qga: guest_suspend: decoupling pm-utils and sys logic
Following the same logic of the previous patch, let's also decouple the suspend logic from guest_suspend into specialized functions, one for eac
qga: guest_suspend: decoupling pm-utils and sys logic
Following the same logic of the previous patch, let's also decouple the suspend logic from guest_suspend into specialized functions, one for each strategy we support at this moment.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
a5fcf0e3 | 21-Jun-2018 |
Daniel Henrique Barboza <danielhb413@gmail.com> |
qga: bios_supports_mode: decoupling pm-utils and sys logic
In bios_supports_mode there is a verification to assert if the chosen suspend mode is supported by the pmutils tools and, if not, we see if
qga: bios_supports_mode: decoupling pm-utils and sys logic
In bios_supports_mode there is a verification to assert if the chosen suspend mode is supported by the pmutils tools and, if not, we see if the Linux sys state files supports it.
This verification is done in the same function, one after the other, and it works for now. But, when adding a new suspend mechanism that will not necessarily follow the same return 0 or 1 logic of pmutils, this code will be hard to deal with.
This patch decouple the two existing logics into their own functions, pmutils_supports_mode and linux_sys_state_supports_mode, which in turn are used inside bios_support_mode. The existing logic is kept but now it's easier to extend it.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
304a0fcb | 21-Jun-2018 |
Daniel Henrique Barboza <danielhb413@gmail.com> |
qga: refactoring qmp_guest_suspend_* functions
To be able to add new suspend mechanisms we need to detach the existing QMP functions from the current implementation specifics.
At this moment we hav
qga: refactoring qmp_guest_suspend_* functions
To be able to add new suspend mechanisms we need to detach the existing QMP functions from the current implementation specifics.
At this moment we have functions such as qmp_guest_suspend_ram calling bios_suspend_mode and guest_suspend passing the pmutils command and arguments as parameters. This patch removes this logic from the QMP functions, moving them to the respective functions that will have to deal with which binary to use.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
743c71d0 | 14-May-2018 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qemu-ga: make get-fsinfo work over pci bridges
Iterate over the PCI bridges to lookup the PCI device associated with the block device.
This allows to lookup the driver under the following syspath:
qemu-ga: make get-fsinfo work over pci bridges
Iterate over the PCI bridges to lookup the PCI device associated with the block device.
This allows to lookup the driver under the following syspath: /sys/devices/pci0000:00/0000:00:02.2/0000:03:00.0/virtio2/block/vda/vda3
It also works with an "old-style" Q35 libvirt hierarchy: root complex -> DMI-PCI bridge -> PCI-PCI bridge -> virtio controller, ex: /sys/devices/pci0000:00/0000:00:03.0/0000:01:01.0/0000:02:01.0/virtio1/block/vda/vda3
The setup can be reproduced with the following qemu command line (Thanks Marcel for help):
qemu-system-x86_64 -M q35 \ -device i82801b11-bridge,id=dmi2pci_bridge,bus=pcie.0 -device pci-bridge,id=pci_bridge,bus=dmi2pci_bridge,addr=0x1,chassis_nr=1 -device virtio-blk-pci,scsi=off,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,bus=pci_bridge,addr=0x1
For consistency with other syspath-related debug messages, replace a \"%s\" in the message with '%s'.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1567041
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
a972304d | 28-Jun-2018 |
Bishara AbuHattoum <bishara@daynix.com> |
qga-win: Fixing msi upgrade disallow in WiX file
Issue: When upgrading qemu-ga using the msi from an old version to a newer one, the upgrade is not allowed by the msi showing this erro
qga-win: Fixing msi upgrade disallow in WiX file
Issue: When upgrading qemu-ga using the msi from an old version to a newer one, the upgrade is not allowed by the msi showing this error message "Another version of this product is already installed."
BZ# 1536331: https://bugzilla.redhat.com/show_bug.cgi?id=1536331
Fix: For the upgrade to be allowed by the msi the WiX file must provide three things: 1. Changing product's Id. (assigning it to "*") 2. Constant product's UpgradeId. (exists) 3. Changing version. (exists)
Reference: http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html
Signed-off-by: Bishara AbuHattoum <bishara@daynix.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
84ece8ef | 20-Apr-2018 |
Tomáš Golembiovský <tgolembi@redhat.com> |
qga/schema: fix documentation for GuestOSInfo
The documentation for kernel-version and kernel-release on Windows was swapped.
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> Reviewed-by: Ma
qga/schema: fix documentation for GuestOSInfo
The documentation for kernel-version and kernel-release on Windows was swapped.
Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
c07e5e6e | 14-Jun-2018 |
Chen Hanxiao <chenhanxiao@gmail.com> |
qga-win: add driver path usage to GuestFilesystemInfo
This patch adds support for getting the usage of windows driver path. The usage of fs stored as used_bytes and total_bytes.
Cc: Michael Roth <m
qga-win: add driver path usage to GuestFilesystemInfo
This patch adds support for getting the usage of windows driver path. The usage of fs stored as used_bytes and total_bytes.
Cc: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
25b5ff1a | 14-Jun-2018 |
Chen Hanxiao <chenhanxiao@gmail.com> |
qga: add mountpoint usage info to GuestFilesystemInfo
This patch adds support for getting the usage of mounted filesystem. The usage of fs stored as used_bytes and total_bytes. It's very useful when
qga: add mountpoint usage info to GuestFilesystemInfo
This patch adds support for getting the usage of mounted filesystem. The usage of fs stored as used_bytes and total_bytes. It's very useful when we try to monitor guest's filesystem.
Cc: Michael Roth <mdroth@linux.vnet.ibm.com> Cc: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
141b1974 | 13-Jun-2018 |
Prasad J Pandit <pjp@fedoraproject.org> |
qga: check bytes count read by guest-file-read
While reading file content via 'guest-file-read' command, 'qmp_guest_file_read' routine allocates buffer of count+1 bytes. It could overflow for large
qga: check bytes count read by guest-file-read
While reading file content via 'guest-file-read' command, 'qmp_guest_file_read' routine allocates buffer of count+1 bytes. It could overflow for large values of 'count'. Add check to avoid it.
Reported-by: Fakhri Zulkifli <mohdfakhrizulkifli@gmail.com> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|