QEMU With E2K User Support
Go to file
Markus Armbruster 3ae59580a0 block: Keep DriveInfo alive until BlockDriverState dies
If the BDS's refcnt > 0, drive_del() destroys the DriveInfo, but not
the BDS.  This can happen in three places:

* Device model destruction during unplug: blockdev_auto_del()

* Xen IDE unplug: pci_piix3_xen_ide_unplug()

* drive_del command when no device model is attached: do_drive_del()

The other callers of drive_del are on error paths where refcnt == 1.

If the user somehow manages to plug in a device model using a BDS that
has gone through drive_del(), the legacy configuration passed in
DriveInfo doesn't reach the device model, and automatic deletion on
unplug doesn't work.  Worse, some device models such as scsi-disk
crash when DriveInfo doesn't exist.

This is theoretical; I didn't research an actual reproducer. The problem
was introduced when we replaced DriveInfo reference counting by BDS
reference counting in commit a94a3fa..fa510eb.

Fix by keeping DriveInfo alive until its BDS dies.

This affects qemu_drive_opts: now you can't reuse the same ID for new
drive options until the BDS dies.  Before, you could, but since the
code always attempts to create a BDS with the same ID next, the
enclosing operation "create a new drive" failed anyway.  Different
error path, same result.

Unfortunately, the fix involves use of blockdev.c stuff from block.c,
which is a layering violation.  Fortunately, my forthcoming
BlockBackend work will get rid of it again.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-25 15:24:14 +02:00
audio
backends pci, pc, virtio, misc bugfixes 2014-09-18 20:02:01 +01:00
block blkdebug: show an error for invalid event names 2014-09-25 15:24:14 +02:00
bsd-user
default-configs PPC: Fix default config ordering and add eTSEC for ppc64 2014-09-08 12:50:54 +02:00
disas disas/libvixl: Update to upstream VIXL 1.5 2014-08-29 15:00:27 +01:00
docs -----BEGIN PGP SIGNATURE----- 2014-09-23 12:08:55 +01:00
dtc@bc895d6d09
fpu
fsdev
gdb-xml s390x/gdb: add the feature xml files for s390x 2014-09-01 09:45:19 +02:00
hw tcx: Implement hardware acceleration 2014-09-24 13:45:13 +01:00
include block: Keep DriveInfo alive until BlockDriverState dies 2014-09-25 15:24:14 +02:00
libcacard Fix typos and misspellings in comments 2014-09-20 17:55:53 +04:00
libdecnumber libdecnumber: Fix warnings from smatch (missing static, boolean operations) 2014-08-24 13:21:06 +04:00
linux-headers virtio: Import virtio_vring.h 2014-09-22 11:39:49 +01:00
linux-user exec.c: Relax restrictions on watchpoint length and alignment 2014-09-12 14:06:48 +01:00
net Net patches 2014-09-04 17:39:07 +01:00
pc-bios pc-bios/s390-ccw.img binary update 2014-09-01 09:23:02 +02:00
pixman@87eea99e44 pixman: update internal copy to pixman-0.32.6 2014-09-15 08:14:19 +02:00
po po: Fix Makefile rules for in-tree builds without configuration 2014-08-24 13:16:42 +04:00
qapi block: delete cow block driver 2014-09-22 11:39:45 +01:00
qga channel-posix: using qemu_set_nonblock() instead of fcntl(O_NONBLOCK) 2014-08-15 18:03:13 +01:00
qobject
qom cpu-exec: Make debug_excp_handler a QOM CPU method 2014-09-12 14:06:48 +01:00
roms Update OpenBIOS images 2014-08-26 13:52:15 +01:00
scripts qapi: Allow enums in anonymous unions 2014-09-22 11:39:33 +01:00
slirp slirp: udp: fix NULL pointer dereference because of uninitialized socket 2014-09-23 19:15:05 +01:00
stubs block: Keep DriveInfo alive until BlockDriverState dies 2014-09-25 15:24:14 +02:00
sysconfigs/target
target-alpha trace: [tcg] Include TCG-tracing header on all targets 2014-08-12 14:26:12 +01:00
target-arm target-arm: Make *IS TLB maintenance ops affect all CPUs 2014-09-12 14:06:50 +01:00
target-cris trace: [tcg] Include TCG-tracing header on all targets 2014-08-12 14:26:12 +01:00
target-i386 cpu-exec: Make debug_excp_handler a QOM CPU method 2014-09-12 14:06:48 +01:00
target-lm32 cpu-exec: Make debug_excp_handler a QOM CPU method 2014-09-12 14:06:48 +01:00
target-m68k trace: [tcg] Include TCG-tracing header on all targets 2014-08-12 14:26:12 +01:00
target-microblaze trace: [tcg] Include TCG-tracing header on all targets 2014-08-12 14:26:12 +01:00
target-mips trace: [tcg] Include TCG-tracing header on all targets 2014-08-12 14:26:12 +01:00
target-moxie
target-openrisc trace: [tcg] Include TCG-tracing header on all targets 2014-08-12 14:26:12 +01:00
target-ppc target-ppc: Implement mulldo with TCG 2014-09-08 12:50:53 +02:00
target-s390x s390x/css: support format-0 ccws 2014-09-23 14:10:17 +02:00
target-sh4 trace: [tcg] Include TCG-tracing header on all targets 2014-08-12 14:26:12 +01:00
target-sparc target-sparc64: implement Short Floating-Point Store Instructions 2014-08-17 13:24:27 +01:00
target-tricore target-tricore: Add instructions of SR opcode format 2014-09-01 14:49:21 +01:00
target-unicore32 trace: [tcg] Include TCG-tracing header on all targets 2014-08-12 14:26:12 +01:00
target-xtensa cpu-exec: Make debug_excp_handler a QOM CPU method 2014-09-12 14:06:48 +01:00
tcg tcg: dump op count into qemu log 2014-08-24 13:16:32 +04:00
tests async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
trace trace: Only link generated-tracers.o with "simple" backend 2014-09-09 13:13:05 +02:00
ui block: delete cow block driver 2014-09-22 11:39:45 +01:00
util util/qemu-sockets.c: Support specifying IPv4 or IPv6 in socket_dgram() 2014-09-16 23:36:32 +01:00
.exrc
.gitignore trace: [tcg] Generate TCG tracing routines 2014-08-12 14:26:12 +01:00
.gitmodules
.mailmap
.travis.yml
aio-posix.c AioContext: introduce aio_prepare 2014-08-29 10:46:58 +01:00
aio-win32.c aio-win32: avoid out-of-bounds access to the events array 2014-09-22 11:39:21 +01:00
arch_init.c target-tricore: Add target stubs and qom-cpu 2014-09-01 14:49:20 +01:00
async.c async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
balloon.c
block-migration.c block: Use g_new() & friends where that makes obvious sense 2014-08-20 11:51:28 +02:00
block.c block: Keep DriveInfo alive until BlockDriverState dies 2014-09-25 15:24:14 +02:00
blockdev-nbd.c block: Use g_new() & friends where that makes obvious sense 2014-08-20 11:51:28 +02:00
blockdev.c block: Keep DriveInfo alive until BlockDriverState dies 2014-09-25 15:24:14 +02:00
blockjob.c coroutine: Drop co_sleep_ns 2014-08-29 10:46:58 +01:00
bt-host.c
bt-vhci.c
Changelog
CODING_STYLE CODING_STYLE: Section about conditional statement 2014-08-15 18:54:06 +04:00
configure -----BEGIN PGP SIGNATURE----- 2014-09-23 12:08:55 +01:00
COPYING
COPYING.LIB
coroutine-gthread.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
cpu-exec.c cpu-exec: Make debug_excp_handler a QOM CPU method 2014-09-12 14:06:48 +01:00
cpus.c cpu: init vmstate for ticks and clock offset 2014-09-11 12:20:32 +02:00
cputlb.c implementing victim TLB for QEMU system emulated TLB 2014-09-01 17:43:06 +01:00
device_tree.c device_tree.c: dump all err mesages with error_report 2014-09-02 22:38:16 +04:00
device-hotplug.c
disas.c
dma-helpers.c block: Rename qemu_aio_release -> qemu_aio_unref 2014-09-22 11:39:17 +01:00
dump.c dump.c: Fix memory leak issue in cleanup processing for dump_init() 2014-08-18 14:39:10 -04:00
exec.c exec.c: fix setting 1-byte-long watchpoints 2014-09-19 17:42:16 +01:00
gdbstub.c gdbstub: init mon_chr through qemu_chr_alloc 2014-09-11 12:20:33 +02:00
HACKING
hmp-commands.hx cpus: Define callback for QEMU "nmi" command 2014-08-25 13:25:16 +02:00
hmp.c hmp: fix memory leak at hmp_info_block_jobs() 2014-09-22 11:39:31 +01:00
hmp.h
iohandler.c
ioport.c memory: convert memory_region_destroy to object_unparent 2014-08-18 12:06:20 +02:00
iothread.c async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
kvm-all.c - Memory: improve error reporting and avoid crashes on hotplug 2014-09-12 16:55:49 +01:00
kvm-stub.c
LICENSE
main-loop.c async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
MAINTAINERS MAINTAINERS: update sheepdog maintainer 2014-09-08 11:12:43 +01:00
Makefile Tracing pull request 2014-08-15 16:37:17 +01:00
Makefile.objs Tracing pull request 2014-08-15 16:37:17 +01:00
Makefile.target trace: [tcg] Define TCG tracing helper routines 2014-08-12 14:26:12 +01:00
memory_mapping.c
memory.c memory: add parameter errp to memory_region_init_rom_device 2014-09-09 13:41:44 +02:00
migration-exec.c
migration-fd.c
migration-rdma.c rdma: Fix incorrect description in comments 2014-09-20 17:55:53 +04:00
migration-tcp.c
migration-unix.c
migration.c
module-common.c
monitor.c monitor: fix debug print compiling error 2014-09-12 11:01:50 -04:00
nbd.c nbd: Follow the BDS' AIO context 2014-08-29 10:48:45 +01:00
numa.c memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
os-posix.c
os-win32.c
page_cache.c
qapi-schema.json cpus: Define callback for QEMU "nmi" command 2014-08-25 13:25:16 +02:00
qdev-monitor.c qdev-monitor: fix segmentation fault on qdev_device_help() 2014-09-22 11:39:18 +01:00
qdict-test-data.txt
qemu-bridge-helper.c
qemu-char.c qemu-char: Permit only a single "stdio" character device 2014-09-20 17:55:53 +04:00
qemu-coroutine-io.c qemu-coroutine-io: fix for Win32 2014-08-29 10:46:58 +01:00
qemu-coroutine-lock.c
qemu-coroutine-sleep.c coroutine: Drop co_sleep_ns 2014-08-29 10:46:58 +01:00
qemu-coroutine.c coroutine: make pool size dynamic 2014-08-15 15:07:14 +02:00
qemu-doc.texi block: delete cow block driver 2014-09-22 11:39:45 +01:00
qemu-file.c
qemu-img-cmds.hx qemu-img: Allow cache mode specification for amend 2014-08-22 14:54:48 +02:00
qemu-img.c async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
qemu-img.texi block: delete cow block driver 2014-09-22 11:39:45 +01:00
qemu-io-cmds.c qemu-io-cmds: g_renew() can't fail, bury dead error handling 2014-08-20 11:51:28 +02:00
qemu-io.c async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
qemu-log.c
qemu-nbd.c async: aio_context_new(): Handle event_notifier_init failure 2014-09-22 11:39:48 +01:00
qemu-nbd.texi
qemu-options-wrapper.h
qemu-options.h
qemu-options.hx pci, pc fixes, features 2014-09-02 16:07:31 +01:00
qemu-seccomp.c seccomp: add semctl() to the syscall whitelist 2014-08-21 10:29:16 +02:00
qemu-tech.texi
qemu-timer.c
qemu.nsi
qemu.sasl
qmp-commands.hx block: delete cow block driver 2014-09-22 11:39:45 +01:00
qmp.c qmp: hide "hotplugged" device property from device-list-properties 2014-08-15 15:07:13 +02:00
qtest.c icount: Add QemuOpts for icount 2014-08-06 17:53:07 +02:00
README
rules.mak Fix cross compilation (nm command) 2014-09-19 17:20:11 +01:00
savevm.c
softmmu_template.h implementing victim TLB for QEMU system emulated TLB 2014-09-01 17:43:06 +01:00
spice-qemu-char.c qemu-char: Rename register_char_driver_qapi() to register_char_driver() 2014-09-16 23:36:32 +01:00
tcg-runtime.c
tci.c
thread-pool.c block: Rename qemu_aio_release -> qemu_aio_unref 2014-09-22 11:39:17 +01:00
thunk.c
tpm.c
trace-events ohci: Convert fprint/DPRINTF/print to traces 2014-09-23 12:51:06 +02:00
translate-all.c trace: add some tcg tracing support 2014-08-12 14:26:12 +01:00
translate-all.h
user-exec.c
VERSION Open 2.2 development tree 2014-08-01 18:30:08 +01:00
version.rc
vl.c -----BEGIN PGP SIGNATURE----- 2014-09-23 12:08:55 +01:00
vmstate.c
xbzrle.c
xen-common-stub.c
xen-common.c
xen-hvm-stub.c
xen-hvm.c xen-hvm.c: Always return -1 when failure occurs in xen_hvm_init() 2014-09-20 17:55:53 +04:00
xen-mapcache.c xen: build on ARM 2014-07-07 10:37:40 +00:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team