for (i = 0; i < def->nserials; i++) {
chr = def->serials[i];
- /* bhyve supports only two ports: com1 and com2 */
- if (chr->target.port > 2) {
+ /* bhyve supports 4 ports: com1, com2, com3, com4 */
+ if (chr->target.port > 3) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("only two serial ports are supported"));
return -1;
--- /dev/null
+bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 1:0,lpc \
+-s 2:0,ahci,hd:/tmp/freebsd.img \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:b1:42:eb \
+-l com1,/dev/nmdmdf3be7e7-a104-11e3-aeb0-50e5492bd3dcA \
+-l com2,tcp=127.0.0.1:12345 \
+-l com3,tcp=0.0.0.0:54321 \
+-l com4,/dev/nmdm0A \
+bhyve
--- /dev/null
+bhyveload \
+-m 214 \
+-d /tmp/freebsd.img \
+bhyve
--- /dev/null
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b1:42:eb'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ <serial type='nmdm'/>
+ <serial type='tcp'>
+ <source mode='bind' host='127.0.0.1' service='12345'/>
+ <protocol type="raw"/>
+ </serial>
+ <serial type='tcp'>
+ <source mode='bind' host='0.0.0.0' service='54321'/>
+ <protocol type="raw"/>
+ </serial>
+ <serial type='nmdm'>
+ <source master="/dev/nmdm0A" slave="/dev/nmdm0B"/>
+ </serial>
+ </devices>
+</domain>
--- /dev/null
+bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 1:0,lpc \
+-s 2:0,ahci,hd:/tmp/freebsd.img \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:b1:42:eb \
+-l com1,tcp=127.0.0.1:12345 \
+bhyve
--- /dev/null
+bhyveload \
+-m 214 \
+-d /tmp/freebsd.img \
+bhyve
--- /dev/null
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>1</vcpu>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b1:42:eb'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ <serial type='tcp'>
+ <source mode='connect' host='127.0.0.1' service='12345'/>
+ <protocol type="raw"/>
+ <target port="4"/>
+ </serial>
+ </devices>
+</domain>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='tcp'>
- <source mode='connect' host='127.0.0.1' service='12345'/>
+ <source mode='bind' host='127.0.0.1' service='12345'/>
<protocol type="raw"/>
</serial>
</devices>
driver.bhyvecaps &= ~BHYVE_CAP_VIRTIO_RND;
DO_TEST_FAILURE("virtio-rnd");
DO_TEST("serial-tcp");
+ DO_TEST("4-consoles");
+ DO_TEST_FAILURE("serial-invalid-port");
/* Address allocation tests */
DO_TEST("addr-single-sata-disk");
--- /dev/null
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <disk type='file' device='disk'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='isa' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
+ </controller>
+ <controller type='sata' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </controller>
+ <interface type='bridge'>
+ <mac address='52:54:00:b1:42:eb'/>
+ <source bridge='virbr0'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ <serial type='nmdm'>
+ <source master='/dev/nmdmdf3be7e7-a104-11e3-aeb0-50e5492bd3dcA' slave='/dev/nmdmdf3be7e7-a104-11e3-aeb0-50e5492bd3dcB'/>
+ <target port='0'/>
+ </serial>
+ <serial type='tcp'>
+ <source mode='bind' host='127.0.0.1' service='12345'/>
+ <protocol type='raw'/>
+ <target port='1'/>
+ </serial>
+ <serial type='tcp'>
+ <source mode='bind' host='0.0.0.0' service='54321'/>
+ <protocol type='raw'/>
+ <target port='2'/>
+ </serial>
+ <serial type='nmdm'>
+ <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+ <target port='3'/>
+ </serial>
+ <console type='nmdm'>
+ <source master='/dev/nmdmdf3be7e7-a104-11e3-aeb0-50e5492bd3dcA' slave='/dev/nmdmdf3be7e7-a104-11e3-aeb0-50e5492bd3dcB'/>
+ <target type='serial' port='0'/>
+ </console>
+ </devices>
+</domain>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='tcp'>
- <source mode='connect' host='127.0.0.1' service='12345'/>
+ <source mode='bind' host='127.0.0.1' service='12345'/>
<protocol type='raw'/>
<target port='0'/>
</serial>
<console type='tcp'>
- <source mode='connect' host='127.0.0.1' service='12345'/>
+ <source mode='bind' host='127.0.0.1' service='12345'/>
<protocol type='raw'/>
<target type='serial' port='0'/>
</console>
DO_TEST_DIFFERENT("fs-9p");
DO_TEST_DIFFERENT("virtio-rnd");
DO_TEST_DIFFERENT("serial-tcp");
+ DO_TEST_DIFFERENT("4-consoles");
/* Address allocation tests */
DO_TEST_DIFFERENT("addr-single-sata-disk");