- 18 12月, 2018 1 次提交
-
-
由 Markus Armbruster 提交于
Patch created mechanically by rerunning: $ spatch --sp-file scripts/coccinelle/error_propagate_null.cocci \ --macro-file scripts/cocci-macro-file.h \ --dir . --in-place Whitespace tidied up manually. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NLaurent Vivier <laurent@vivier.eu> Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20181213173113.11211-1-armbru@redhat.com> Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
-
- 31 10月, 2018 3 次提交
-
-
由 Tomáš Golembiovský 提交于
Report device node of the disk on Linux (e.g. "/dev/sda2"). Requirs libudev. Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Tomáš Golembiovský 提交于
Add reporting of disk serial number on Linux guests. The feature depends on libudev. Example: { "name": "dm-2", "mountpoint": "/", ... "disk": [ { "serial": "SAMSUNG_MZ7LN512HCHP-000L1_S1ZKNXAG822493", ... } ], } Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Igor Mammedov 提交于
If VM has VCPUs plugged sparselly (for example a VM started with 3 VCPUs (cpu0, cpu1 and cpu2) and then cpu1 was hotunplugged so only cpu0 and cpu2 are present), QGA will rise a error error: internal error: unable to execute QEMU agent command 'guest-get-vcpus': open("/sys/devices/system/cpu/cpu1/"): No such file or directory when virsh vcpucount FOO --guest is executed. Fix it by ignoring non present CPUs when fetching CPUs status from sysfs. Signed-off-by: NIgor Mammedov <imammedo@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 17 7月, 2018 2 次提交
-
-
由 Paolo Bonzini 提交于
The file descriptor for /sys/power/state was never closed. Reported by Coverity. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Marc-André Lureau 提交于
'driver' is leaked when the loop is not broken. Leak introduced by commit 743c71d0, spotted by ASAN. Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 04 7月, 2018 8 次提交
-
-
由 Daniel Henrique Barboza 提交于
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: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Daniel Henrique Barboza 提交于
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: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Daniel Henrique Barboza 提交于
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: NDaniel Henrique Barboza <danielhb413@gmail.com> *check/propagate local_err before setting errp directly Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Daniel Henrique Barboza 提交于
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: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Daniel Henrique Barboza 提交于
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: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Daniel Henrique Barboza 提交于
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: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Marc-André Lureau 提交于
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=1567041Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NLaszlo Ersek <lersek@redhat.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Chen Hanxiao 提交于
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: NEric Blake <eblake@redhat.com> Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 03 7月, 2018 2 次提交
-
-
由 Prasad J Pandit 提交于
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: NFakhri Zulkifli <mohdfakhrizulkifli@gmail.com> Signed-off-by: NPrasad J Pandit <pjp@fedoraproject.org> Cc: qemu-stable@nongnu.org Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Chen Hanxiao 提交于
If we set mountpoints to qmp_guest_fsfreeze_freeze_list, we may got nothing to freeze as all mountpoints are not valid. So call ga_unset_frozen in this senario. Also, if we return 0 frozen fs, there is no need to call guest-fsfreeze-thaw. Cc: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 02 6月, 2018 1 次提交
-
-
由 Michael S. Tsirkin 提交于
When pulling in headers that are in the same directory as the C file (as opposed to one in include/), we should use its relative path, without a directory. Signed-off-by: NMichael S. Tsirkin <mst@redhat.com> Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
-
- 06 3月, 2018 1 次提交
-
-
由 Julia Suvorova 提交于
basename(3) and dirname(3) modify their argument and may return pointers to statically allocated memory which may be overwritten by subsequent calls. g_path_get_basename and g_path_get_dirname have no such issues, and therefore more preferable. Signed-off-by: NJulia Suvorova <jusual@mail.ru> Message-Id: <1519888086-4207-1-git-send-email-jusual@mail.ru> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NCornelia Huck <cohuck@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 03 3月, 2018 1 次提交
-
-
由 Markus Armbruster 提交于
Move qapi-schema.json to qapi/, so it's next to its modules, and all files get generated to qapi/, not just the ones generated for modules. Consistently name the generated files qapi-MODULE.EXT: qmp-commands.[ch] become qapi-commands.[ch], qapi-event.[ch] become qapi-events.[ch], and qmp-introspect.[ch] become qapi-introspect.[ch]. This gets rid of the temporary hacks in scripts/qapi/commands.py, scripts/qapi/events.py, and scripts/qapi/common.py. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Message-Id: <20180211093607.27351-28-armbru@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NMichael Roth <mdroth@linux.vnet.ibm.com> [eblake: Fix trailing dot in tpm.c, undo temporary hack for OSX toolchain] Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 10 2月, 2018 1 次提交
-
-
由 Philippe Mathieu-Daudé 提交于
Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
-
- 09 2月, 2018 1 次提交
-
-
由 Markus Armbruster 提交于
This cleanup makes the number of objects depending on qapi/error.h drop from 1910 (out of 4743) to 1612 in my "build everything" tree. While there, separate #include from file comment with a blank line, and drop a useless comment on why qemu/osdep.h is included first. Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-5-armbru@redhat.com> [Semantic conflict with commit 34e304e9 resolved, OSX breakage fixed]
-
- 26 10月, 2017 1 次提交
-
-
由 ZhiPeng Lu 提交于
we can get the network interface statistics inside a virtual machine by guest-network-get-interfaces command. it is very useful for us tomonitor and analyze network traffic. Signed-off-by: NZhiPeng Lu <lu.zhipeng@zte.com.cn> * don't rely on sizeof(wchar[]) for wchar[] indexing * avoid camelCase variable names * fix up getline() usage * condensed commit subject line Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 18 7月, 2017 3 次提交
-
-
由 Tomáš Golembiovský 提交于
Add test for guest-get-osinfo command. Qemu-ga was modified to accept QGA_OS_RELEASE environment variable. If the variable is defined it is interpreted as path to the os-release file and it is parsed instead of the default paths. Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com> * move declarations to beginning of functions Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Tomáš Golembiovský 提交于
Add a new 'guest-get-osinfo' command for reporting basic information of the guest operating system. This includes machine architecture, version and release of the kernel and several fields from os-release file if it is present (as defined in [1]). [1] https://www.freedesktop.org/software/systemd/man/os-release.htmlSigned-off-by: NVinzenz Feenstra <vfeenstr@redhat.com> Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com> * moved declarations to beginning of functions * dropped unecessary initialization of struct utsname Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Tomáš Golembiovský 提交于
Commit 161a56a9 added command guest-get-users and requires the utmpx.h (defined by POSIX) to work. It is however not always available (e.g. on OpenBSD) therefor a check for its existence is necessary. Signed-off-by: NTomáš Golembiovský <tgolembi@redhat.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 04 6月, 2017 1 次提交
-
-
由 Marc-André Lureau 提交于
There is no need to duplicate a fixed string. Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 07 5月, 2017 1 次提交
-
-
由 Philippe Mathieu-Daudé 提交于
static code analyzer complain: qga/commands-posix.c:2127:9: warning: Null pointer passed as an argument to a 'nonnull' parameter closedir(dp); ^~~~~~~~~~~~ Reported-by: Clang Static Analyzer Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NMichael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 27 4月, 2017 1 次提交
-
-
由 Vinzenz Feenstra 提交于
A command that will list all currently logged in users, and the time since when they are logged in. Examples: virsh # qemu-agent-command F25 '{ "execute": "guest-get-users" }' {"return":[{"login-time":1490622289.903835,"user":"root"}]} virsh # qemu-agent-command Win2k12r2 '{ "execute": "guest-get-users" }' {"return":[{"login-time":1490351044.670552,"domain":"LADIDA", "user":"Administrator"}]} Signed-off-by: NVinzenz Feenstra <vfeenstr@redhat.com> * make g_hash_table_contains compat func inline to avoid unused warnings Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 31 3月, 2017 1 次提交
-
-
由 Michael Roth 提交于
In some cases the slave devices of a virtual block device are tracked by the parent in the corresponding sysfs node. For instance, if we have a loop-back mount of the form: /dev/loop3p1 on /home/mdroth/mnt type ext4 (rw,relatime,data=ordered) this will be reflected in sysfs as: /sys/devices/virtual/block/loop3/ ... /sys/devices/virtual/block/loop3/slaves /sys/devices/virtual/block/loop3/loop3p1 The current code however assumes the mounted virtual block device, loop3p1 in this case, contains the slaves directory, and reports an error otherwise. This breaks 'make check' in certain environments. Fix this by simply skipping attempts to generate disk topology information in these cases. Since this information is documented in QAPI as optionally-reported, this should be ok from an API perspective. In the future, this can possibly be improved upon by collecting topology information from the parent in these cases. Reported-by: NPeter Maydell <peter.maydell@linaro.org> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com> Tested-by: NPeter Maydell <peter.maydell@linaro.org>
-
- 06 3月, 2017 1 次提交
-
-
由 Peter Lieven 提交于
the current implementation fails if we try to freeze an already frozen filesystem. This can happen if a filesystem is mounted more than once (e.g. with a bind mount). Suggested-by: NChristian Theune <ct@flyingcircus.io> Cc: qemu-stable@nongnu.org Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 20 6月, 2016 1 次提交
-
-
由 Eduardo Habkost 提交于
Use Coccinelle script to replace 'ret = E; return ret' with 'return E'. The script will do the substitution only when the function return type and variable type are the same. Manual fixups: * audio/audio.c: coding style of "read (...)" and "write (...)" * block/qcow2-cluster.c: wrap line to make it shorter * block/qcow2-refcount.c: change indentation of wrapped line * target-tricore/op_helper.c: fix coding style of "remainder|quotient" * target-mips/dsp_helper.c: reverted changes because I don't want to argue about checkpatch.pl * ui/qemu-pixman.c: fix line indentation * block/rbd.c: restore blank line between declarations and statements Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NEduardo Habkost <ehabkost@redhat.com> Message-Id: <1465855078-19435-4-git-send-email-ehabkost@redhat.com> Reviewed-by: NMarkus Armbruster <armbru@redhat.com> [Unused Coccinelle rule name dropped along with a redundant comment; whitespace touched up in block/qcow2-cluster.c; stale commit message paragraph deleted] Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
-
- 07 6月, 2016 2 次提交
-
-
由 Peter Maydell 提交于
Remove glib.h includes, as it is provided by osdep.h. This commit was created with scripts/clean-includes. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NEric Blake <eblake@redhat.com> Tested-by: NEric Blake <eblake@redhat.com> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
由 Michael Tokarev 提交于
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 23 3月, 2016 1 次提交
-
-
由 Veronia Bahaa 提交于
Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qemu-common.h and into new files (e.g. include/qemu/bcd.h) Signed-off-by: NVeronia Bahaa <veroniabahaa@gmail.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 25 2月, 2016 1 次提交
-
-
由 Eric Blake 提交于
Magic constants are a pain to use, especially when we run the risk that our choice of '1' for QGA_SEEK_CUR might differ from the host or guest's choice of SEEK_CUR. Better is to use an enum value, via a qapi alternate type for back-compatibility. With this, {"command":"guest-file-seek", "arguments":{"handle":1, "offset":0, "whence":"cur"}} becomes a synonym for the older {"command":"guest-file-seek", "arguments":{"handle":1, "offset":0, "whence":1}} Signed-off-by: NEric Blake <eblake@redhat.com> Reviewed-by: NMichael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
- 05 2月, 2016 1 次提交
-
-
由 Peter Maydell 提交于
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Message-id: 1454089805-5470-9-git-send-email-peter.maydell@linaro.org
-
- 13 1月, 2016 1 次提交
-
-
由 Markus Armbruster 提交于
Commit 6daf194d, be62a2eb and 312fd5f2 got rid of a bunch, but they keep coming back. Tracked down with the Coccinelle semantic patch from commit 312fd5f2. Cc: Fam Zheng <famz@redhat.com> Cc: Peter Crosthwaite <crosthwaitepeter@gmail.com> Cc: Bharata B Rao <bharata@linux.vnet.ibm.com> Cc: Dominik Dingel <dingel@linux.vnet.ibm.com> Cc: David Hildenbrand <dahi@linux.vnet.ibm.com> Cc: Jason J. Herne <jjherne@linux.vnet.ibm.com> Cc: Stefan Berger <stefanb@linux.vnet.ibm.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: Changchun Ouyang <changchun.ouyang@intel.com> Cc: zhanghailiang <zhang.zhanghailiang@huawei.com> Cc: Pavel Fedin <p.fedin@samsung.com> Signed-off-by: NMarkus Armbruster <armbru@pond.sub.org> Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com> Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com> Acked-by: NBharata B Rao <bharata@linux.vnet.ibm.com> Acked-by: NFam Zheng <famz@redhat.com> Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Message-Id: <1450452927-8346-17-git-send-email-armbru@redhat.com>
-
- 19 12月, 2015 1 次提交
-
-
由 Daniel P. Berrange 提交于
Switch from using g_base64_decode over to qbase64_decode in order to get error checking of the base64 input data. Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 26 11月, 2015 2 次提交
-
-
由 Eric Blake 提交于
Exposing OS-specific SEEK_ constants in our qapi was a mistake (if the host has SEEK_CUR as 1, but the guest has it as 2, then the semantics are unclear what should happen); if we had a time machine, we would instead expose only a symbolic enum. It's too late to change the fact that we have an integer in qapi, but we can at least document what mapping we want to enforce for all qga clients (and luckily, it happens to be the mapping that both Linux and Windows use); then fix the code to match that mapping. It also helps us filter out unsupported SEEK_DATA and SEEK_HOLE. In the future, we may wish to move our QGA_SEEK_* constants into qga/qapi-schema.json, along with updating the schema to take an alternate type (either the integer, or the string value of the enum name) - but that's too much risk during hard freeze. Signed-off-by: NEric Blake <eblake@redhat.com> Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-
由 Marc-André Lureau 提交于
According to the specification: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html "the application shall ensure that output is not directly followed by input without an intervening call to fflush() or to a file positioning function (fseek(), fsetpos(), or rewind()), and input is not directly followed by output without an intervening call to a file positioning function, unless the input operation encounters end-of-file." Without this change, an fwrite() followed by an fread() may lose the previously written content, as shown in the following test. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1210246Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> * don't confuse {write,read}() with f{write,read}() in commit msg (Laszlo) Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
-