2008-01-29 21:15:54 +03:00
# include <config.h>
2007-11-26 15:03:34 +03:00
2007-07-19 01:34:22 +04:00
# include <stdio.h>
2007-11-26 15:03:34 +03:00
# include <stdlib.h>
# include <unistd.h>
2007-07-19 01:34:22 +04:00
# include <string.h>
# include <sys/types.h>
# include <fcntl.h>
2013-04-16 17:41:44 +04:00
# include "testutils.h"
2007-11-26 15:03:34 +03:00
# ifdef WITH_QEMU
2010-03-09 21:22:22 +03:00
# include "internal.h"
2016-04-13 09:12:47 +03:00
# include "qemu / qemu_domain_address.h"
2011-07-11 21:29:09 +04:00
# include "qemu / qemu_domain.h"
2010-03-09 21:22:22 +03:00
# include "testutilsqemu.h"
2013-04-03 14:36:23 +04:00
# include "virstring.h"
2007-07-19 01:34:22 +04:00
2013-06-07 19:10:28 +04:00
# define VIR_FROM_THIS VIR_FROM_NONE
2012-11-28 20:43:10 +04:00
static virQEMUDriver driver ;
2007-07-19 01:34:22 +04:00
2015-03-23 19:24:43 +03:00
enum {
WHEN_INACTIVE = 1 ,
WHEN_ACTIVE = 2 ,
WHEN_BOTH = 3 ,
} ;
struct testInfo {
char * inName ;
char * outActiveName ;
char * outInactiveName ;
2016-01-08 06:50:05 +03:00
2016-07-01 11:30:53 +03:00
virBitmapPtr activeVcpus ;
2016-01-08 06:50:05 +03:00
virQEMUCapsPtr qemuCaps ;
2015-03-23 19:24:43 +03:00
} ;
2016-01-28 00:03:52 +03:00
static int
2016-07-01 11:30:53 +03:00
qemuXML2XMLActivePreFormatCallback ( virDomainDefPtr def ,
const void * opaque )
2016-01-28 00:03:52 +03:00
{
2016-07-01 11:30:53 +03:00
struct testInfo * info = ( struct testInfo * ) opaque ;
/* store vCPU bitmap so that the status XML can be created faithfully */
if ( ! info - > activeVcpus )
info - > activeVcpus = virDomainDefGetOnlineVcpumap ( def ) ;
2016-01-28 00:03:52 +03:00
return 0 ;
}
2015-03-23 19:24:43 +03:00
static int
testXML2XMLActive ( const void * opaque )
{
const struct testInfo * info = opaque ;
2016-01-08 23:55:44 +03:00
return testCompareDomXML2XMLFiles ( driver . caps , driver . xmlopt ,
2016-01-27 23:55:01 +03:00
info - > inName , info - > outActiveName , true ,
2016-07-01 11:30:53 +03:00
qemuXML2XMLActivePreFormatCallback ,
opaque , 0 ,
2016-04-08 19:04:10 +03:00
TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS ) ;
2015-03-23 19:24:43 +03:00
}
2010-07-25 02:18:18 +04:00
2011-04-25 02:25:10 +04:00
static int
2015-03-23 19:24:43 +03:00
testXML2XMLInactive ( const void * opaque )
2011-04-25 02:25:10 +04:00
{
2015-03-23 19:24:43 +03:00
const struct testInfo * info = opaque ;
2016-01-08 23:55:44 +03:00
return testCompareDomXML2XMLFiles ( driver . caps , driver . xmlopt , info - > inName ,
2016-01-27 23:55:01 +03:00
info - > outInactiveName , false ,
2016-07-01 11:30:53 +03:00
NULL , opaque , 0 ,
2016-04-08 19:04:10 +03:00
TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS ) ;
2015-03-23 19:24:43 +03:00
}
2010-07-25 02:18:18 +04:00
2015-03-23 19:24:43 +03:00
2016-07-01 11:30:53 +03:00
static const char testStatusXMLPrefixHeader [ ] =
2015-03-24 15:25:27 +03:00
" <domstatus state='running' reason='booted' pid='3803518'> \n "
" <taint flag='high-privileges'/> \n "
2016-07-01 11:30:53 +03:00
" <monitor path='/var/lib/libvirt/qemu/test.monitor' json='1' type='unix'/> \n " ;
static const char testStatusXMLPrefixFooter [ ] =
2015-03-24 15:25:27 +03:00
" <qemuCaps> \n "
" <flag name='vnet-hdr'/> \n "
" <flag name='qxl.vgamem_mb'/> \n "
" <flag name='qxl-vga.vgamem_mb'/> \n "
" <flag name='pc-dimm'/> \n "
" </qemuCaps> \n "
" <devices> \n "
" <device alias='balloon0'/> \n "
" <device alias='video0'/> \n "
" <device alias='serial0'/> \n "
" <device alias='net0'/> \n "
" <device alias='usb'/> \n "
2015-07-24 17:06:33 +03:00
" </devices> \n "
2016-02-26 11:15:55 +03:00
" <numad nodeset='0-2'/> \n "
" <libDir path='/tmp'/> \n "
" <channelTargetDir path='/tmp/channel'/> \n " ;
2015-03-24 15:25:27 +03:00
static const char testStatusXMLSuffix [ ] =
" </domstatus> \n " ;
2016-07-01 11:30:53 +03:00
static void
testGetStatuXMLPrefixVcpus ( virBufferPtr buf ,
const struct testInfo * data )
{
ssize_t vcpuid = - 1 ;
virBufferAddLit ( buf , " <vcpus> \n " ) ;
virBufferAdjustIndent ( buf , 2 ) ;
2016-07-25 11:33:03 +03:00
/* Make sure we can format the fake vcpu list. The test will fail regardles. */
if ( data - > activeVcpus ) {
while ( ( vcpuid = virBitmapNextSetBit ( data - > activeVcpus , vcpuid ) ) > = 0 )
virBufferAsprintf ( buf , " <vcpu id='%zd' pid='%zd'/> \n " ,
vcpuid , vcpuid + 3803519 ) ;
}
2016-07-01 11:30:53 +03:00
virBufferAdjustIndent ( buf , - 2 ) ;
virBufferAddLit ( buf , " </vcpus> \n " ) ;
}
static char *
testGetStatusXMLPrefix ( const struct testInfo * data )
{
virBuffer buf = VIR_BUFFER_INITIALIZER ;
virBufferAdd ( & buf , testStatusXMLPrefixHeader , - 1 ) ;
virBufferAdjustIndent ( & buf , 2 ) ;
testGetStatuXMLPrefixVcpus ( & buf , data ) ;
virBufferAdjustIndent ( & buf , - 2 ) ;
virBufferAdd ( & buf , testStatusXMLPrefixFooter , - 1 ) ;
return virBufferContentAndReset ( & buf ) ;
}
2015-03-24 15:25:27 +03:00
static int
testCompareStatusXMLToXMLFiles ( const void * opaque )
{
const struct testInfo * data = opaque ;
virBuffer buf = VIR_BUFFER_INITIALIZER ;
xmlDocPtr xml = NULL ;
virDomainObjPtr obj = NULL ;
char * expect = NULL ;
char * actual = NULL ;
char * source = NULL ;
2016-07-01 11:30:53 +03:00
char * header = NULL ;
2016-01-09 00:41:37 +03:00
char * inFile = NULL , * outActiveFile = NULL ;
2015-03-24 15:25:27 +03:00
int ret = - 1 ;
int keepBlanksDefault = xmlKeepBlanksDefault ( 0 ) ;
2016-05-26 18:01:52 +03:00
if ( virTestLoadFile ( data - > inName , & inFile ) < 0 )
2016-01-09 00:41:37 +03:00
goto cleanup ;
2016-05-26 18:01:52 +03:00
if ( virTestLoadFile ( data - > outActiveName , & outActiveFile ) < 0 )
2016-01-09 00:41:37 +03:00
goto cleanup ;
2016-07-01 11:30:53 +03:00
if ( ! ( header = testGetStatusXMLPrefix ( data ) ) )
goto cleanup ;
2015-03-24 15:25:27 +03:00
/* construct faked source status XML */
2016-07-01 11:30:53 +03:00
virBufferAdd ( & buf , header , - 1 ) ;
2015-03-24 15:25:27 +03:00
virBufferAdjustIndent ( & buf , 2 ) ;
2016-01-09 00:41:37 +03:00
virBufferAddStr ( & buf , inFile ) ;
2015-03-24 15:25:27 +03:00
virBufferAdjustIndent ( & buf , - 2 ) ;
virBufferAdd ( & buf , testStatusXMLSuffix , - 1 ) ;
if ( ! ( source = virBufferContentAndReset ( & buf ) ) ) {
2016-01-08 01:36:07 +03:00
VIR_TEST_DEBUG ( " Failed to create the source XML " ) ;
2015-03-24 15:25:27 +03:00
goto cleanup ;
}
/* construct the expect string */
2016-07-01 11:30:53 +03:00
virBufferAdd ( & buf , header , - 1 ) ;
2015-03-24 15:25:27 +03:00
virBufferAdjustIndent ( & buf , 2 ) ;
2016-01-09 00:41:37 +03:00
virBufferAddStr ( & buf , outActiveFile ) ;
2015-03-24 15:25:27 +03:00
virBufferAdjustIndent ( & buf , - 2 ) ;
virBufferAdd ( & buf , testStatusXMLSuffix , - 1 ) ;
if ( ! ( expect = virBufferContentAndReset ( & buf ) ) ) {
2016-01-08 01:36:07 +03:00
VIR_TEST_DEBUG ( " Failed to create the expect XML " ) ;
2015-03-24 15:25:27 +03:00
goto cleanup ;
}
/* parse the fake source status XML */
if ( ! ( xml = virXMLParseString ( source , " (domain_status_test_XML) " ) ) | |
! ( obj = virDomainObjParseNode ( xml , xmlDocGetRootElement ( xml ) ,
driver . caps , driver . xmlopt ,
VIR_DOMAIN_DEF_PARSE_STATUS |
VIR_DOMAIN_DEF_PARSE_ACTUAL_NET |
2015-09-15 15:08:52 +03:00
VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES ) ) ) {
2016-01-08 01:36:07 +03:00
VIR_TEST_DEBUG ( " Failed to parse domain status XML: \n %s " , source ) ;
2015-03-24 15:25:27 +03:00
goto cleanup ;
}
/* format it back */
2016-02-04 15:32:45 +03:00
if ( ! ( actual = virDomainObjFormat ( driver . xmlopt , obj , NULL ,
2015-03-24 15:25:27 +03:00
VIR_DOMAIN_DEF_FORMAT_SECURE ) ) ) {
2016-01-08 01:36:07 +03:00
VIR_TEST_DEBUG ( " Failed to format domain status XML " ) ;
2015-03-24 15:25:27 +03:00
goto cleanup ;
}
if ( STRNEQ ( actual , expect ) ) {
2015-12-10 15:40:54 +03:00
/* For status test we don't want to regenerate output to not
* add the status data . */
2016-05-26 18:02:01 +03:00
virTestDifferenceFullNoRegenerate ( stderr ,
expect , data - > outActiveName ,
actual , data - > inName ) ;
2015-03-24 15:25:27 +03:00
goto cleanup ;
}
ret = 0 ;
cleanup :
xmlKeepBlanksDefault ( keepBlanksDefault ) ;
xmlFreeDoc ( xml ) ;
virObjectUnref ( obj ) ;
VIR_FREE ( expect ) ;
VIR_FREE ( actual ) ;
VIR_FREE ( source ) ;
2016-01-09 00:41:37 +03:00
VIR_FREE ( inFile ) ;
2016-07-01 11:30:53 +03:00
VIR_FREE ( header ) ;
2016-01-09 00:41:37 +03:00
VIR_FREE ( outActiveFile ) ;
2015-03-24 15:25:27 +03:00
return ret ;
}
2015-03-23 19:24:43 +03:00
static void
testInfoFree ( struct testInfo * info )
{
VIR_FREE ( info - > inName ) ;
VIR_FREE ( info - > outActiveName ) ;
VIR_FREE ( info - > outInactiveName ) ;
2016-01-08 06:50:05 +03:00
2016-07-01 11:30:53 +03:00
virBitmapFree ( info - > activeVcpus ) ;
info - > activeVcpus = NULL ;
2016-01-08 06:50:05 +03:00
virObjectUnref ( info - > qemuCaps ) ;
2015-03-23 19:24:43 +03:00
}
static int
testInfoSet ( struct testInfo * info ,
const char * name ,
2016-05-10 12:35:43 +03:00
int when ,
int gic )
2015-03-23 19:24:43 +03:00
{
2016-01-08 06:50:05 +03:00
if ( ! ( info - > qemuCaps = virQEMUCapsNew ( ) ) )
goto error ;
2016-01-13 03:26:40 +03:00
virQEMUCapsSetList ( info - > qemuCaps ,
QEMU_CAPS_LAST ) ;
2016-05-10 12:35:43 +03:00
if ( testQemuCapsSetGIC ( info - > qemuCaps , gic ) < 0 )
goto error ;
2016-01-08 06:50:05 +03:00
if ( qemuTestCapsCacheInsert ( driver . qemuCapsCache , name ,
info - > qemuCaps ) < 0 )
goto error ;
2015-03-23 19:24:43 +03:00
if ( virAsprintf ( & info - > inName , " %s/qemuxml2argvdata/qemuxml2argv-%s.xml " ,
abs_srcdir , name ) < 0 )
goto error ;
if ( when & WHEN_INACTIVE ) {
2016-01-13 18:43:27 +03:00
if ( virAsprintf ( & info - > outInactiveName ,
" %s/qemuxml2xmloutdata/qemuxml2xmlout-%s-inactive.xml " ,
abs_srcdir , name ) < 0 )
goto error ;
2015-03-23 19:24:43 +03:00
2016-01-13 18:43:27 +03:00
if ( ! virFileExists ( info - > outInactiveName ) ) {
VIR_FREE ( info - > outInactiveName ) ;
2015-03-23 19:24:43 +03:00
2016-01-13 18:43:27 +03:00
if ( virAsprintf ( & info - > outInactiveName ,
" %s/qemuxml2xmloutdata/qemuxml2xmlout-%s.xml " ,
abs_srcdir , name ) < 0 )
2015-03-23 19:24:43 +03:00
goto error ;
}
2014-04-17 17:23:21 +04:00
}
2013-09-25 18:56:05 +04:00
2015-03-23 19:24:43 +03:00
if ( when & WHEN_ACTIVE ) {
2016-01-13 18:43:27 +03:00
if ( virAsprintf ( & info - > outActiveName ,
" %s/qemuxml2xmloutdata/qemuxml2xmlout-%s-active.xml " ,
abs_srcdir , name ) < 0 )
goto error ;
2015-03-23 19:24:43 +03:00
2016-01-13 18:43:27 +03:00
if ( ! virFileExists ( info - > outActiveName ) ) {
VIR_FREE ( info - > outActiveName ) ;
2015-03-23 19:24:43 +03:00
2016-01-13 18:43:27 +03:00
if ( virAsprintf ( & info - > outActiveName ,
" %s/qemuxml2xmloutdata/qemuxml2xmlout-%s.xml " ,
abs_srcdir , name ) < 0 )
2015-03-23 19:24:43 +03:00
goto error ;
}
2014-04-17 17:23:21 +04:00
}
2013-09-25 18:56:05 +04:00
2015-03-23 19:24:43 +03:00
return 0 ;
2010-07-25 02:18:18 +04:00
2015-03-23 19:24:43 +03:00
error :
testInfoFree ( info ) ;
return - 1 ;
2007-07-19 01:34:22 +04:00
}
2008-05-29 19:31:49 +04:00
static int
2011-04-29 20:21:20 +04:00
mymain ( void )
2007-07-19 01:34:22 +04:00
{
int ret = 0 ;
2015-03-23 19:24:43 +03:00
struct testInfo info ;
2016-04-26 15:27:16 +03:00
virQEMUDriverConfigPtr cfg = NULL ;
2008-02-27 07:35:08 +03:00
2016-07-01 11:30:53 +03:00
memset ( & info , 0 , sizeof ( info ) ) ;
2015-09-15 09:16:02 +03:00
if ( qemuTestDriverInit ( & driver ) < 0 )
2012-03-22 15:33:35 +04:00
return EXIT_FAILURE ;
2008-02-27 07:35:08 +03:00
2016-05-19 11:53:55 +03:00
cfg = virQEMUDriverGetConfig ( & driver ) ;
2015-09-15 09:16:02 +03:00
/* TODO: test with format probing disabled too */
driver . config - > allowDiskFormatProbing = true ;
2013-03-05 19:17:24 +04:00
2016-05-10 12:35:43 +03:00
# define DO_TEST_FULL(name, when, gic, ...) \
2015-03-23 19:24:43 +03:00
do { \
2016-05-10 12:35:43 +03:00
if ( testInfoSet ( & info , name , when , gic ) < 0 ) { \
2016-05-26 18:01:50 +03:00
VIR_TEST_DEBUG ( " Failed to generate test data for '%s' " , name ) ; \
2015-03-23 19:24:43 +03:00
return - 1 ; \
} \
2016-01-28 00:19:40 +03:00
virQEMUCapsSetList ( info . qemuCaps , __VA_ARGS__ , QEMU_CAPS_LAST ) ; \
2015-03-23 19:24:43 +03:00
\
if ( info . outInactiveName ) { \
2016-05-26 18:01:50 +03:00
if ( virTestRun ( " QEMU XML-2-XML-inactive " name , \
2015-03-23 19:24:43 +03:00
testXML2XMLInactive , & info ) < 0 ) \
ret = - 1 ; \
} \
\
if ( info . outActiveName ) { \
2016-05-26 18:01:50 +03:00
if ( virTestRun ( " QEMU XML-2-XML-active " name , \
2015-03-23 19:24:43 +03:00
testXML2XMLActive , & info ) < 0 ) \
2015-03-24 15:25:27 +03:00
ret = - 1 ; \
\
2016-05-26 18:01:50 +03:00
if ( virTestRun ( " QEMU XML-2-XML-status " name , \
2015-03-24 15:25:27 +03:00
testCompareStatusXMLToXMLFiles , & info ) < 0 ) \
2015-03-23 19:24:43 +03:00
ret = - 1 ; \
} \
testInfoFree ( & info ) ; \
2010-07-25 02:18:18 +04:00
} while ( 0 )
2016-01-28 00:19:40 +03:00
# define NONE QEMU_CAPS_LAST
2016-07-29 16:13:56 +03:00
# define DO_TEST(name, ...) \
DO_TEST_FULL ( name , WHEN_BOTH , GIC_NONE , __VA_ARGS__ )
2016-01-28 00:19:40 +03:00
2010-07-25 02:18:18 +04:00
/* Unset or set all envvars here that are copied in qemudBuildCommandLine
* using ADD_ENV_COPY , otherwise these tests may fail due to unexpected
* values for these envvars */
setenv ( " PATH " , " /bin " , 1 ) ;
2008-04-26 00:46:13 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " minimal " , NONE ) ;
DO_TEST ( " machine-core-on " , NONE ) ;
DO_TEST ( " machine-core-off " , NONE ) ;
DO_TEST ( " default-kvm-host-arch " , NONE ) ;
DO_TEST ( " default-qemu-host-arch " , NONE ) ;
DO_TEST ( " boot-cdrom " , NONE ) ;
DO_TEST ( " boot-network " , NONE ) ;
DO_TEST ( " boot-floppy " , NONE ) ;
DO_TEST ( " boot-multi " , NONE ) ;
DO_TEST ( " boot-menu-enable-with-timeout " , NONE ) ;
DO_TEST ( " boot-menu-disable " , NONE ) ;
DO_TEST ( " boot-menu-disable-with-timeout " , NONE ) ;
DO_TEST ( " boot-order " , NONE ) ;
DO_TEST ( " reboot-timeout-enabled " , NONE ) ;
DO_TEST ( " reboot-timeout-disabled " , NONE ) ;
DO_TEST ( " clock-utc " , NONE ) ;
DO_TEST ( " clock-localtime " , NONE ) ;
DO_TEST ( " cpu-empty " , NONE ) ;
DO_TEST ( " cpu-kvmclock " , NONE ) ;
DO_TEST ( " cpu-host-kvmclock " , NONE ) ;
DO_TEST ( " cpu-host-passthrough-features " , NONE ) ;
DO_TEST ( " cpu-host-model-features " , NONE ) ;
DO_TEST ( " clock-catchup " , NONE ) ;
DO_TEST ( " kvmclock " , NONE ) ;
DO_TEST ( " clock-timer-hyperv-rtc " , NONE ) ;
DO_TEST ( " cpu-eoi-disabled " , NONE ) ;
DO_TEST ( " cpu-eoi-enabled " , NONE ) ;
DO_TEST ( " eoi-disabled " , NONE ) ;
DO_TEST ( " eoi-enabled " , NONE ) ;
DO_TEST ( " pv-spinlock-disabled " , NONE ) ;
DO_TEST ( " pv-spinlock-enabled " , NONE ) ;
DO_TEST ( " hyperv " , NONE ) ;
DO_TEST ( " hyperv-off " , NONE ) ;
DO_TEST ( " hyperv-panic " , NONE ) ;
DO_TEST ( " kvm-features " , NONE ) ;
DO_TEST ( " kvm-features-off " , NONE ) ;
DO_TEST ( " pmu-feature " , NONE ) ;
DO_TEST ( " pmu-feature-off " , NONE ) ;
DO_TEST ( " hugepages " , NONE ) ;
DO_TEST ( " hugepages-pages " , NONE ) ;
DO_TEST ( " hugepages-pages2 " , NONE ) ;
DO_TEST ( " hugepages-pages3 " , NONE ) ;
DO_TEST ( " hugepages-shared " , NONE ) ;
DO_TEST ( " nosharepages " , NONE ) ;
DO_TEST ( " restore-v2 " , NONE ) ;
DO_TEST ( " migrate " , NONE ) ;
DO_TEST ( " qemu-ns-no-env " , NONE ) ;
DO_TEST ( " disk-aio " , NONE ) ;
DO_TEST ( " disk-cdrom " , NONE ) ;
DO_TEST ( " disk-cdrom-empty " , NONE ) ;
DO_TEST ( " disk-floppy " , NONE ) ;
DO_TEST ( " disk-many " , NONE ) ;
DO_TEST ( " disk-usb-device " , NONE ) ;
DO_TEST ( " disk-virtio " , NONE ) ;
DO_TEST ( " floppy-drive-fat " , NONE ) ;
DO_TEST ( " disk-drive-boot-disk " , NONE ) ;
DO_TEST ( " disk-drive-boot-cdrom " , NONE ) ;
DO_TEST ( " disk-drive-error-policy-stop " , NONE ) ;
DO_TEST ( " disk-drive-error-policy-enospace " , NONE ) ;
DO_TEST ( " disk-drive-error-policy-wreport-rignore " , NONE ) ;
DO_TEST ( " disk-drive-fmt-qcow " , NONE ) ;
DO_TEST ( " disk-drive-copy-on-read " , NONE ) ;
DO_TEST ( " disk-drive-cache-v2-wt " , NONE ) ;
DO_TEST ( " disk-drive-cache-v2-wb " , NONE ) ;
DO_TEST ( " disk-drive-cache-v2-none " , NONE ) ;
DO_TEST ( " disk-drive-cache-directsync " , NONE ) ;
DO_TEST ( " disk-drive-cache-unsafe " , NONE ) ;
DO_TEST ( " disk-drive-network-nbd " , NONE ) ;
DO_TEST ( " disk-drive-network-nbd-export " , NONE ) ;
DO_TEST ( " disk-drive-network-nbd-ipv6 " , NONE ) ;
DO_TEST ( " disk-drive-network-nbd-ipv6-export " , NONE ) ;
DO_TEST ( " disk-drive-network-nbd-unix " , NONE ) ;
DO_TEST ( " disk-drive-network-iscsi " , NONE ) ;
DO_TEST ( " disk-drive-network-iscsi-auth " , NONE ) ;
DO_TEST ( " disk-drive-network-gluster " , NONE ) ;
DO_TEST ( " disk-drive-network-rbd " , NONE ) ;
DO_TEST ( " disk-drive-network-rbd-auth " , NONE ) ;
DO_TEST ( " disk-drive-network-rbd-ipv6 " , NONE ) ;
DO_TEST ( " disk-drive-network-rbd-ceph-env " , NONE ) ;
DO_TEST ( " disk-drive-network-sheepdog " , NONE ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " disk-scsi-device " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_SCSI_LSI ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " disk-scsi-vscsi " , NONE ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " disk-scsi-virtio-scsi " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_VIRTIO_SCSI ) ;
DO_TEST ( " disk-virtio-scsi-num_queues " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_VIRTIO_SCSI ) ;
DO_TEST ( " disk-virtio-scsi-cmd_per_lun " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_VIRTIO_SCSI ) ;
DO_TEST ( " disk-virtio-scsi-max_sectors " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_VIRTIO_SCSI ) ;
DO_TEST ( " disk-virtio-scsi-ioeventfd " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_VIRTIO_SCSI ) ;
DO_TEST ( " disk-scsi-megasas " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_SCSI_MEGASAS ) ;
DO_TEST ( " disk-scsi-mptsas1068 " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_SCSI_MPTSAS1068 ,
QEMU_CAPS_SCSI_DISK_WWN ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " disk-mirror-old " , NONE ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " disk-mirror " , NONE ) ;
2016-05-10 12:35:43 +03:00
DO_TEST_FULL ( " disk-active-commit " , WHEN_ACTIVE , GIC_NONE , NONE ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " graphics-listen-network " , NONE ) ;
DO_TEST ( " graphics-vnc " , NONE ) ;
DO_TEST ( " graphics-vnc-websocket " , NONE ) ;
DO_TEST ( " graphics-vnc-sasl " , NONE ) ;
DO_TEST ( " graphics-vnc-tls " , NONE ) ;
DO_TEST ( " graphics-vnc-no-listen-attr " , NONE ) ;
DO_TEST ( " graphics-vnc-remove-generated-socket " , NONE ) ;
2016-05-19 11:53:55 +03:00
cfg - > vncAutoUnixSocket = true ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " graphics-vnc-auto-socket-cfg " , NONE ) ;
2016-05-19 11:53:55 +03:00
cfg - > vncAutoUnixSocket = false ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " graphics-vnc-socket " , NONE ) ;
DO_TEST ( " graphics-vnc-auto-socket " , NONE ) ;
DO_TEST ( " graphics-sdl " , NONE ) ;
DO_TEST ( " graphics-sdl-fullscreen " , NONE ) ;
DO_TEST ( " graphics-spice " , NONE ) ;
DO_TEST ( " graphics-spice-compression " , NONE ) ;
DO_TEST ( " graphics-spice-qxl-vga " , NONE ) ;
DO_TEST ( " graphics-spice-socket " , NONE ) ;
DO_TEST ( " graphics-spice-auto-socket " , NONE ) ;
2016-05-18 15:11:20 +03:00
cfg - > spiceAutoUnixSocket = true ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " graphics-spice-auto-socket-cfg " , NONE ) ;
2016-05-18 15:11:20 +03:00
cfg - > spiceAutoUnixSocket = false ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " nographics-vga " ,
QEMU_CAPS_DISPLAY ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " input-usbmouse " , NONE ) ;
DO_TEST ( " input-usbtablet " , NONE ) ;
DO_TEST ( " misc-acpi " , NONE ) ;
DO_TEST ( " misc-disable-s3 " , NONE ) ;
DO_TEST ( " misc-disable-suspends " , NONE ) ;
DO_TEST ( " misc-enable-s4 " , NONE ) ;
DO_TEST ( " misc-no-reboot " , NONE ) ;
DO_TEST ( " misc-uuid " , NONE ) ;
DO_TEST ( " net-vhostuser " , NONE ) ;
DO_TEST ( " net-user " , NONE ) ;
DO_TEST ( " net-virtio " , NONE ) ;
DO_TEST ( " net-virtio-device " , NONE ) ;
DO_TEST ( " net-virtio-disable-offloads " , NONE ) ;
DO_TEST ( " net-eth " , NONE ) ;
DO_TEST ( " net-eth-ifname " , NONE ) ;
DO_TEST ( " net-eth-hostip " , NONE ) ;
DO_TEST ( " net-virtio-network-portgroup " , NONE ) ;
2016-08-18 19:19:13 +03:00
DO_TEST ( " net-virtio-rxqueuesize " , NONE ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " net-hostdev " , NONE ) ;
DO_TEST ( " net-hostdev-vfio " , NONE ) ;
DO_TEST ( " net-midonet " , NONE ) ;
DO_TEST ( " net-openvswitch " , NONE ) ;
DO_TEST ( " sound " , NONE ) ;
DO_TEST ( " sound-device " , NONE ) ;
DO_TEST ( " watchdog " , NONE ) ;
DO_TEST ( " net-bandwidth " , NONE ) ;
DO_TEST ( " net-bandwidth2 " , NONE ) ;
DO_TEST ( " serial-vc " , NONE ) ;
DO_TEST ( " serial-pty " , NONE ) ;
DO_TEST ( " serial-dev " , NONE ) ;
DO_TEST ( " serial-file " , NONE ) ;
DO_TEST ( " serial-unix " , NONE ) ;
DO_TEST ( " serial-tcp " , NONE ) ;
DO_TEST ( " serial-udp " , NONE ) ;
DO_TEST ( " serial-tcp-telnet " , NONE ) ;
2016-06-14 22:52:37 +03:00
DO_TEST ( " serial-tcp-tlsx509-chardev " , NONE ) ;
2016-10-24 15:05:54 +03:00
DO_TEST ( " serial-tcp-tlsx509-chardev-notls " , NONE ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " serial-many " , NONE ) ;
DO_TEST ( " serial-spiceport " , NONE ) ;
DO_TEST ( " serial-spiceport-nospice " , NONE ) ;
DO_TEST ( " parallel-tcp " , NONE ) ;
DO_TEST ( " console-compat " , NONE ) ;
DO_TEST ( " console-compat2 " , NONE ) ;
DO_TEST ( " console-virtio-many " , NONE ) ;
DO_TEST ( " channel-guestfwd " , NONE ) ;
DO_TEST ( " channel-virtio " , NONE ) ;
DO_TEST ( " channel-virtio-state " , NONE ) ;
DO_TEST ( " hostdev-usb-address " , NONE ) ;
DO_TEST ( " hostdev-pci-address " , NONE ) ;
DO_TEST ( " hostdev-vfio " , NONE ) ;
DO_TEST ( " pci-rom " , NONE ) ;
DO_TEST ( " pci-serial-dev-chardev " , NONE ) ;
DO_TEST ( " encrypted-disk " , NONE ) ;
DO_TEST ( " encrypted-disk-usage " , NONE ) ;
DO_TEST ( " luks-disks " , NONE ) ;
DO_TEST ( " memtune " , NONE ) ;
DO_TEST ( " memtune-unlimited " , NONE ) ;
DO_TEST ( " blkiotune " , NONE ) ;
DO_TEST ( " blkiotune-device " , NONE ) ;
DO_TEST ( " cputune " , NONE ) ;
DO_TEST ( " cputune-zero-shares " , NONE ) ;
DO_TEST ( " cputune-iothreadsched " , NONE ) ;
DO_TEST ( " cputune-iothreadsched-zeropriority " , NONE ) ;
DO_TEST ( " cputune-numatune " , NONE ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " vcpu-placement-static " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE ) ;
2010-04-27 14:01:32 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " smp " , NONE ) ;
DO_TEST ( " iothreads " , NONE ) ;
DO_TEST ( " iothreads-ids " , NONE ) ;
DO_TEST ( " iothreads-ids-partial " , NONE ) ;
DO_TEST ( " cputune-iothreads " , NONE ) ;
DO_TEST ( " iothreads-disk " , NONE ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " iothreads-disk-virtio-ccw " ,
QEMU_CAPS_VIRTIO_CCW , QEMU_CAPS_VIRTIO_S390 ) ;
DO_TEST ( " iothreads-virtio-scsi-pci " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_VIRTIO_SCSI ) ;
DO_TEST ( " iothreads-virtio-scsi-ccw " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_VIRTIO_CCW ,
QEMU_CAPS_VIRTIO_S390 ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " lease " , NONE ) ;
DO_TEST ( " event_idx " , NONE ) ;
DO_TEST ( " vhost_queues " , NONE ) ;
DO_TEST ( " interface-driver " , NONE ) ;
DO_TEST ( " interface-server " , NONE ) ;
DO_TEST ( " virtio-lun " , NONE ) ;
2016-07-29 17:09:53 +03:00
DO_TEST ( " usb-none " , NONE ) ;
DO_TEST ( " usb-controller " , NONE ) ;
DO_TEST ( " usb-piix3-controller " ,
QEMU_CAPS_PIIX3_USB_UHCI ) ;
DO_TEST ( " usb-controller-default-q35 " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_PCI_OHCI , QEMU_CAPS_PIIX3_USB_UHCI ,
QEMU_CAPS_NEC_USB_XHCI ) ;
DO_TEST ( " usb-controller-explicit-q35 " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_PCI_OHCI , QEMU_CAPS_PIIX3_USB_UHCI ,
QEMU_CAPS_NEC_USB_XHCI ) ;
DO_TEST ( " ppc64-usb-controller " ,
QEMU_CAPS_PCI_OHCI ) ;
DO_TEST ( " ppc64-usb-controller-legacy " ,
QEMU_CAPS_PIIX3_USB_UHCI ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " usb-port-missing " , NONE ) ;
DO_TEST ( " usb-redir " , NONE ) ;
DO_TEST ( " usb-redir-filter " , NONE ) ;
DO_TEST ( " usb-redir-filter-version " , NONE ) ;
DO_TEST ( " blkdeviotune " , NONE ) ;
2016-09-19 16:52:10 +03:00
DO_TEST ( " blkdeviotune-max " , NONE ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " controller-usb-order " , NONE ) ;
2011-09-02 19:09:14 +04:00
2016-05-10 12:35:43 +03:00
DO_TEST_FULL ( " seclabel-dynamic-baselabel " , WHEN_INACTIVE , GIC_NONE , NONE ) ;
DO_TEST_FULL ( " seclabel-dynamic-override " , WHEN_INACTIVE , GIC_NONE , NONE ) ;
DO_TEST_FULL ( " seclabel-dynamic-labelskip " , WHEN_INACTIVE , GIC_NONE , NONE ) ;
DO_TEST_FULL ( " seclabel-dynamic-relabel " , WHEN_INACTIVE , GIC_NONE , NONE ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " seclabel-static " , NONE ) ;
2016-05-10 12:35:43 +03:00
DO_TEST_FULL ( " seclabel-static-labelskip " , WHEN_ACTIVE , GIC_NONE , NONE ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " seclabel-none " , NONE ) ;
DO_TEST ( " seclabel-dac-none " , NONE ) ;
DO_TEST ( " seclabel-dynamic-none " , NONE ) ;
DO_TEST ( " seclabel-device-multiple " , NONE ) ;
2016-05-10 12:35:43 +03:00
DO_TEST_FULL ( " seclabel-dynamic-none-relabel " , WHEN_INACTIVE , GIC_NONE , NONE ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " numad-static-vcpu-no-numatune " , NONE ) ;
2011-12-23 04:47:46 +04:00
2016-07-29 16:27:03 +03:00
DO_TEST ( " disk-scsi-lun-passthrough-sgio " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_SCSI_CD , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_DISK_WWN ) ;
DO_TEST ( " disk-scsi-disk-vpd " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_SCSI_CD , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_DISK_WWN ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " disk-source-pool " , NONE ) ;
DO_TEST ( " disk-source-pool-mode " , NONE ) ;
2012-12-06 14:23:02 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " disk-drive-discard " , NONE ) ;
DO_TEST ( " disk-drive-detect-zeroes " , NONE ) ;
2013-05-14 16:44:54 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " virtio-rng-random " , NONE ) ;
DO_TEST ( " virtio-rng-egd " , NONE ) ;
2013-02-12 20:56:00 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " pseries-nvram " , NONE ) ;
DO_TEST ( " pseries-panic-missing " , NONE ) ;
DO_TEST ( " pseries-panic-no-address " , NONE ) ;
2013-04-25 12:46:04 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " balloon-device-auto " , NONE ) ;
DO_TEST ( " balloon-device-period " , NONE ) ;
DO_TEST ( " channel-virtio-auto " , NONE ) ;
DO_TEST ( " console-compat-auto " , NONE ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " disk-scsi-device-auto " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_SCSI_LSI ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " console-virtio " , NONE ) ;
DO_TEST ( " serial-target-port-auto " , NONE ) ;
DO_TEST ( " graphics-listen-network2 " , NONE ) ;
DO_TEST ( " graphics-spice-timeout " , NONE ) ;
DO_TEST ( " numad-auto-vcpu-no-numatune " , NONE ) ;
DO_TEST ( " numad-auto-memory-vcpu-no-cpuset-and-placement " , NONE ) ;
DO_TEST ( " numad-auto-memory-vcpu-cpuset " , NONE ) ;
DO_TEST ( " usb-ich9-ehci-addr " , NONE ) ;
DO_TEST ( " disk-copy_on_read " , NONE ) ;
DO_TEST ( " tpm-passthrough " , NONE ) ;
DO_TEST ( " metadata " , NONE ) ;
DO_TEST ( " metadata-duplicate " , NONE ) ;
2012-01-24 06:26:18 +04:00
2016-07-29 16:27:03 +03:00
DO_TEST ( " pci-bridge " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE ) ;
DO_TEST ( " pci-bridge-many-disks " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE ) ;
DO_TEST ( " pci-autoadd-addr " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE ) ;
DO_TEST ( " pci-autoadd-idx " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE ) ;
2016-07-29 16:13:56 +03:00
DO_TEST ( " pci-autofill-addr " , NONE ) ;
2016-01-28 00:03:52 +03:00
2016-07-29 16:27:03 +03:00
DO_TEST ( " q35 " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_ICH9_AHCI , QEMU_CAPS_PCI_MULTIFUNCTION ,
QEMU_CAPS_ICH9_USB_EHCI1 , QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " q35-usb2 " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_ICH9_AHCI ,
QEMU_CAPS_PCI_MULTIFUNCTION , QEMU_CAPS_ICH9_USB_EHCI1 ,
QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " q35-usb2-multi " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_ICH9_AHCI , QEMU_CAPS_PCI_MULTIFUNCTION ,
QEMU_CAPS_ICH9_USB_EHCI1 , QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " q35-usb2-reorder " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_ICH9_AHCI , QEMU_CAPS_PCI_MULTIFUNCTION ,
QEMU_CAPS_ICH9_USB_EHCI1 , QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " pcie-root " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_IOH3420 , QEMU_CAPS_ICH9_AHCI ,
2016-10-11 18:46:39 +03:00
QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " pcie-root-port " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_IOH3420 , QEMU_CAPS_ICH9_AHCI ,
2016-10-11 18:46:39 +03:00
QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " pcie-switch-upstream-port " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_IOH3420 , QEMU_CAPS_ICH9_AHCI ,
2016-10-11 18:46:39 +03:00
QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " pcie-switch-downstream-port " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_IOH3420 , QEMU_CAPS_ICH9_AHCI ,
2016-10-11 18:46:39 +03:00
QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " pci-expander-bus " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_PXB ) ;
DO_TEST ( " pcie-expander-bus " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_IOH3420 , QEMU_CAPS_DEVICE_X3130_UPSTREAM ,
QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM , QEMU_CAPS_DEVICE_PXB_PCIE ) ;
DO_TEST ( " autoindex " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_IOH3420 , QEMU_CAPS_DEVICE_X3130_UPSTREAM ,
QEMU_CAPS_DEVICE_XIO3130_DOWNSTREAM , QEMU_CAPS_ICH9_AHCI ,
QEMU_CAPS_PCI_MULTIFUNCTION , QEMU_CAPS_ICH9_USB_EHCI1 ,
QEMU_CAPS_NEC_USB_XHCI ) ;
2016-10-12 18:02:37 +03:00
/* Make sure the user can always override libvirt's default device
* placement policy by providing an explicit PCI address */
DO_TEST ( " q35-pci-force-address " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_IOH3420 ,
QEMU_CAPS_HDA_DUPLEX ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " hostdev-scsi-lsi " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-virtio-scsi " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-readonly " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-shareable " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-sgio " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-rawio " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-autogen-address " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-large-unit " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-lsi-iscsi " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-lsi-iscsi-auth " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-virtio-iscsi " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " hostdev-scsi-virtio-iscsi-auth " ,
QEMU_CAPS_VIRTIO_SCSI , QEMU_CAPS_SCSI_LSI ,
QEMU_CAPS_DEVICE_SCSI_GENERIC ) ;
DO_TEST ( " s390-defaultconsole " ,
QEMU_CAPS_VIRTIO_CCW , QEMU_CAPS_VIRTIO_S390 ) ;
DO_TEST ( " s390-panic " ,
QEMU_CAPS_VIRTIO_CCW , QEMU_CAPS_VIRTIO_S390 ) ;
DO_TEST ( " s390-panic-missing " ,
QEMU_CAPS_VIRTIO_CCW , QEMU_CAPS_VIRTIO_S390 ) ;
DO_TEST ( " s390-panic-no-address " ,
QEMU_CAPS_VIRTIO_CCW , QEMU_CAPS_VIRTIO_S390 ) ;
2013-06-17 18:17:36 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " pcihole64 " , NONE ) ;
DO_TEST ( " pcihole64-gib " , NONE ) ;
DO_TEST ( " pcihole64-none " , NONE ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " pcihole64-q35 " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ,
QEMU_CAPS_ICH9_AHCI , QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
2016-10-11 18:42:37 +03:00
QEMU_CAPS_DEVICE_QXL ,
2016-07-29 16:27:03 +03:00
QEMU_CAPS_Q35_PCI_HOLE64_SIZE ) ;
2013-08-12 15:39:04 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " panic " , NONE ) ;
DO_TEST ( " panic-isa " , NONE ) ;
DO_TEST ( " panic-pseries " , NONE ) ;
DO_TEST ( " panic-double " , NONE ) ;
DO_TEST ( " panic-no-address " , NONE ) ;
2013-12-09 13:11:15 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " disk-backing-chains " , NONE ) ;
2014-04-17 17:37:51 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " chardev-label " , NONE ) ;
2014-05-16 16:31:28 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " cpu-numa1 " , NONE ) ;
DO_TEST ( " cpu-numa2 " , NONE ) ;
DO_TEST ( " cpu-numa-no-memory-element " , NONE ) ;
DO_TEST ( " cpu-numa-disordered " , NONE ) ;
DO_TEST ( " cpu-numa-disjoint " , NONE ) ;
DO_TEST ( " cpu-numa-memshared " , NONE ) ;
2014-05-22 11:13:05 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " numatune-auto-prefer " , NONE ) ;
DO_TEST ( " numatune-memnode " , NONE ) ;
DO_TEST ( " numatune-memnode-no-memory " , NONE ) ;
2014-06-09 17:00:22 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " bios-nvram " , NONE ) ;
DO_TEST ( " bios-nvram-os-interleave " , NONE ) ;
2014-08-06 15:18:53 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " tap-vhost " , NONE ) ;
DO_TEST ( " tap-vhost-incorrect " , NONE ) ;
DO_TEST ( " shmem " , NONE ) ;
DO_TEST ( " smbios " , NONE ) ;
DO_TEST ( " smbios-multiple-type2 " , NONE ) ;
2014-09-11 19:11:28 +04:00
2016-07-29 16:27:03 +03:00
DO_TEST ( " aarch64-aavmf-virtio-mmio " ,
2016-01-28 01:47:14 +03:00
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_DTB ,
QEMU_CAPS_DEVICE_VIRTIO_MMIO ,
QEMU_CAPS_DEVICE_VIRTIO_RNG , QEMU_CAPS_OBJECT_RNG_RANDOM ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " aarch64-virtio-pci-default " ,
2016-01-28 01:47:14 +03:00
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_DTB ,
QEMU_CAPS_DEVICE_VIRTIO_MMIO ,
QEMU_CAPS_DEVICE_VIRTIO_RNG , QEMU_CAPS_OBJECT_RNG_RANDOM ,
QEMU_CAPS_OBJECT_GPEX , QEMU_CAPS_DEVICE_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE , QEMU_CAPS_VIRTIO_SCSI ) ;
2016-07-29 16:27:03 +03:00
DO_TEST ( " aarch64-virtio-pci-manual-addresses " ,
2016-01-28 01:47:14 +03:00
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_DTB ,
QEMU_CAPS_DEVICE_VIRTIO_MMIO ,
QEMU_CAPS_DEVICE_VIRTIO_RNG , QEMU_CAPS_OBJECT_RNG_RANDOM ,
QEMU_CAPS_OBJECT_GPEX , QEMU_CAPS_DEVICE_PCI_BRIDGE ,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE , QEMU_CAPS_VIRTIO_SCSI ) ;
qemu: map "virtio" video model to "virt" machtype correctly (arm/aarch64)
Most of QEMU's PCI display device models, such as:
libvirt video/model/@type QEMU -device
------------------------- ------------
cirrus cirrus-vga
vga VGA
qxl qxl-vga
virtio virtio-vga
come with a linear framebuffer (sometimes called "VGA compatibility
framebuffer"). This linear framebuffer lives in one of the PCI device's
MMIO BARs, and allows guest code (primarily: firmware drivers, and
non-accelerated OS drivers) to display graphics with direct memory access.
Due to architectural reasons on aarch64/KVM hosts, this kind of
framebuffer doesn't / can't work in
qemu-system-(arm|aarch64) -M virt
machines. Cache coherency issues guarantee a corrupted / unusable display.
The problem has been researched by several people, including kvm-arm
maintainers, and it's been decided that the best way (practically the only
way) to have boot time graphics for such guests is to consolidate on
QEMU's "virtio-gpu-pci" device.
>From <https://bugzilla.redhat.com/show_bug.cgi?id=1195176>, libvirt
supports
<devices>
<video>
<model type='virtio'/>
</video>
</devices>
but libvirt unconditionally maps @type='virtio' to QEMU's "virtio-vga"
device model. (See the qemuBuildDeviceVideoStr() function and the
"qemuDeviceVideo" enum impl.)
According to the above, this is not right for the "virt" machine type; the
qemu-system-(arm|aarch64) binaries don't even recognize the "virtio-vga"
device model (justifiedly). Whereas "virtio-gpu-pci", which is a pure
virtio device without a compatibility framebuffer, is available, and works
fine.
(The ArmVirtQemu ("AAVMF") platform of edk2 -- that is, the UEFI firmware
for "virt" -- supports "virtio-gpu-pci", as of upstream commit
3ef3209d3028. See
<https://tianocore.acgmultimedia.com/show_bug.cgi?id=66>.)
Override the default mapping of "virtio", from "virtio-vga" to
"virtio-gpu-pci", if qemuDomainMachineIsVirt() evaluates to true.
Cc: Andrea Bolognani <abologna@redhat.com>
Cc: Drew Jones <drjones@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Martin Kletzander <mkletzan@redhat.com>
Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1372901
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Martin Kletzander <mkletzan@redhat.com>
2016-09-16 10:30:23 +03:00
DO_TEST ( " aarch64-video-virtio-gpu-pci " ,
QEMU_CAPS_NODEFCONFIG , QEMU_CAPS_OBJECT_GPEX ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_IOH3420 ,
QEMU_CAPS_PCI_MULTIFUNCTION , QEMU_CAPS_DEVICE_VIDEO_PRIMARY ,
QEMU_CAPS_DEVICE_VIRTIO_GPU , QEMU_CAPS_BOOTINDEX ) ;
2016-02-03 16:35:41 +03:00
2016-05-10 13:36:10 +03:00
DO_TEST_FULL ( " aarch64-gic-none " , WHEN_BOTH , GIC_NONE , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-none-v2 " , WHEN_BOTH , GIC_V2 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-none-v3 " , WHEN_BOTH , GIC_V3 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-none-both " , WHEN_BOTH , GIC_BOTH , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-default " , WHEN_BOTH , GIC_NONE , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-default " , WHEN_BOTH , GIC_V2 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-default " , WHEN_BOTH , GIC_V3 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-default " , WHEN_BOTH , GIC_BOTH , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-v2 " , WHEN_BOTH , GIC_NONE , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-v2 " , WHEN_BOTH , GIC_V2 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-v2 " , WHEN_BOTH , GIC_V3 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-v2 " , WHEN_BOTH , GIC_BOTH , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-v3 " , WHEN_BOTH , GIC_NONE , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-v3 " , WHEN_BOTH , GIC_V2 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-v3 " , WHEN_BOTH , GIC_V3 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-v3 " , WHEN_BOTH , GIC_BOTH , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-host " , WHEN_BOTH , GIC_NONE , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-host " , WHEN_BOTH , GIC_V2 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-host " , WHEN_BOTH , GIC_V3 , NONE ) ;
DO_TEST_FULL ( " aarch64-gic-host " , WHEN_BOTH , GIC_BOTH , NONE ) ;
2015-09-30 17:36:24 +03:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " memory-hotplug " , NONE ) ;
DO_TEST ( " memory-hotplug-nonuma " , NONE ) ;
DO_TEST ( " memory-hotplug-dimm " , NONE ) ;
DO_TEST ( " net-udp " , NONE ) ;
2014-10-06 16:18:37 +04:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " video-virtio-gpu-device " , NONE ) ;
DO_TEST ( " video-virtio-gpu-virgl " , NONE ) ;
DO_TEST ( " video-virtio-gpu-spice-gl " , NONE ) ;
DO_TEST ( " virtio-input " , NONE ) ;
DO_TEST ( " virtio-input-passthrough " , NONE ) ;
2015-11-25 11:42:32 +03:00
2016-04-26 15:27:16 +03:00
virObjectUnref ( cfg ) ;
2016-04-18 18:13:02 +03:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " acpi-table " , NONE ) ;
2016-04-18 18:13:02 +03:00
2016-07-29 16:13:56 +03:00
DO_TEST ( " video-qxl-heads " , NONE ) ;
DO_TEST ( " video-qxl-noheads " , NONE ) ;
2016-10-10 21:19:06 +03:00
DO_TEST ( " video-virtio-gpu-secondary " , NONE ) ;
2015-12-11 16:43:10 +03:00
2016-07-29 16:27:03 +03:00
DO_TEST ( " intel-iommu " ,
QEMU_CAPS_DEVICE_PCI_BRIDGE , QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE ) ;
2016-06-22 17:28:22 +03:00
2015-09-15 09:16:02 +03:00
qemuTestDriverFree ( & driver ) ;
2007-07-19 01:34:22 +04:00
2014-03-17 13:38:38 +04:00
return ret = = 0 ? EXIT_SUCCESS : EXIT_FAILURE ;
2007-07-19 01:34:22 +04:00
}
2008-05-29 19:31:49 +04:00
VIRT_TEST_MAIN ( mymain )
2007-11-26 15:03:34 +03:00
# else
2011-07-28 19:48:12 +04:00
int
main ( void )
{
return EXIT_AM_SKIP ;
}
2007-11-26 15:03:34 +03:00
# endif /* WITH_QEMU */