[Qemu-devel] [PATCH v2 07/21] kvmclock: Remove user_creatable flag

Eduardo Habkost posted 21 patches 8 years, 10 months ago
[Qemu-devel] [PATCH v2 07/21] kvmclock: Remove user_creatable flag
Posted by Eduardo Habkost 8 years, 10 months ago
kvmclock should be used by guests only when the appropriate CPUID
feature flags are set on the VCPU, and it is automatically
created by kvmclock_create() when those feature flags are set.
This means creating a kvmclock device using -device is useless.
Remove user_creatable from its device class.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* (none)
---
 hw/i386/kvm/clock.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
index 7665bef999..13eca374cd 100644
--- a/hw/i386/kvm/clock.c
+++ b/hw/i386/kvm/clock.c
@@ -286,11 +286,6 @@ static void kvmclock_class_init(ObjectClass *klass, void *data)
     dc->realize = kvmclock_realize;
     dc->vmsd = &kvmclock_vmsd;
     dc->props = kvmclock_properties;
-    /*
-     * FIXME: Set only because we are not sure yet if this device
-     * will be outside the q35 sysbus whitelist.
-     */
-    dc->user_creatable = true;
 }
 
 static const TypeInfo kvmclock_info = {
-- 
2.11.0.259.g40922b1


Re: [Qemu-devel] [PATCH v2 07/21] kvmclock: Remove user_creatable flag
Posted by Thomas Huth 8 years, 10 months ago
On 04.04.2017 22:24, Eduardo Habkost wrote:
> kvmclock should be used by guests only when the appropriate CPUID
> feature flags are set on the VCPU, and it is automatically
> created by kvmclock_create() when those feature flags are set.
> This means creating a kvmclock device using -device is useless.
> Remove user_creatable from its device class.

Actually, I think this device should not be a sysbus device at all,
should it? It does not have any IO, GPIO or IRQ lines, so sysbus does
not make sense here, it should be of type TYPE_DEVICE instead.

Anyway, that's another topic. For your patch:

Reviewed-by: Thomas Huth <thuth@redhat.com>