* [Qemu-devel] [PATCH] Bugfix: Handle error if VM Generation ID device not present
@ 2017-03-02 21:36 ben
2017-03-02 21:41 ` Eric Blake
2017-03-02 22:41 ` Laszlo Ersek
0 siblings, 2 replies; 4+ messages in thread
From: ben @ 2017-03-02 21:36 UTC (permalink / raw)
To: qemu-devel
Cc: lersek, mst, imammedo, armbru, peter.maydell, dgilbert, pbonzini,
Ben Warren
From: Ben Warren <ben@skyportsystems.com>
This was crashing due to NULL-pointer dereference
QMP Test case:
==============
(QEMU) query-vm-generation-id
{"error": {"class": "GenericError", "desc": "VM Generation ID device not
found"}}
HMP Test case:
==============
virsh # qemu-monitor-command --hmp 3 info vm-generation-id
VM Generation ID device not found
Signed-off-by: Ben Warren <ben@skyportsystems.com>
---
hmp.c | 4 +++-
hw/acpi/vmgenid.c | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/hmp.c b/hmp.c
index 261843f..edb8970 100644
--- a/hmp.c
+++ b/hmp.c
@@ -2608,9 +2608,11 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict)
{
- GuidInfo *info = qmp_query_vm_generation_id(NULL);
+ Error *err = NULL;
+ GuidInfo *info = qmp_query_vm_generation_id(&err);
if (info) {
monitor_printf(mon, "%s\n", info->guid);
}
+ hmp_handle_error(mon, &err);
qapi_free_GuidInfo(info);
}
diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
index 744f284..7a3ad17 100644
--- a/hw/acpi/vmgenid.c
+++ b/hw/acpi/vmgenid.c
@@ -248,6 +248,7 @@ GuidInfo *qmp_query_vm_generation_id(Error **errp)
Object *obj = find_vmgenid_dev();
if (!obj) {
+ error_setg(errp, "VM Generation ID device not found");
return NULL;
}
vms = VMGENID(obj);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Bugfix: Handle error if VM Generation ID device not present
2017-03-02 21:36 [Qemu-devel] [PATCH] Bugfix: Handle error if VM Generation ID device not present ben
@ 2017-03-02 21:41 ` Eric Blake
2017-03-02 21:45 ` Michael S. Tsirkin
2017-03-02 22:41 ` Laszlo Ersek
1 sibling, 1 reply; 4+ messages in thread
From: Eric Blake @ 2017-03-02 21:41 UTC (permalink / raw)
To: ben, qemu-devel
Cc: peter.maydell, mst, armbru, dgilbert, pbonzini, imammedo, lersek
[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]
On 03/02/2017 03:36 PM, ben@skyportsystems.com wrote:
> From: Ben Warren <ben@skyportsystems.com>
>
> This was crashing due to NULL-pointer dereference
>
> QMP Test case:
> ==============
>
> (QEMU) query-vm-generation-id
> {"error": {"class": "GenericError", "desc": "VM Generation ID device not
> found"}}
>
> HMP Test case:
> ==============
> virsh # qemu-monitor-command --hmp 3 info vm-generation-id
> VM Generation ID device not found
>
> Signed-off-by: Ben Warren <ben@skyportsystems.com>
> ---
> hmp.c | 4 +++-
> hw/acpi/vmgenid.c | 1 +
> 2 files changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
However, hw/acpi/vmgenid.c is not part of the tree yet, so it may be
better to just respin the pull request to incorporate this into the
problematic patch that introduced the problem, rather than needing a
followup patch.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Bugfix: Handle error if VM Generation ID device not present
2017-03-02 21:41 ` Eric Blake
@ 2017-03-02 21:45 ` Michael S. Tsirkin
0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2017-03-02 21:45 UTC (permalink / raw)
To: Eric Blake
Cc: ben, qemu-devel, peter.maydell, armbru, dgilbert, pbonzini,
imammedo, lersek
On Thu, Mar 02, 2017 at 03:41:33PM -0600, Eric Blake wrote:
> On 03/02/2017 03:36 PM, ben@skyportsystems.com wrote:
> > From: Ben Warren <ben@skyportsystems.com>
> >
> > This was crashing due to NULL-pointer dereference
> >
> > QMP Test case:
> > ==============
> >
> > (QEMU) query-vm-generation-id
> > {"error": {"class": "GenericError", "desc": "VM Generation ID device not
> > found"}}
> >
> > HMP Test case:
> > ==============
> > virsh # qemu-monitor-command --hmp 3 info vm-generation-id
> > VM Generation ID device not found
> >
> > Signed-off-by: Ben Warren <ben@skyportsystems.com>
> > ---
> > hmp.c | 4 +++-
> > hw/acpi/vmgenid.c | 1 +
> > 2 files changed, 4 insertions(+), 1 deletion(-)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
> However, hw/acpi/vmgenid.c is not part of the tree yet, so it may be
> better to just respin the pull request to incorporate this into the
> problematic patch that introduced the problem, rather than needing a
> followup patch.
>
> --
> Eric Blake eblake redhat com +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
The issue seems minor enough.
I don't plan to re-spin unless there are more issues.
--
MST
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Bugfix: Handle error if VM Generation ID device not present
2017-03-02 21:36 [Qemu-devel] [PATCH] Bugfix: Handle error if VM Generation ID device not present ben
2017-03-02 21:41 ` Eric Blake
@ 2017-03-02 22:41 ` Laszlo Ersek
1 sibling, 0 replies; 4+ messages in thread
From: Laszlo Ersek @ 2017-03-02 22:41 UTC (permalink / raw)
To: ben, qemu-devel; +Cc: mst, imammedo, armbru, peter.maydell, dgilbert, pbonzini
On 03/02/17 22:36, ben@skyportsystems.com wrote:
> From: Ben Warren <ben@skyportsystems.com>
>
> This was crashing due to NULL-pointer dereference
>
> QMP Test case:
> ==============
>
> (QEMU) query-vm-generation-id
> {"error": {"class": "GenericError", "desc": "VM Generation ID device not
> found"}}
>
> HMP Test case:
> ==============
> virsh # qemu-monitor-command --hmp 3 info vm-generation-id
> VM Generation ID device not found
>
> Signed-off-by: Ben Warren <ben@skyportsystems.com>
> ---
> hmp.c | 4 +++-
> hw/acpi/vmgenid.c | 1 +
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hmp.c b/hmp.c
> index 261843f..edb8970 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -2608,9 +2608,11 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
>
> void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict)
> {
> - GuidInfo *info = qmp_query_vm_generation_id(NULL);
> + Error *err = NULL;
> + GuidInfo *info = qmp_query_vm_generation_id(&err);
> if (info) {
> monitor_printf(mon, "%s\n", info->guid);
> }
> + hmp_handle_error(mon, &err);
> qapi_free_GuidInfo(info);
> }
> diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
> index 744f284..7a3ad17 100644
> --- a/hw/acpi/vmgenid.c
> +++ b/hw/acpi/vmgenid.c
> @@ -248,6 +248,7 @@ GuidInfo *qmp_query_vm_generation_id(Error **errp)
> Object *obj = find_vmgenid_dev();
>
> if (!obj) {
> + error_setg(errp, "VM Generation ID device not found");
> return NULL;
> }
> vms = VMGENID(obj);
>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-02 22:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-02 21:36 [Qemu-devel] [PATCH] Bugfix: Handle error if VM Generation ID device not present ben
2017-03-02 21:41 ` Eric Blake
2017-03-02 21:45 ` Michael S. Tsirkin
2017-03-02 22:41 ` Laszlo Ersek
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).