diff mbox

[v2,07/21] kvmclock: Remove user_creatable flag

Message ID 20170404202429.14643-8-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eduardo Habkost April 4, 2017, 8:24 p.m. UTC
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(-)

Comments

Thomas Huth April 6, 2017, 9:42 a.m. UTC | #1
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>
diff mbox

Patch

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 = {