]> git.proxmox.com Git - mirror_qemu.git/commit - include/hw/loader.h
loader: add rom transaction API
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 16 Aug 2018 13:05:28 +0000 (14:05 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 16 Aug 2018 13:05:28 +0000 (14:05 +0100)
commite2336043cc40eafc302c5ea8fa1d5c01438c06bb
treed589482e4c455931bb5fe845209d2678839c9116
parente7f59933548097dbb2272c49f2e0a4ece92697ff
loader: add rom transaction API

Image file loaders may add a series of roms.  If an error occurs partway
through loading there is no easy way to drop previously added roms.

This patch adds a transaction mechanism that works like this:

  rom_transaction_begin();
  ...call rom_add_*()...
  rom_transaction_end(ok);

If ok is false then roms added in this transaction are dropped.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20180814162739.11814-5-stefanha@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/core/loader.c
include/hw/loader.h