qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Adds virtio_net as the default netcard for mips


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] Adds virtio_net as the default netcard for mips boston board.
Date: Mon, 1 Apr 2019 09:38:46 +0000

On Mon, 1 Apr 2019 at 16:23, Tommy Jin <address@hidden> wrote:
>
> Boston didn't bring up any netcard by default, this is not so convenient for 
> users who are verifying network related functionalities on this board.
> As the linux kernel has already supported virtio_net, now add a virtio 
> netcard for boston, to make virtio work properly, please:
> 1. set virtio net options in linux kernel, saying CONFIG_VIRTIO && 
> CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET
> 2. specify model=virtio when you start boston in qemu.
>
> Signed-off-by: tjin <address@hidden>
> ---
>  hw/mips/boston.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/mips/boston.c b/hw/mips/boston.c
> index cac0e22..5d3239e 100644
> --- a/hw/mips/boston.c
> +++ b/hw/mips/boston.c
> @@ -428,10 +428,10 @@ static void network_init(PCIBus *bus)
>  {
>      PCIDevice *eth;
>
> -    /*Please set CONFIG_VIRTIO && CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET
> -        of Linux kernel.*/
> +    /* Please set CONFIG_VIRTIO && CONFIG_VIRTIO_PCI && CONFIG_VIRTIO_NET */
> +    /* of Linux kernel. */

This sort of thing should go in documentation, not as a comment
in the code.

>      eth = pci_create(bus,
> -                                        PCI_DEVFN(0, 1), "virtio-net-pci");
> +                     PCI_DEVFN(0, 1), "virtio-net-pci");


Am I missing something, or is this patch not actually changing
any code? Maybe you made a mistake somehow when creating it?

I'm not sure if we want to create a default network card
for this board -- the user (or more usually the management
layer like libvirt) can create it on the command line, and
if we always create a virtio-net-pci device in the code then
the user has no way to say they *don't* want the device.

Also, this board is a model of a real piece of hardware, and
the real hardware doesn't have a virtio-net device in it.

>
>      qdev_set_nic_properties(&eth->qdev, &nd_table[0]);
>      qdev_init_nofail(&eth->qdev);
> --

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]