[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 1/4] cpus: Define callback for QEMU "nmi" com
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v6 1/4] cpus: Define callback for QEMU "nmi" command |
Date: |
Wed, 11 Jun 2014 19:46:35 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 06/11/2014 06:10 PM, Alexey Kardashevskiy wrote:
>>> + * This program is free software; you can redistribute it and/or modify
>>> + * it under the terms of the GNU General Public License as published by
>>> + * the Free Software Foundation; either version 2 of the License,
>>> + * or (at your option) any later version.
>>
>> For the GPL license to work, there has to be a Copyright line.
>
> Hm. Ok. include/hw/fw-path-provider.h (where I copied this from) does not
> have one and it was ok.
Just because there's existing bad practice in the code base doesn't mean
new files should perpetuate it :)
>
>>
>>> +static int do_nmi(Object *o, void *opaque)
>>> +{
>>> + struct do_nmi_s *ns = opaque;
>>> + NMI *n = (NMI *) object_dynamic_cast(o, TYPE_NMI);
>>
>> Is the cast to (NMI *) necessary, or does object_dynamic_cast() already
>> return something that can be assigned to an arbitrary pointer type?
>
>
> All the macros from include/qom/object.h do this cast and so do I.
>
> object_dynamic_cast returns Object*.
Okay, then the cast is needed. (I wonder if object_dynamic_cast()
should return void* to avoid the need for casting, but that probably
invites more errors than what it saves from the eliminated casts).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v6 2/4] target-s390x: Migrate to new NMI interface, Alexey Kardashevskiy, 2014/06/11
Re: [Qemu-devel] [PATCH v6 2/4] target-s390x: Migrate to new NMI interface, Cornelia Huck, 2014/06/12