qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Jens Freimann <jfreimann@redhat.com>
Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, mst@redhat.com,
	mdroth@linux.vnet.ibm.com, pkrempa@redhat.com, laine@redhat.com,
	liran.alon@oracle.com, ogerlitz@mellanox.com, ailan@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH 0/2] implement the failover feature for assigned network devices
Date: Thu, 4 Apr 2019 13:53:01 +0100	[thread overview]
Message-ID: <20190404125301.GX10471@redhat.com> (raw)
In-Reply-To: <20190322134447.14831-1-jfreimann@redhat.com>

On Fri, Mar 22, 2019 at 02:44:45PM +0100, Jens Freimann wrote:
> Commandline: There is a dependency between vfio-pci and virtio-net
> devices. One points to the other via new parameters
> primar=<primary qdev id> and standby='<standby qdev id>'. This means
> that the primary device needs to be specified after standby device on 
> the qemu command line. Not sure how to solve this.

So we hae this pair of args

>         -device virtio-net-pci,netdev=hostnet1,id=net1,mac=52:54:00:6f:55:cc,bus=root2,primary=hostdev0 \                                                                                     
>         -device vfio-pci,host=5e:00.2,id=hostdev0,bus=root1,standby=net1 \

In this you have denoted the "vfio-pci" device as the primary and
"virtio-net-pci" as the standby.

There's no need for the user to specify the "primary" property for for
the "virtio-net-pci" NIC though. We only need to tell QEMU the relationship
in one direction and it can set the relationship in the reverse direction
automatically.

In fact it is undesirable for the user to specify "primary" property, as
they should be able to start QEMU with only the virtio-net-pci device
present and then hot-plug a vfio-pci on the fly when it is available.

So I think the "virtio-net-pci" merely needs a flag to indicate that it
should be prepared to take part in a failover pair, but *not* take any
device ID from the user.

eg we should be able to start with just

  -device virtio-net-pci,netdev=hostnet1,id=net1,\
          mac=52:54:00:6f:55:cc,bus=root2,failover=on

When vfio-pci is then created, either via a further -device arg on later
in QMP via device_add, it only needs to specify standby=net1.

When vfio-pci is realized it can lookup the virtio-net-pci device
in the QOM tree and set its "primary" property to point back to its
own device ID. There should never be any need for the user to tell
virtio-net-pci what the device ID of the vfio-pci is.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

      parent reply	other threads:[~2019-04-04 12:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190322134447.14831-1-jfreimann@redhat.com>
2019-04-04  8:29 ` [Qemu-devel] [RFC PATCH 0/2] implement the failover feature for assigned network devices Jens Freimann
2019-04-05  8:56   ` Dr. David Alan Gilbert
2019-04-05  8:56     ` Dr. David Alan Gilbert
2019-04-05  9:20     ` Jens Freimann
2019-04-05  9:20       ` Jens Freimann
2019-04-08  5:53       ` Markus Armbruster
2019-04-08  5:53         ` Markus Armbruster
2019-04-05 23:22     ` Michael S. Tsirkin
2019-04-05 23:22       ` Michael S. Tsirkin
2019-04-05 23:46       ` Eduardo Habkost
2019-04-05 23:46         ` Eduardo Habkost
2019-04-08  5:26         ` Markus Armbruster
2019-04-08  5:26           ` Markus Armbruster
2019-04-12 19:50           ` Eduardo Habkost
2019-04-12 19:50             ` Eduardo Habkost
2019-04-08  9:16       ` Dr. David Alan Gilbert
2019-04-08  9:16         ` Dr. David Alan Gilbert
2019-04-08 13:00         ` Jens Freimann
2019-04-08 13:00           ` Jens Freimann
2019-04-08 17:00           ` Dr. David Alan Gilbert
2019-04-08 17:00             ` Dr. David Alan Gilbert
2019-04-08 13:22         ` Michael S. Tsirkin
2019-04-08 13:22           ` Michael S. Tsirkin
2019-05-29  0:35       ` si-wei liu
2019-05-29  2:47         ` Michael S. Tsirkin
2019-04-04 12:53 ` Daniel P. Berrangé [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404125301.GX10471@redhat.com \
    --to=berrange@redhat.com \
    --cc=ailan@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jfreimann@redhat.com \
    --cc=laine@redhat.com \
    --cc=liran.alon@oracle.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=ogerlitz@mellanox.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).