Skip to content

Conversation

@jasonbking
Copy link

No description provided.

@jasonbking jasonbking requested review from jlevon and papertigers June 3, 2020 21:21
if (snprintf(slotconf, sizeof (slotconf),
"%d:%d,virtio-net-viona,%s", PCI_SLOT_NICS, pcifn, net) >=
sizeof (slotconf)) {
if (pcibus > 0) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no way to avoid collisions here?

I can add a nic without pci_slot set and mark it primary and then add a 2nd one set to 0:6:0 an they will end up in the same slot. (Or am I missing a check for that somewhere?

pcibus, pcislot, pcifn, net);
} else {
ret = snprintf(slotconf, sizeof (slotconf),
"%u:%u,virtio-net-viona,%s", pcislot, pcifn, net);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also be explicitly set the bus to 0 while we're here?

6919:   bhyve -H -U 99e40ee7-a8f9-4b57-9225-e7bd19f64b07 -B 1,manufacturer=Joyent,produ
argv[0]: bhyve
argv[1]: -H
argv[2]: -U
argv[3]: 99e40ee7-a8f9-4b57-9225-e7bd19f64b07
argv[4]: -B
argv[5]: 1,manufacturer=Joyent,product=SmartDC HVM,version=7.20200529T085640Z,serial=99e40ee7-a8f9-4b57-9225-e7bd19f64b07,sku=001,family=Virtual Machine
argv[6]: -s
argv[7]: 31,lpc
argv[8]: -l
argv[9]: bootrom,/usr/share/bhyve/uefi-rom.bin
argv[10]: -l
argv[11]: com1,/dev/zconsole
argv[12]: -l
argv[13]: com2,socket,/tmp/vm.ttyb
argv[14]: -s
argv[15]: 0,hostbridge,model=i440fx
argv[16]: -c
argv[17]: 4
argv[18]: -m
argv[19]: 4096
argv[20]: -s
argv[21]: 0:4:0,virtio-blk,/dev/zvol/rdsk/zones/99e40ee7-a8f9-4b57-9225-e7bd19f64b07/disk0
argv[22]: -s
argv[23]: 6:0,virtio-net-viona,net0
argv[24]: -s
argv[25]: 6:1,virtio-net-viona,net1
argv[26]: -s
argv[27]: 6:2,virtio-net-viona,net2
argv[28]: -s
argv[29]: 6:3,virtio-net-viona,net3
argv[30]: -s
argv[31]: 6:4,virtio-net-viona,net4
argv[32]: -w
argv[33]: -c
argv[34]: sockets=1,cores=2,threads=2
argv[35]: SYSbhyve-12

Currently the nics are the only one that get passed without the bus, sure bhyve itself wil use 0 in that case. But given we pass it for all other arguments we add, we should be consistant.

@danmcd
Copy link

danmcd commented Oct 18, 2024

See TritonDataCenter/smartos-live#940 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants