Skip to content

Unify memory allocation failure handling

Avi Kivity qemu-devel 1 version Applied

Status from this message: Applied all. Thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6Terminate emulation on memory allocation failureqemu-malloc.c+10 -63 replies
2/6block: remove error handling from qemu_malloc() callersblock-bochs.c block-cloop.c block-dmg.c +7 more+14 -1030 replies
3/6audio: remove error handling from qemu_malloc() callersaudio/audio.c audio/wavcapture.c+8 -200 replies
4/6hw: remove error handling from qemu_malloc() callershw/adlib.c hw/apic.c hw/arm_gic.c +71 more+257 -5450 replies
5/6targets: remove error handling from qemu_malloc() callerstarget-alpha/translate.c target-arm/helper.c target-cris/translate.c +9 more+0 -280 replies
6/6toplevel: remove error handling from qemu_malloc() callersaio.c buffered_file.c console.c +22 more+19 -2360 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchIan Jackson
SeriesA-b
1/6
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/6] Unify memory allocation failure handling

Memory allocation failures are a very rare condition on virtual-memory hosts. They are also very difficult to handle correctly (especially in a hardware emulation context). Because of this, it is better to gracefully terminate emulation rather than executing untested or even unwritten recovery code paths.

This patchset modifies qemu_malloc() and related functions to terminate on error, and updates callers not to perform their own error handling. In many cases error handling was already missing or incorrect.

Avi Kivity (6):
Terminate emulation on memory allocation failure
block: remove error handling from qemu_malloc() callers
audio: remove error handling from qemu_malloc() callers
hw: remove error handling from qemu_malloc() callers
targets: remove error handling from qemu_malloc() callers
toplevel: remove error handling from qemu_malloc() callers

 aio.c                       |    2 -
 audio/audio.c               |   23 +--
 audio/wavcapture.c          |    5 -
 block-bochs.c               |    2 -
 block-cloop.c               |    9 +-
 block-dmg.c                 |    6 +-
 block-parallels.c           |    2 -
 block-qcow2.c               |   58 +------
 block-raw-posix.c           |    2 -
 block-vmdk.c                |   10 -
 block-vpc.c                 |    4 -
 block-vvfat.c               |   18 +-
 block.c                     |    6 -
 buffered_file.c             |    2 -
 console.c                   |   23 ---
 cris-dis.c                  |   26 +--
 curses.c                    |    2 -
 device_tree.c               |    4 -
 exec.c                      |   25 +--
 gdbstub.c                   |    8 -
 hw/adlib.c                  |    7 -
 hw/apic.c                   |    4 -
 hw/arm_gic.c                |    2 -
 hw/arm_sysctl.c             |    2 -
 hw/baum.c                   |   10 -
 hw/cs4231.c                 |    2 -
 hw/cs4231a.c                |    5 -
 hw/ds1225y.c                |    5 -
 hw/eccmemctl.c              |    2 -
 hw/escc.c                   |    4 -
 hw/esp.c                    |    2 -
 hw/etraxfs_dma.c            |    8 -
 hw/etraxfs_eth.c            |    8 -
 hw/etraxfs_pic.c            |    6 -
 hw/etraxfs_ser.c            |    2 -
 hw/etraxfs_timer.c          |    2 -
 hw/fdc.c                    |    6 -
 hw/fmopl.c                  |   27 +---
 hw/fw_cfg.c                 |    8 -
 hw/g364fb.c                 |    2 -
 hw/gus.c                    |   11 -
 hw/i8259.c                  |    2 -
 hw/ide.c                    |    2 -
 hw/integratorcp.c           |    2 -
 hw/iommu.c                  |    2 -
 hw/jazz_led.c               |    2 -
 hw/m48t59.c                 |    6 -
 hw/mac_dbdma.c              |    2 -
 hw/mac_nvram.c              |    6 -
 hw/mc146818rtc.c            |    4 -
 hw/mipsnet.c                |    2 -
 hw/mpcore.c                 |    2 -
 hw/mst_fpga.c               |    2 -
 hw/musicpal.c               |   14 --
 hw/ne2000.c                 |    2 -
 hw/parallel.c               |    4 -
 hw/pci.c                    |    2 -
 hw/pcnet.c                  |    2 -
 hw/pflash_cfi01.c           |    2 -
 hw/pflash_cfi02.c           |    2 -
 hw/pl031.c                  |    2 -
 hw/ppc.c                    |    7 -
 hw/ppc405_boards.c          |   24 +--
 hw/ppc405_uc.c              |  422 ++++++++++++++++++++-----------------------
 hw/ppc440_bamboo.c          |    2 -
 hw/ppc4xx_devs.c            |   72 ++++----
 hw/ppc4xx_pci.c             |    2 -
 hw/ppc_prep.c               |    2 -
 hw/r2d.c                    |    2 -
 hw/rc4030.c                 |    2 -
 hw/sb16.c                   |    5 -
 hw/sbi.c                    |    2 -
 hw/serial.c                 |    4 -
 hw/sh_intc.c                |    4 +-
 hw/sh_serial.c              |    2 -
 hw/slavio_intctl.c          |    4 -
 hw/slavio_misc.c            |    2 -
 hw/slavio_timer.c           |    2 -
 hw/sparc32_dma.c            |    2 -
 hw/sun4c_intctl.c           |    2 -
 hw/tcx.c                    |    2 -
 hw/usb-bt.c                 |    2 -
 hw/usb-hid.c                |    6 -
 hw/usb-hub.c                |    2 -
 hw/usb-msd.c                |    2 -
 hw/usb-net.c                |    2 -
 hw/usb-serial.c             |    2 -
 hw/usb-uhci.c               |   15 +-
 hw/usb-wacom.c              |    2 -
 hw/versatilepb.c            |    2 -
 hw/vga.c                    |    4 -
 hw/virtio-blk.c             |    3 +-
 hw/virtio.c                 |    3 +-
 hw/vmmouse.c                |    2 -
 keymaps.c                   |   10 +-
 kvm-all.c                   |    7 -
 loader.c                    |    4 -
 migration-exec.c            |    5 -
 migration-tcp.c             |    2 -
 monitor.c                   |    4 -
 net.c                       |   14 --
 qemu-char.c                 |   59 ------
 qemu-malloc.c               |   16 +-
 qemu-nbd.c                  |    2 -
 qemu-tool.c                 |    6 +-
 readline.c                  |    2 -
 savevm.c                    |   19 --
 sdl.c                       |    2 -
 target-alpha/translate.c    |    2 -
 target-arm/helper.c         |    4 -
 target-cris/translate.c     |    2 -
 target-i386/helper.c        |    2 -
 target-i386/kvm.c           |    2 -
 target-m68k/helper.c        |    2 -
 target-mips/translate.c     |    2 -
 target-ppc/helper.c         |    2 -
 target-ppc/kvm_ppc.c        |    4 -
 target-ppc/translate_init.c |    2 -
 target-sh4/translate.c      |    2 -
 target-sparc/helper.c       |    2 -
 usb-bsd.c                   |    2 -
 usb-linux.c                 |   24 +---
 vl.c                        |   16 --
 vnc.c                       |    9 +-
 124 files changed, 314 insertions(+), 956 deletions(-)