qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>,
	Markus Armbruster <armbru@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	libvir-list@redhat.com, "Stefan Hajnoczi" <stefanha@gmail.com>,
	qemu-devel@nongnu.org, "Luiz Capitulino" <lcapitulino@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	Andreas
	=?us-ascii?Q?=3D=3Fus-ascii=3FB=3FPT91dGYtOD9RP0Y9QzM9QTRyYmVy?=
	=?us-ascii?B?UHowPT89?= <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH v8 3/3] qmp: add path to device_deleted event
Date: Thu, 14 Mar 2013 14:40:53 +0200	[thread overview]
Message-ID: <402bba7ec7d64c12db96c8e751147acba6d26280.1363264726.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1363264726.git.mst@redhat.com>

Add QOM path to device deleted event.  It now becomes useful to report
it for devices which don't have an ID assigned.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 QMP/qmp-events.txt | 4 +++-
 hw/qdev.c          | 5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/QMP/qmp-events.txt b/QMP/qmp-events.txt
index 24cf3e8..dcc826d 100644
--- a/QMP/qmp-events.txt
+++ b/QMP/qmp-events.txt
@@ -147,9 +147,11 @@ Device removal can be initiated by the guest or by HMP/QMP commands.
 Data:
 
 - "device": device name (json-string, optional)
+- "path": device path (json-string)
 
 { "event": "DEVICE_DELETED",
-  "data": { "device": "virtio-net-pci-0" },
+  "data": { "device": "virtio-net-pci-0",
+            "path": "/machine/peripheral/virtio-net-pci-0" },
   "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
 
 DEVICE_TRAY_MOVED
diff --git a/hw/qdev.c b/hw/qdev.c
index 64546cf..2c861c1 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -782,9 +782,10 @@ static void device_unparent(Object *obj, const char *path)
     }
 
     if (dev->id) {
-        event_data = qobject_from_jsonf("{ 'device': %s }", dev->id);
+        event_data = qobject_from_jsonf("{ 'device': %s, 'path': %s }",
+                                        dev->id, path);
     } else {
-        event_data = qobject_from_jsonf("{ }");
+        event_data = qobject_from_jsonf("{ 'path': %s }", path);
     }
     monitor_protocol_event(QEVENT_DEVICE_DELETED, event_data);
     qobject_decref(event_data);
-- 
MST

  parent reply	other threads:[~2013-03-14 12:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 12:40 [Qemu-devel] [PATCH v8 0/3] DEVICE_DELETED event Michael S. Tsirkin
2013-03-14 12:40 ` [Qemu-devel] [PATCH v8 1/3] qdev: " Michael S. Tsirkin
2013-03-14 12:40 ` [Qemu-devel] [PATCH v8 2/3] qom: pass original path to unparent method Michael S. Tsirkin
2013-03-18 14:24   ` Anthony Liguori
2013-03-18 14:35     ` Michael S. Tsirkin
2013-03-18 15:08       ` Paolo Bonzini
2013-03-18 15:03     ` Paolo Bonzini
2013-03-18 16:04       ` Anthony Liguori
2013-03-14 12:40 ` Michael S. Tsirkin [this message]
2013-03-14 14:18 ` [Qemu-devel] [PATCH v8 0/3] DEVICE_DELETED event Markus Armbruster
2013-03-14 22:56 ` [Qemu-devel] [libvirt] " Eric Blake

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=402bba7ec7d64c12db96c8e751147acba6d26280.1363264726.git.mst@redhat.com \
    --to=mst@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).