diff mbox

[for,2.4,1/3] net/dp8393x: disable user creation

Message ID 1437763343-7980-2-git-send-email-hpoussin@reactos.org
State New
Headers show

Commit Message

Hervé Poussineau July 24, 2015, 6:42 p.m. UTC
Netcard needs an address space to write data to, which can't be specified on command line.
This fixes a crash when user starts QEMU with "-device dp8393x"

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/net/dp8393x.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Aurelien Jarno July 26, 2015, 8:11 p.m. UTC | #1
On 2015-07-24 20:42, Hervé Poussineau wrote:
> Netcard needs an address space to write data to, which can't be specified on command line.
> This fixes a crash when user starts QEMU with "-device dp8393x"
> 
> Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
>  hw/net/dp8393x.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
> index cd889bc..8fafdb0 100644
> --- a/hw/net/dp8393x.c
> +++ b/hw/net/dp8393x.c
> @@ -881,6 +881,8 @@ static void dp8393x_class_init(ObjectClass *klass, void *data)
>      dc->reset = dp8393x_reset;
>      dc->vmsd = &vmstate_dp8393x;
>      dc->props = dp8393x_properties;
> +    /* Reason: dma_mr property can't be set */
> +    dc->cannot_instantiate_with_device_add_yet = true;
>  }
>  
>  static const TypeInfo dp8393x_info = {

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
diff mbox

Patch

diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index cd889bc..8fafdb0 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -881,6 +881,8 @@  static void dp8393x_class_init(ObjectClass *klass, void *data)
     dc->reset = dp8393x_reset;
     dc->vmsd = &vmstate_dp8393x;
     dc->props = dp8393x_properties;
+    /* Reason: dma_mr property can't be set */
+    dc->cannot_instantiate_with_device_add_yet = true;
 }
 
 static const TypeInfo dp8393x_info = {