]> git.ipfire.org Git - thirdparty/libvirt.git/commit
bhyve: fix SATA address allocation
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Thu, 5 Jan 2017 12:51:25 +0000 (16:51 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Mon, 30 Jan 2017 16:48:42 +0000 (20:48 +0400)
commit803966c76da17d79c26114f22b057091f055a867
tree48fd85983e82b9b7229afcc344cc820ca6dfb8e1
parent13a050b2c3abddaf15e446c6b6bfd0c50d2c7261
bhyve: fix SATA address allocation

As bhyve for a long time didn't have a notion of the explicit SATA
controller and created a controller for each drive, the bhyve driver
in libvirt acted in a similar way and didn't care about the SATA
controllers and assigned PCI addresses to drives directly, as
the generated command will look like this anyway:

 2:0,ahci-hd,somedisk.img

This no longer makes sense because:

 1. After commit c07d1c1c4f it's not possible to assign
    PCI addresses to disks
 2. Bhyve now supports multiple disk drives for a controller,
    so it's going away from 1:1 controller:disk mapping, so
    the controller object starts to make more sense now

So, this patch does the following:

 - Assign PCI address to SATA controllers (previously we didn't do this)
 - Assign disk addresses instead of PCI addresses for disks. Now, when
   building a bhyve command, we take PCI address not from the disk
   itself but from its controller
 - Assign addresses at XML parsing time using the
   assignAddressesCallback. This is done mainly for being able to
   verify address allocation via xml2xml tests
 - Adjust existing bhyvexml2{xml,argv} tests to chase the new
   address allocation

This patch is largely based on work of Fabian Freyer.
45 files changed:
po/POTFILES.in
src/bhyve/bhyve_command.c
src/bhyve/bhyve_device.c
src/bhyve/bhyve_domain.c
tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args
tests/bhyvexml2argvdata/bhyvexml2argv-base.args
tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args
tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args
tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args
tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args
tests/bhyvexml2argvdata/bhyvexml2argv-console.args
tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args
tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args
tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args
tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args
tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args
tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args
tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args
tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args
tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args
tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args
tests/bhyvexml2argvdata/bhyvexml2argv-serial.args
tests/bhyvexml2argvtest.c
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-metadata.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml
tests/bhyvexml2xmltest.c