From 803966c76da17d79c26114f22b057091f055a867 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Thu, 5 Jan 2017 16:51:25 +0400 Subject: [PATCH] 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. --- po/POTFILES.in | 1 + src/bhyve/bhyve_command.c | 143 +++++++++++++----- src/bhyve/bhyve_device.c | 35 ++--- src/bhyve/bhyve_domain.c | 60 +++++++- .../bhyvexml2argv-acpiapic.args | 4 +- .../bhyvexml2argvdata/bhyvexml2argv-base.args | 4 +- .../bhyvexml2argv-bhyveload-bootorder.args | 5 +- .../bhyvexml2argv-bhyveload-bootorder1.args | 5 +- .../bhyvexml2argv-bhyveload-bootorder3.args | 5 +- .../bhyvexml2argv-bhyveload-explicitargs.args | 4 +- .../bhyvexml2argv-console.args | 2 +- .../bhyvexml2argv-custom-loader.args | 4 +- .../bhyvexml2argv-disk-cdrom-grub.args | 4 +- .../bhyvexml2argv-disk-cdrom.args | 4 +- .../bhyvexml2argv-grub-bootorder.args | 6 +- .../bhyvexml2argv-grub-bootorder2.args | 6 +- .../bhyvexml2argv-grub-defaults.args | 4 +- .../bhyvexml2argv-localtime.args | 4 +- .../bhyvexml2argv-macaddr.args | 4 +- .../bhyvexml2argv-serial-grub-nocons.args | 2 +- .../bhyvexml2argv-serial-grub.args | 2 +- .../bhyvexml2argv-serial.args | 2 +- tests/bhyvexml2argvtest.c | 2 +- .../bhyvexml2xmlout-acpiapic.xml | 4 +- .../bhyvexml2xmlout-base.xml | 4 +- .../bhyvexml2xmlout-bhyveload-bootorder.xml | 4 +- .../bhyvexml2xmlout-bhyveload-bootorder1.xml | 4 +- .../bhyvexml2xmlout-bhyveload-bootorder2.xml | 4 +- .../bhyvexml2xmlout-bhyveload-bootorder3.xml | 4 +- .../bhyvexml2xmlout-bhyveload-bootorder4.xml | 4 +- ...bhyvexml2xmlout-bhyveload-explicitargs.xml | 4 +- .../bhyvexml2xmlout-console.xml | 4 +- .../bhyvexml2xmlout-custom-loader.xml | 4 +- .../bhyvexml2xmlout-disk-cdrom-grub.xml | 4 +- .../bhyvexml2xmlout-disk-cdrom.xml | 4 +- .../bhyvexml2xmlout-grub-bootorder.xml | 4 +- .../bhyvexml2xmlout-grub-bootorder2.xml | 4 +- .../bhyvexml2xmlout-grub-defaults.xml | 4 +- .../bhyvexml2xmlout-localtime.xml | 4 +- .../bhyvexml2xmlout-macaddr.xml | 4 +- .../bhyvexml2xmlout-metadata.xml | 5 +- .../bhyvexml2xmlout-serial-grub-nocons.xml | 4 +- .../bhyvexml2xmlout-serial-grub.xml | 4 +- .../bhyvexml2xmlout-serial.xml | 4 +- tests/bhyvexml2xmltest.c | 2 + 45 files changed, 280 insertions(+), 119 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 5a02d73265..365ea662fd 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -14,6 +14,7 @@ src/access/viraccessdriverpolkit.c src/access/viraccessmanager.c src/bhyve/bhyve_command.c src/bhyve/bhyve_device.c +src/bhyve/bhyve_domain.c src/bhyve/bhyve_driver.c src/bhyve/bhyve_monitor.c src/bhyve/bhyve_parse_command.c diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 8a29977ff1..a50bd10660 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -148,40 +148,97 @@ bhyveBuildConsoleArgStr(const virDomainDef *def, virCommandPtr cmd) } static int -bhyveBuildDiskArgStr(const virDomainDef *def ATTRIBUTE_UNUSED, - virDomainDiskDefPtr disk, - virCommandPtr cmd) +bhyveBuildAHCIControllerArgStr(const virDomainDef *def, + virDomainControllerDefPtr controller, + virConnectPtr conn, + virCommandPtr cmd) { - const char *bus_type; + virBuffer buf = VIR_BUFFER_INITIALIZER; + virBuffer device = VIR_BUFFER_INITIALIZER; const char *disk_source; + size_t i; + int ret = -1; + + for (i = 0; i < def->ndisks; i++) { + virDomainDiskDefPtr disk = def->disks[i]; + if (disk->bus != VIR_DOMAIN_DISK_BUS_SATA) + continue; + + if (disk->info.addr.drive.controller != controller->idx) + continue; + + VIR_DEBUG("disk %zu controller %d", i, controller->idx); + + if ((virDomainDiskGetType(disk) != VIR_STORAGE_TYPE_FILE) && + (virDomainDiskGetType(disk) != VIR_STORAGE_TYPE_VOLUME)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("unsupported disk type")); + goto error; + } + + if (virStorageTranslateDiskSourcePool(conn, disk) < 0) + goto error; + + disk_source = virDomainDiskGetSource(disk); + + if ((disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) && + (disk_source == NULL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("cdrom device without source path " + "not supported")); + goto error; + } - switch (disk->bus) { - case VIR_DOMAIN_DISK_BUS_SATA: switch (disk->device) { case VIR_DOMAIN_DISK_DEVICE_DISK: - bus_type = "ahci-hd"; + if ((bhyveDriverGetCaps(conn) & BHYVE_CAP_AHCI32SLOT)) + virBufferAsprintf(&device, ",hd:%s", disk_source); + else + virBufferAsprintf(&device, "-hd,%s", disk_source); break; case VIR_DOMAIN_DISK_DEVICE_CDROM: - bus_type = "ahci-cd"; + if ((bhyveDriverGetCaps(conn) & BHYVE_CAP_AHCI32SLOT)) + virBufferAsprintf(&device, ",cd:%s", disk_source); + else + virBufferAsprintf(&device, "-cd,%s", disk_source); break; default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("unsupported disk device")); - return -1; + goto error; } - break; - case VIR_DOMAIN_DISK_BUS_VIRTIO: - if (disk->device == VIR_DOMAIN_DISK_DEVICE_DISK) { - bus_type = "virtio-blk"; - } else { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("unsupported disk device")); - return -1; - } - break; - default: + virBufferAddBuffer(&buf, &device); + virBufferFreeAndReset(&device); + } + + if (virBufferCheckError(&buf) < 0) + goto error; + + virCommandAddArg(cmd, "-s"); + virCommandAddArgFormat(cmd, "%d:0,ahci%s", + controller->info.addr.pci.slot, + virBufferCurrentContent(&buf)); + + ret = 0; + error: + virBufferFreeAndReset(&buf); + return ret; +} + +static int +bhyveBuildVirtIODiskArgStr(const virDomainDef *def ATTRIBUTE_UNUSED, + virDomainDiskDefPtr disk, + virConnectPtr conn, + virCommandPtr cmd) +{ + const char *disk_source; + + if (virStorageTranslateDiskSourcePool(conn, disk) < 0) + return -1; + + if (disk->device != VIR_DOMAIN_DISK_DEVICE_DISK) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("unsupported disk bus type")); + _("unsupported disk device")); return -1; } @@ -194,17 +251,9 @@ bhyveBuildDiskArgStr(const virDomainDef *def ATTRIBUTE_UNUSED, disk_source = virDomainDiskGetSource(disk); - if ((disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM) && - (disk_source == NULL)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("cdrom device without source path " - "not supported")); - return -1; - } - virCommandAddArg(cmd, "-s"); - virCommandAddArgFormat(cmd, "%d:0,%s,%s", - disk->info.addr.pci.slot, bus_type, + virCommandAddArgFormat(cmd, "%d:0,virtio-blk,%s", + disk->info.addr.pci.slot, disk_source); return 0; @@ -278,6 +327,22 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, virCommandAddArgList(cmd, "-s", "0:0,hostbridge", NULL); /* Devices */ + for (i = 0; i < def->ncontrollers; i++) { + virDomainControllerDefPtr controller = def->controllers[i]; + switch (controller->type) { + case VIR_DOMAIN_CONTROLLER_TYPE_PCI: + if (controller->model != VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("unsupported PCI controller model: only PCI root supported")); + goto error; + } + break; + case VIR_DOMAIN_CONTROLLER_TYPE_SATA: + if (bhyveBuildAHCIControllerArgStr(def, controller, conn, cmd) < 0) + goto error; + break; + } + } for (i = 0; i < def->nnets; i++) { virDomainNetDefPtr net = def->nets[i]; if (bhyveBuildNetArgStr(def, net, cmd, dryRun) < 0) @@ -286,11 +351,19 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, for (i = 0; i < def->ndisks; i++) { virDomainDiskDefPtr disk = def->disks[i]; - if (virStorageTranslateDiskSourcePool(conn, disk) < 0) - goto error; - - if (bhyveBuildDiskArgStr(def, disk, cmd) < 0) + switch (disk->bus) { + case VIR_DOMAIN_DISK_BUS_SATA: + /* Handled by bhyveBuildAHCIControllerArgStr() */ + break; + case VIR_DOMAIN_DISK_BUS_VIRTIO: + if (bhyveBuildVirtIODiskArgStr(def, disk, conn, cmd) < 0) + goto error; + break; + default: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("unsupported disk device")); goto error; + } } if (bhyveBuildConsoleArgStr(def, cmd) < 0) goto error; diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index 97e81e1961..29528230fd 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -39,6 +39,9 @@ bhyveCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED, void *opaque) { int ret = -1; + if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) + return 0; + virDomainPCIAddressSetPtr addrs = opaque; virPCIDeviceAddressPtr addr = &info->addr.pci; @@ -101,28 +104,9 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, goto error; } - for (i = 0; i < def->nnets; i++) { - if (!virDeviceInfoPCIAddressWanted(&def->nets[i]->info)) - continue; - if (virDomainPCIAddressReserveNextAddr(addrs, &def->nets[i]->info, - VIR_PCI_CONNECT_TYPE_PCI_DEVICE, - -1) < 0) { - goto error; - } - } - - for (i = 0; i < def->ndisks; i++) { - if (def->disks[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && - !virPCIDeviceAddressIsEmpty(&def->disks[i]->info.addr.pci)) - continue; - if (virDomainPCIAddressReserveNextAddr(addrs, &def->disks[i]->info, - VIR_PCI_CONNECT_TYPE_PCI_DEVICE, - -1) < 0) - goto error; - } - for (i = 0; i < def->ncontrollers; i++) { - if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) { + if ((def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) || + (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA)) { if (def->controllers[i]->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || !virDeviceInfoPCIAddressWanted(&def->controllers[i]->info)) continue; @@ -133,7 +117,16 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, -1) < 0) goto error; } + } + for (i = 0; i < def->nnets; i++) { + if (!virDeviceInfoPCIAddressWanted(&def->nets[i]->info)) + continue; + if (virDomainPCIAddressReserveNextAddr(addrs, + &def->nets[i]->info, + VIR_PCI_CONNECT_TYPE_PCI_DEVICE, + -1) < 0) + goto error; } return 0; diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index b4dc26767c..76b4fac2c4 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -24,6 +24,7 @@ #include "bhyve_device.h" #include "bhyve_domain.h" +#include "bhyve_capabilities.h" #include "viralloc.h" #include "virlog.h" @@ -73,13 +74,67 @@ bhyveDomainDefPostParse(virDomainDefPtr def, } static int -bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev ATTRIBUTE_UNUSED, - const virDomainDef *def ATTRIBUTE_UNUSED, +bhyveDomainDiskDefAssignAddress(bhyveConnPtr driver, + virDomainDiskDefPtr def, + const virDomainDef *vmdef ATTRIBUTE_UNUSED) +{ + int idx = virDiskNameToIndex(def->dst); + + if (idx < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("Unknown disk name '%s' and no address specified"), + def->dst); + return -1; + } + + switch (def->bus) { + case VIR_DOMAIN_DISK_BUS_SATA: + def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE; + + if ((driver->bhyvecaps & BHYVE_CAP_AHCI32SLOT) != 0) { + def->info.addr.drive.controller = idx / 32; + def->info.addr.drive.unit = idx % 32; + } else { + def->info.addr.drive.controller = idx; + def->info.addr.drive.unit = 0; + } + + def->info.addr.drive.bus = 0; + break; + } + return 0; +} + +static int +bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, + const virDomainDef *def, + virCapsPtr caps ATTRIBUTE_UNUSED, + unsigned int parseFlags ATTRIBUTE_UNUSED, + void *opaque, + void *parseOpaque ATTRIBUTE_UNUSED) +{ + bhyveConnPtr driver = opaque; + + if (dev->type == VIR_DOMAIN_DEVICE_DISK) { + virDomainDiskDefPtr disk = dev->data.disk; + + if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && + bhyveDomainDiskDefAssignAddress(driver, disk, def) < 0) + return -1; + } + return 0; +} + +static int +bhyveDomainDefAssignAddresses(virDomainDef *def, virCapsPtr caps ATTRIBUTE_UNUSED, unsigned int parseFlags ATTRIBUTE_UNUSED, void *opaque ATTRIBUTE_UNUSED, void *parseOpaque ATTRIBUTE_UNUSED) { + if (bhyveDomainAssignAddresses(def, NULL) < 0) + return -1; + return 0; } @@ -95,4 +150,5 @@ virBhyveDriverCreateXMLConf(bhyveConnPtr driver) virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = { .devicesPostParseCallback = bhyveDomainDeviceDefPostParse, .domainPostParseCallback = bhyveDomainDefPostParse, + .assignAddressesCallback = bhyveDomainDefAssignAddresses, }; diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args b/tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args index 930166f073..e71ceec84f 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.args @@ -7,5 +7,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:81:c4:b1 \ --s 2:0,ahci-hd,/tmp/freebsd.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:81:c4:b1 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-base.args b/tests/bhyvexml2argvdata/bhyvexml2argv-base.args index 76d597cc6e..547485ba5d 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-base.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-base.args @@ -5,5 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \ --s 2:0,ahci-hd,/tmp/freebsd.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args index a303ee3c5b..4d7c7c92a8 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder.args @@ -5,6 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:8d:10:e1 \ --s 2:0,ahci-hd,/tmp/freebsd.img \ --s 4:0,ahci-cd,/tmp/cdrom.iso bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img,cd:/tmp/cdrom.iso \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:8d:10:e1 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args index 04601319bc..8ec9799ccd 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder1.args @@ -5,6 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:92:68:0e \ --s 2:0,ahci-hd,/tmp/freebsd.img \ --s 4:0,ahci-cd,/tmp/cdrom.iso bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img,cd:/tmp/cdrom.iso \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:92:68:0e bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args index 79631c3a66..f1c0bf3987 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-bootorder3.args @@ -5,6 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:7a:f5:a4 \ --s 2:0,ahci-hd,/tmp/freebsd.img \ --s 4:0,ahci-cd,/tmp/cdrom.iso bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img,cd:/tmp/cdrom.iso \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:7a:f5:a4 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args index e80ff026a9..17a1c83809 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-bhyveload-explicitargs.args @@ -5,5 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:11:bd:26 \ --s 2:0,ahci-hd,/tmp/freebsd.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:11:bd:26 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-console.args b/tests/bhyvexml2argvdata/bhyvexml2argv-console.args index bd2892c472..6ab91ae7e4 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-console.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-console.args @@ -5,7 +5,7 @@ -H \ -P \ -s 0:0,hostbridge \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:b1:42:eb \ --s 2:0,ahci-hd,/tmp/freebsd.img \ -s 1,lpc \ -l com1,/dev/nmdm0A bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args b/tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args index 7a0eeb2fcd..f6bfc78374 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-custom-loader.args @@ -5,5 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:35:99:c2 \ --s 2:0,ahci-hd,/tmp/freebsd.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:35:99:c2 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args index 907751c6c9..72f1d3538c 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom-grub.args @@ -5,5 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:6f:6a:53 \ --s 2:0,ahci-cd,/tmp/cdrom.iso bhyve +-s 2:0,ahci,cd:/tmp/cdrom.iso \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:6f:6a:53 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args index 1806505559..3e61b8fc8a 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.args @@ -5,5 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:e3:ec:9b \ --s 2:0,ahci-cd,/tmp/cdrom.iso bhyve +-s 2:0,ahci,cd:/tmp/cdrom.iso \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:e3:ec:9b bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args index 1b38be1ab4..e64e67b39d 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args @@ -5,7 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:f4:6c:be \ --s 2:0,ahci-hd,/tmp/freebsd1.img \ --s 4:0,ahci-hd,/tmp/freebsd2.img \ --s 6:0,ahci-hd,/tmp/freebsd3.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd1.img,hd:/tmp/freebsd2.img,hd:/tmp/freebsd3.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:f4:6c:be bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args index ae510d50d6..872a69df3b 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args @@ -5,7 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:0e:d2:6f \ --s 2:0,ahci-hd,/tmp/freebsd1.img \ --s 4:0,ahci-hd,/tmp/freebsd2.img \ --s 6:0,ahci-hd,/tmp/freebsd3.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd1.img,hd:/tmp/freebsd2.img,hd:/tmp/freebsd3.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:0e:d2:6f bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args index 9457ce9550..3ba5c11608 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-grub-defaults.args @@ -5,5 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:ee:f5:79 \ --s 2:0,ahci-hd,/tmp/freebsd.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:ee:f5:79 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args b/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args index 3f62aa7fbe..307d888c1f 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-localtime.args @@ -4,5 +4,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:82:ca:a3 \ --s 2:0,ahci-hd,/tmp/freebsd.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:82:ca:a3 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args b/tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args index 677a466bab..5e13a9742d 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args @@ -5,5 +5,5 @@ -H \ -P \ -s 0:0,hostbridge \ --s 3:0,virtio-net,faketapdev,mac=52:54:00:22:ee:11 \ --s 2:0,ahci-hd,/tmp/freebsd.img bhyve +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=52:54:00:22:ee:11 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args index 4811d491b7..ff69ed3a7d 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub-nocons.args @@ -5,7 +5,7 @@ -H \ -P \ -s 0:0,hostbridge \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:a7:cd:5b \ --s 2:0,ahci-hd,/tmp/freebsd.img \ -s 1,lpc \ -l com1,/dev/nmdm0A bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args index efdbd63a56..313724dc90 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial-grub.args @@ -5,7 +5,7 @@ -H \ -P \ -s 0:0,hostbridge \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:f0:72:11 \ --s 2:0,ahci-hd,/tmp/freebsd.img \ -s 1,lpc \ -l com1,/dev/nmdm0A bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args b/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args index ccce582633..059e457072 100644 --- a/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-serial.args @@ -5,7 +5,7 @@ -H \ -P \ -s 0:0,hostbridge \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ -s 3:0,virtio-net,faketapdev,mac=52:54:00:4f:f3:5b \ --s 2:0,ahci-hd,/tmp/freebsd.img \ -s 1,lpc \ -l com1,/dev/nmdm0A bhyve diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index a615c8ca14..6d0a9e1f80 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -155,7 +155,7 @@ mymain(void) DO_TEST_FULL(name, FLAG_EXPECT_PARSE_ERROR) driver.grubcaps = BHYVE_GRUB_CAP_CONSDEV; - driver.bhyvecaps = BHYVE_CAP_RTC_UTC; + driver.bhyvecaps = BHYVE_CAP_RTC_UTC | BHYVE_CAP_AHCI32SLOT; DO_TEST("base"); DO_TEST("acpiapic"); diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml index ef57e0be69..0a9b284ffb 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml @@ -24,7 +24,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml index 0ff1a3c6b3..56ff3bd14b 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml index 6c092bb8d4..c4705d9a8b 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml @@ -27,7 +27,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml index f9e55d6e33..ebc781e740 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml @@ -27,7 +27,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml index f75471f849..389355f913 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml index 8b9aeea186..10ba217934 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml @@ -27,7 +27,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml index a688d8a76f..2215c7327e 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml @@ -28,7 +28,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml index bb71930372..6c6ed114d9 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml index bf9d6ad8af..78d4d30016 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml index 53fd6b54b0..8bb0d53b76 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml @@ -21,7 +21,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml index acdc4badb5..b624f3d973 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml @@ -21,7 +21,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml index 23f3f6f474..ef3cd9fff2 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml @@ -21,7 +21,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml index f36daae10e..da55c0aaef 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml @@ -33,7 +33,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml index 825ccd78f4..3974d5bc58 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml @@ -35,7 +35,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml index b7f0a48864..270d41c831 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml index 95b01db2fb..2d1b729e69 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml index 842194caa3..6710818ee8 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-metadata.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-metadata.xml index b44b6bd9e1..5c5109404d 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-metadata.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-metadata.xml @@ -24,11 +24,14 @@
- + +
+ +
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml index f4ace39798..845cb09e9f 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml index f404ee7e38..6c8fda32af 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml index d713deaee4..eb50cc05ad 100644 --- a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml @@ -20,7 +20,9 @@
- + +
+ diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c index 641ddb33e3..93ab3800ce 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -64,6 +64,8 @@ mymain(void) # define DO_TEST_DIFFERENT(name) \ DO_TEST_FULL(name, true) + driver.bhyvecaps = BHYVE_CAP_AHCI32SLOT; + DO_TEST_DIFFERENT("acpiapic"); DO_TEST_DIFFERENT("base"); DO_TEST_DIFFERENT("bhyveload-bootorder");