[libvirt] [PATCH] qemu: add bootindex option to hostdev network interface commandline

Martin Kletzander mkletzan at redhat.com
Wed Dec 2 05:50:52 UTC 2015


On Tue, Dec 01, 2015 at 02:05:57PM -0500, Laine Stump wrote:
>when appropriate, of course. If the config for a domain specifies boot
>order with <boot dev='blah'/> elements, e.g.:
>
>     <os>
>       ...
>       <boot dev='hd'/>
>       <boot dev='network'/>
>     </os>
>
>Then the first disk device in the config will have ",bootindex=1"
>appended to its qemu commandline -device options, and the first (and
>*only* the first) network interface device will get ",bootindex=2".
>
>However, if the first network interface device is a "hostdev" device
>(an SRIOV Virtual Function (VF) being assigned to the domain with
>vfio), then the bootindex option will *not* be appended. This happens
>because the bootindex=n option corresponding to the order of "<boot
>dev='network'/>" is added to the -device for the first network device
>when network device commandline args are constructed, but if it's a
>hostdev network device, its commandline arg is instead constructed in
>the loop for hostdevs.
>
>This patch fixes that omission by noticing (in bootHostdevNet) if the
>first network device was a hostdev, and if so passing on the proper
>bootindex to the commandline generator for hostdev devices - the
>result is that ",bootindex=2" will be properly appended to the first
>"network" device in the config even if it is really a hostdev
>(including if it is assigned from a libvirt network pool). (note that
>this is only the case if there is no <bootmenu enabled='yes'/> element
>in the config ("-boot menu-on" in qemu) , since the two are mutually
>exclusive - when the bootmenu is enabled, the individual per-device
>bootindex options can't be used by qemu, and we revert to using "-boot
>order=xyz" instead).
>
>If a greater level of control over boot order is desired (e.g., more
>than one network device should be tried, or a network device other
>than the first one encountered in the config), then <boot
>dev='network'/> in the <os> element should not be used; instead, the
>individual device elements in the config should be given a "<boot
>order='n'/>
>
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1278421
>---
> src/qemu/qemu_command.c | 31 ++++++++++++++++++++++++++++---
> src/qemu/qemu_command.h |  1 +
> src/qemu/qemu_hotplug.c |  4 ++--
> 3 files changed, 31 insertions(+), 5 deletions(-)
>

ACK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151202/1a62fc8f/attachment-0001.sig>


More information about the libvir-list mailing list