All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 0/7] qdev and blockdev refcount leak fixes
Date: Wed, 30 Oct 2013 16:44:18 +0100	[thread overview]
Message-ID: <52712952.8010203@suse.de> (raw)
In-Reply-To: <1383141276-19230-1-git-send-email-stefanha@redhat.com>

Am 30.10.2013 14:54, schrieb Stefan Hajnoczi:
> v3:
>  * I lost track of this patch, now I'm pushing it again

Part of this series is in a pending qom-next pull of mine (on a
different base), which Anthony didn't merge due to some questions or
problems, and during Hackathon he disappeared and so far hasn't followed
up further. :(

I can surely send a rebased PULL v2 now that the block fix I think is
in, but not sure if that is all to do...

Regards,
Andreas

>  * Rebase onto qemu.git/master
>  * Add Patch 7 to do s/qdev_free()/object_unparent()/ [afaerber]
> 
> It started with a bug report along these lines:
> 
>   (qemu) device_add virtio-blk-pci,drive=drive0,x-data-plane=on
>   device is incompatible with x-data-plane, use scsi=off
>   Device initialization failed.
>   Device initialization failed.
>   Device 'virtio-blk-pci' could not be initialized
>   (qemu) drive_del drive0
>   (qemu) drive_add 0 if=none,id=drive0
>   Duplicate ID 'drive0' for drive
> 
> The drive_add command should succeed since the old "drive0" was deleted.
> 
> With the help of Andreas and Paolo we figured out that the problem is not
> virtio-blk or dataplane.  There are actually two problems:
> 
> 1. qdev_device_add() must release its DeviceState reference if
>    qdev_init() failed.
> 
> 2. blockdev_init() must release its QemuOpts on failure or early return when no
>    file= option was specified.
> 
> This series fixes these problems and then qtest test cases for both bugs.  In
> order to do this we need to add QMP response objects to the libqtest API, which
> currently discards QMP responses.
> 
> Patches 1 & 2 fix the leaks.
> Patches 2 & 3 add QMP response objects to libqtest.
> Patches 5 & 6 add qtest test cases for the bugs.
> Patch 7 replaces the confusing qdev_free() function with object_unparent()
> 
> Stefan Hajnoczi (7):
>   blockdev: fix drive_init() opts and bs_opts leaks
>   qdev: unref qdev when device_add fails
>   libqtest: rename qmp() to qmp_discard_response()
>   libqtest: add qmp(fmt, ...) -> QDict* function
>   blockdev-test: add test case for drive_add duplicate IDs
>   qdev-monitor-test: add device_add leak test cases
>   qdev: drop misleading qdev_free() function
> 
>  blockdev.c                | 27 +++++++++-------
>  hw/acpi/piix4.c           |  2 +-
>  hw/core/qdev.c            | 12 ++-----
>  hw/pci/pci-hotplug-old.c  |  2 +-
>  hw/pci/pci_bridge.c       |  2 +-
>  hw/pci/pcie.c             |  2 +-
>  hw/pci/shpc.c             |  2 +-
>  hw/s390x/virtio-ccw.c     |  2 +-
>  hw/scsi/scsi-bus.c        |  6 ++--
>  hw/usb/bus.c              |  7 ++--
>  hw/usb/dev-storage.c      |  2 +-
>  hw/usb/host-legacy.c      |  2 +-
>  hw/virtio/virtio-bus.c    |  4 +--
>  hw/xen/xen_platform.c     |  2 +-
>  include/hw/qdev-core.h    |  1 -
>  qdev-monitor.c            |  6 ++--
>  tests/Makefile            |  4 +++
>  tests/blockdev-test.c     | 59 ++++++++++++++++++++++++++++++++++
>  tests/boot-order-test.c   |  4 +--
>  tests/fdc-test.c          | 15 +++++----
>  tests/ide-test.c          | 10 +++---
>  tests/libqtest.c          | 72 +++++++++++++++++++++++++++++++----------
>  tests/libqtest.h          | 51 +++++++++++++++++++++++++----
>  tests/qdev-monitor-test.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++
>  24 files changed, 299 insertions(+), 78 deletions(-)
>  create mode 100644 tests/blockdev-test.c
>  create mode 100644 tests/qdev-monitor-test.c
> 


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  parent reply	other threads:[~2013-10-30 15:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 13:54 [Qemu-devel] [PATCH v3 0/7] qdev and blockdev refcount leak fixes Stefan Hajnoczi
2013-10-30 13:54 ` [Qemu-devel] [PATCH v3 1/7] blockdev: fix drive_init() opts and bs_opts leaks Stefan Hajnoczi
2013-11-05 11:48   ` Eric Blake
2013-10-30 13:54 ` [Qemu-devel] [PATCH v3 2/7] qdev: unref qdev when device_add fails Stefan Hajnoczi
2013-11-05 11:50   ` Eric Blake
2013-11-05 15:28     ` Stefan Hajnoczi
2013-10-30 13:54 ` [Qemu-devel] [PATCH v3 3/7] libqtest: rename qmp() to qmp_discard_response() Stefan Hajnoczi
2013-11-05 11:52   ` Eric Blake
2013-11-06 15:24   ` Andreas Färber
2013-10-30 13:54 ` [Qemu-devel] [PATCH v3 4/7] libqtest: add qmp(fmt, ...) -> QDict* function Stefan Hajnoczi
2013-11-05 11:56   ` Eric Blake
2013-11-06 15:32   ` Andreas Färber
2013-10-30 13:54 ` [Qemu-devel] [PATCH v3 5/7] blockdev-test: add test case for drive_add duplicate IDs Stefan Hajnoczi
2013-11-05 11:57   ` Eric Blake
2013-11-06 15:36   ` Andreas Färber
2013-10-30 13:54 ` [Qemu-devel] [PATCH v3 6/7] qdev-monitor-test: add device_add leak test cases Stefan Hajnoczi
2013-11-05 11:58   ` Eric Blake
2013-11-06 15:38   ` Andreas Färber
2013-10-30 13:54 ` [Qemu-devel] [PATCH v3 7/7] qdev: drop misleading qdev_free() function Stefan Hajnoczi
2013-11-05 12:06   ` Eric Blake
2013-10-30 15:44 ` Andreas Färber [this message]
2013-10-31  9:22   ` [Qemu-devel] [PATCH v3 0/7] qdev and blockdev refcount leak fixes Stefan Hajnoczi
2013-11-06 10:30 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52712952.8010203@suse.de \
    --to=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.