Instead of including the same list of devices for each target,
set CONFIG_PCI to true, and make the devices default to present
whenever PCI is available. However, s390x does not want all the
PCI devices, so there is a separate symbol to enable them.
Done mostly with the following script:
while read i; do
i=${i%=y}; i=${i#CONFIG_}
sed -i -e'/^config '$i'$/!b' -en \
-e'a\' -e' default y if PCI_DEVICES\' -e' depends on PCI' \
`grep -lw $i hw/*/Kconfig`
done < default-configs/pci.mak
followed by replacing a few "depends on" clauses with "select"
whenever the symbol is not really related to PCI.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190123065618.3520-31-yang.zhong@intel.com>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Make pcie splited from pci and make it configurable.
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190123065618.3520-30-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190123065618.3520-29-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Devices that are mostly used for testing purposes (for example in
endianness-test) will be moved under a new symbol CONFIG_TEST_DEVICES
that can be disabled in the default-configs file. This makes
it easier to drop this code from QEMU if desirable.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Apart from defconfig (which is a no-op),
allyesconfig/allnoconfig/randcondfig can be implemented simply by ignoring
the RHS of assignments and "default" statements. The RHS is replaced
respectively by "true", "false" or a random value.
However, allyesconfig and randconfig do not quite work, because all the
files for hw/ARCH/Kconfig are sourced and therefore you could end up
enabling some ARM boards in x86 or things like that. This is left for
future work, but I am leaving it in to help debugging minikconf itself.
allnoconfig mode is tied to a new configure option, --without-default-devices.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The make_device_config.sh script is replaced by minikconf, which
is modified to support the same command line as its predecessor.
The roots of the parsing are default-configs/*.mak, Kconfig.host and
hw/Kconfig. One difference with make_device_config.sh is that all symbols
have to be defined in a Kconfig file, including those coming from the
configure script. This is the reason for the Kconfig.host file introduced
in the previous patch. Whenever a file in default-configs/*.mak used
$(...) to refer to a config-host.mak symbol, this is replaced by a
Kconfig dependency; this part must be done already in this patch
for bisectability.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190123065618.3520-28-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The Kconfig files were generated mostly with this script:
for i in `grep -ho CONFIG_[A-Z0-9_]* default-configs/* | sort -u`; do
set fnord `git grep -lw $i -- 'hw/*/Makefile.objs' `
shift
if test $# = 1; then
cat >> $(dirname $1)/Kconfig << EOF
config ${i#CONFIG_}
bool
EOF
git add $(dirname $1)/Kconfig
else
echo $i $*
fi
done
sed -i '$d' hw/*/Kconfig
for i in hw/*; do
if test -d $i && ! test -f $i/Kconfig; then
touch $i/Kconfig
git add $i/Kconfig
fi
done
Whenever a symbol is referenced from multiple subdirectories, the
script prints the list of directories that reference the symbol.
These symbols have to be added manually to the Kconfig files.
Kconfig.host and hw/Kconfig were created manually.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20190123065618.3520-27-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Use CONFIG_EDID to make edid-generate.c and edid-region.c
configurable.
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20190123065618.3520-26-yang.zhong@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
There are three parts in the semantic analysis:
1) evaluating expressions. This is done as a simple visit
of the Expr nodes.
2) ordering clauses. This is done by constructing a graph of variables.
There is an edge from X to Y if Y depends on X, if X selects Y, or if
X appears in a conditional selection of Y; in other words, if the value
of X can affect the value of Y. Each clause has a "destination" variable
whose value can be affected by the clause, and clauses will be processed
according to a topological sorting of their destination variables.
Defaults are processed after all other clauses with the same destination.
3) deriving the value of the variables. This is done by processing
the clauses in the topological order provided by the previous step.
A "depends on" clause will force a variable to False, a "select" clause
will force a variable to True, an assignment will force a variable
to its RHS. A default will set a variable to its RHS if it has not
been set before. Because all variables have a default, after visiting
all clauses all variables will have been set.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20190123065618.3520-25-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add Python classes that represent the Kconfig abstract syntax tree.
The abstract syntax tree is stored as a list of clauses. For example:
config FOO
depends on BAR
select BAZ
is represented as three clauses:
FOO depends on BAR
FOO default n
select BAZ if FOO
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20190123065618.3520-24-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This implements a scanner and recursive descent parser for Kconfig-like
configuration files. The only "action" of the parser is for now to
detect undefined variables and process include files.
The main differences between Kconfig and this are:
* only the "bool" type is supported
* variables can only be defined once
* choices are not supported (but they could be added as syntactic
sugar for multiple Boolean values)
* menus and other graphical concepts (prompts, help text) are not
supported
* assignments ("CONFIG_FOO=y", "CONFIG_FOO=n") are parsed as part
of the Kconfig language, not as a separate file.
The idea was originally by Ákos Kovács, but I could not find his
implementation so I had to redo it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20190123065618.3520-23-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The VIRTIO_9P || VIRTFS && XEN condition can be computed in hw/Makefile.objs,
removing an "if" from hw/9pfs/Makefile.objs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Some functions sometimes uses req->dev even though a local variable
VirtIOBlock* s = req->dev has already been defined.
Updated places to use s everywhere in the file.
Signed-off-by: Anastasiia Rusakova <arusakova917@gmail.com>
Message-id: 20190307161925.4158-1-rusakova.nastasia@icloud.com
Message-Id: <20190307161925.4158-1-rusakova.nastasia@icloud.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This patch adds the "S:" line for areas of the codebase that currently
lack a support status field.
Note that there are a few more areas that are more abstract and do not
correspond to a specific set of files. They have not been modified.
Cc: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190301163518.20702-1-stefanha@redhat.com
Message-Id: <20190301163518.20702-1-stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Convert tests/megasas-test to a driver node; the code to discover the PCI
device is replaced by generic qgraph code.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/e1000-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/eepro100-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
For now, all nodes share the same constructor and destructor.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/es1370-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/vmxnet3-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/usb-hcd-ohci-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/spapr-phb-test to a qgraph test node,
spapr-phb-test. This test adds another
spapr-pci-host-bridge device in the
ppc64/pseries machine
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/pcnet-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/nvme-test to a driver node; the code to discover the PCI
device is replaced by generic qgraph code, therefore we're not placing it in tests/libqos.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/ne2000-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
The actual device consumed by the test is ne2k_pci.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/ipoctal232-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
This test creates a tpci200 node that produces an interface ipack
consumed by the ipoctal232 device.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/tpci200-test to a driver node; currently it runs
the PCI nop test only, but it also produces the ipack interface.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/ac97-test to a driver node; currently it runs
the PCI nop test only, therefore we're not placing it in tests/libqos.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The only remaining test that needs libqos-virtio-obj-y is drive_del-test,
which really only needs a function. Move that function to the test
and remove libqos-virtio-obj-y.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Remove the qvirtio_pci_device_find* and qvirtio_pci_device_free
APIs, now that they do not have any users.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/virtio-scsi-test in qgraph test node,
virtio-scsi-test. This test consumes a virtio-scsi interface
and checks that its function return the expected values.
Some functions are implemented only for virtio-scsi-pci, so they
don't consume virtio-scsi, but virtio-scsi-pci
Note that this test does not allocate any virtio-scsi structure,
it's all done by the qtest walking graph mechanism
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add qgraph nodes for virtio-scsi-pci and virtio-scsi-device.
Both nodes produce virtio-scsi, but virtio-scsi-pci receives
a pci-bus and uses virtio-pci QOSGraphObject and its functions,
while virtio-scsi-device receives a virtio and implements
its own functions
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/virtio-net-test in qgraph test node,
virtio-net-test. This test consumes a virtio-net interface
and checks that its function return the expected values.
Note that this test does not allocate any virtio-net structure,
it's all done by the qtest walking graph mechanism. Nevertheless,
vhost-user-test is a bit more complex than the other tests, because
it requires more complicated setup of back-ends and thus almost each
test has a slightly different opts.before function.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Some tests are using a small amount of RAM for the guest (2 MiB) in order to
save host memory, others are using 512 MiB.
However, pSeries machines only support multiples of 256 MiB. Using 256
MiB of memory does not use more host memory than now, even for the
migration test that starts two guests, and it allows running the test on
pSeries too.
This of course is not optimal, it would be nice to let the qgraph machine object
judge how much memory to provide. This is left for future work, together
with a more generic framework that wraps the QEMU command line.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Initialize the additional virtqueues if they are supported.
This is needed to switch vhost-user-test's multiqueue test
to the virtio-net qgraph.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/virtio-net-test in qgraph test node,
virtio-net-test. This test consumes a virtio-net interface
and checks that its function return the expected values.
Some functions are implemented only for virtio-net-pci, so they
don't consume virtio-net, but virtio-net-pci
Note that this test does not allocate any virtio-net structure,
it's all done by the qtest walking graph mechanism
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add qgraph nodes for virtio-net-pci and virtio-net-device.
Both nodes produce virtio-net, but virtio-net-pci receives
a pci-bus and overrides virtio-pci QOSGraphObject and its functions,
while virtio-net-device receives a virtio and implements
its own functions
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/virtio-blk-test in qgraph test node,
virtio-blk-test. This test consumes a virtio-blk interface
and checks that its function return the expected values.
Some functions are implemented only for virtio-blk-pci, so they
don't consume virtio-blk, but virtio-blk-pci
Note that this test does not allocate any virtio-blk structure,
it's all done by the qtest walking graph mechanism. The allocator
is also provided by qgraph; remove malloc-generic.c and malloc-generic.h
which are not used anymore.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add qgraph nodes for virtio-blk-pci and virtio-blk-device.
Both nodes produce virtio-blk, but virtio-blk-pci receives
a pci-bus and uses virtio-pci QOSGraphObject and functions,
while virtio-blk-device receives a virtio and implements
its own functions
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/virtio-rng-test in qgraph test node,
virtio-rng-test. This test consumes a virtio-rng interface
and checks that its function return the expected values.
Some functions are implemented only for virtio-rng-pci, so they
don't consume virtio-rng, but virtio-rng-pci
Note that this test does not allocate any virtio-rng structure,
it's all done by the qtest walking graph mechanism
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add qgraph nodes for virtio-rng-pci and virtio-rng-device.
Both nodes produce virtio-rng, but virtio-rng-pci receives
a pci-bus and uses virtio-pci QOSGraphObject and functions,
while virtio-rng-device receives a virtio and implements
its own functions
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The tests/virtio-balloon-test is covered by generic virtio tests,
so remove it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Add qgraph nodes for virtio-balloon-pci and virtio-balloon-device.
Both nodes produce virtio-balloon, but virtio-balloon-pci receives
a pci-bus and uses virtio-pci QOSGraphObject and functions,
while virtio-balloon-device receives a virtio and implements
its own functions
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/virtio-9p-test into a qgraph test node.
This test consumes a virtio-9p interface and checks that its functions
return the expected values.
Note that this test does not allocate any virtio-9p structure,
it's all done by the qtest walking graph mechanism
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add qgraph nodes for virtio-9p-pci and virtio-9p-device.
Both nodes produce virtio-9p, but virtio-9p-pci receives
a pci-bus and overrides virtio-pci QOSGraphObject and its functions,
while virtio-9p-device receives a virtio and implements
its own functions
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Convert tests/virtio-console-test and tests/virtio-serial-test
in qgraph test node. This test consumes a virtio-serial interface
and checks that its function return the expected values.
Note that this test does not allocate any virtio-console or
virtio-serial structure, it's all done by the qtest walking graph mechanism
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add qgraph nodes for virtio-serial-pci and virtio-serial-device.
Both nodes produce virtio-serial, but virtio-serial-pci receives
a pci-bus and uses virtio-pci QOSGraphObject and functions,
while virtio-serial-device receives a virtio-bus and implements
its own functions
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add arm/virt machine to the graph. This machine contains virtio-mmio, so
its constructor must take care of setting it properly when called.
Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>