qemu/qga
Michael Roth 39097daf15 qemu-ga: use key-value store to avoid recycling fd handles after restart
Hosts hold on to handles provided by guest-file-open for periods that can
span beyond the life of the qemu-ga process that issued them. Since these
are issued starting from 0 on every restart, we run the risk of issuing
duplicate handles after restarts/reboots.

As a result, users with a stale copy of these handles may end up
reading/writing corrupted data due to their existing handles effectively
being re-assigned to an unexpected file or offset.

We unfortunately do not issue handles as strings, but as integers, so a
solution such as using UUIDs can't be implemented without introducing a
new interface.

As a workaround, we fix this by implementing a persistent key-value store
that will be used to track the value of the last handle that was issued
across restarts/reboots to avoid issuing duplicates.

The store is automatically written to the same directory we currently
set via --statedir to track fsfreeze state, and so should be applicable
for stable releases where this flag is supported.

A follow-up can use this same store for handling fsfreeze state, but
that change is cosmetic and left out for now.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: qemu-stable@nongnu.org

* fixed guest_file_handle_add() return value from uint64_t to int64_t
2013-03-11 18:53:47 -05:00
..
channel-posix.c qemu-ga: Handle errors uniformely in ga_channel_open() 2013-01-14 12:08:05 -06:00
channel-win32.c qemu-ga: fix confusing GAChannelMethod comparison 2013-03-11 18:53:46 -05:00
channel.h
commands-posix.c qemu-ga: use key-value store to avoid recycling fd handles after restart 2013-03-11 18:53:47 -05:00
commands-win32.c qapi: move include files to include/qobject/ 2012-12-19 08:31:31 +01:00
commands.c qemu-ga: Fix unchecked strdup() by converting to g_strdup() 2013-01-30 11:14:46 +01:00
guest-agent-command-state.c
guest-agent-core.h qemu-ga: use key-value store to avoid recycling fd handles after restart 2013-03-11 18:53:47 -05:00
main.c qemu-ga: use key-value store to avoid recycling fd handles after restart 2013-03-11 18:53:47 -05:00
Makefile.objs qemu-ga: move qemu-ga files to qga/ 2012-12-19 08:31:30 +01:00
qapi-schema.json qga: add missing commas in json docs 2013-01-14 16:15:26 -06:00
service-win32.c qga: cast to int for DWORD type 2013-03-11 18:53:46 -05:00
service-win32.h