_("unsupported disk device"));
return -1;
}
+
+ if (disk->rotation_rate)
+ virBufferAsprintf(&device, ",nmrr=%u", disk->rotation_rate);
+
virBufferAddBuffer(&buf, &device);
}
return -1;
}
}
+ } else if (dev->type == VIR_DOMAIN_DEVICE_DISK &&
+ dev->data.disk->rotation_rate &&
+ dev->data.disk->bus != VIR_DOMAIN_DISK_BUS_SATA) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("rotation rate is only valid for SATA bus"));
+ return -1;
}
return 0;
--- /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='vda' bus='virtio' rotation_rate='10000'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:bc:85:fe'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
--- /dev/null
+bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 2:0,ahci,hd:/tmp/freebsd1.img,nmrr=7200,hd:/tmp/freebsd2.img,nmrr=5400,hd:/tmp/freebsd3.img,nmrr=1 \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
+bhyve
--- /dev/null
+bhyveload \
+-m 214 \
+-d /tmp/freebsd1.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/freebsd1.img'/>
+ <target dev='hda' bus='sata' rotation_rate='7200'/>
+ </disk>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd2.img'/>
+ <target dev='hdb' bus='sata' rotation_rate='5400'/>
+ </disk>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd3.img'/>
+ <target dev='hdc' bus='sata' rotation_rate='1'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ </interface>
+ </devices>
+</domain>
DO_TEST("nvme");
DO_TEST("2-nvme-2-controllers");
DO_TEST_FAILURE("2-nvme-same-controller");
+ DO_TEST("sata-rotation-rate");
+ DO_TEST_FAILURE("disk-virtio-rotation-rate");
/* Address allocation tests */
DO_TEST("addr-single-sata-disk");