Skip to content

Commit 5f99210

Browse files
committed
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* -smp cleanpus * Hyper-V englightenment functionality * Documentation cleanups # gpg: Signature made Fri 01 Oct 2021 01:11:00 PM EDT # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "[email protected]" # gpg: Good signature from "Paolo Bonzini <[email protected]>" [full] # gpg: aka "Paolo Bonzini <[email protected]>" [full] * remotes/bonzini/tags/for-upstream: (29 commits) docs: reorganize testing.rst docs: move gcov section at the end of testing.rst docs: reorganize tcg-plugins.rst docs: reorganize qgraph.rst docs: put "make" information together in build-system.rst docs: move notes inside the body of the document docs: name included files ".rst.inc" i386: Change the default Hyper-V version to match WS2016 i386: Make Hyper-V version id configurable i386: Implement pseudo 'hv-avic' ('hv-apicv') enlightenment i386: Move HV_APIC_ACCESS_RECOMMENDED bit setting to hyperv_fill_cpuids() i386: Support KVM_CAP_HYPERV_ENFORCE_CPUID i386: Support KVM_CAP_ENFORCE_PV_FEATURE_CPUID machine: Put all sanity-check in the generic SMP parser machine: Use g_autoptr in machine_set_smp machine: Move smp_prefer_sockets to struct SMPCompatProps machine: Remove smp_parse callback from MachineClass machine: Make smp_parse generic enough for all arches machine: Tweak the order of topology members in struct CpuTopology machine: Use ms instead of global current_machine in sanity-check ... Signed-off-by: Richard Henderson <[email protected]>
2 parents bb4aa8f + 16e79e1 commit 5f99210

26 files changed

+547
-388
lines changed

docs/about/deprecated.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,21 @@ Use ``-display sdl`` instead.
160160

161161
Use ``-display curses`` instead.
162162

163+
``-smp`` ("parameter=0" SMP configurations) (since 6.2)
164+
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
165+
166+
Specified CPU topology parameters must be greater than zero.
167+
168+
In the SMP configuration, users should either provide a CPU topology
169+
parameter with a reasonable value (greater than zero) or just omit it
170+
and QEMU will compute the missing value.
171+
172+
However, historically it was implicitly allowed for users to provide
173+
a parameter with zero value, which is meaningless and could also possibly
174+
cause unexpected results in the -smp parsing. So support for this kind of
175+
configurations (e.g. -smp 8,sockets=0) is deprecated since 6.2 and will
176+
be removed in the near future, users have to ensure that all the topology
177+
members described with -smp are greater than zero.
163178

164179
Plugin argument passing through ``arg=<string>`` (since 6.1)
165180
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

docs/devel/build-system.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,16 @@ phony target, while benchmarks are run with ``make bench``. Meson test
380380
suites such as ``unit`` can be ran with ``make check-unit`` too. It is also
381381
possible to run tests defined in meson.build with ``meson test``.
382382

383+
Useful make targets
384+
-------------------
385+
386+
``help``
387+
Print a help message for the most common build targets.
388+
389+
``print-VAR``
390+
Print the value of the variable VAR. Useful for debugging the build
391+
system.
392+
383393
Important files for the build system
384394
====================================
385395

@@ -473,14 +483,3 @@ Built by Makefile:
473483
meson.build. The rules are produced from Meson's JSON description of
474484
tests (obtained with "meson introspect --tests") through the script
475485
scripts/mtest2make.py.
476-
477-
478-
Useful make targets
479-
-------------------
480-
481-
``help``
482-
Print a help message for the most common build targets.
483-
484-
``print-VAR``
485-
Print the value of the variable VAR. Useful for debugging the build
486-
system.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/devel/ci.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ found at::
88

99
https://wiki.qemu.org/Testing/CI
1010

11-
.. include:: ci-definitions.rst
12-
.. include:: ci-jobs.rst
13-
.. include:: ci-runners.rst
11+
.. include:: ci-definitions.rst.inc
12+
.. include:: ci-jobs.rst.inc
13+
.. include:: ci-runners.rst.inc

docs/devel/multi-process.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
This is the design document for multi-process QEMU. It does not
2-
necessarily reflect the status of the current implementation, which
3-
may lack features or be considerably different from what is described
4-
in this document. This document is still useful as a description of
5-
the goals and general direction of this feature.
6-
7-
Please refer to the following wiki for latest details:
8-
https://wiki.qemu.org/Features/MultiProcessQEMU
9-
101
Multi-process QEMU
112
===================
123

4+
.. note::
5+
6+
This is the design document for multi-process QEMU. It does not
7+
necessarily reflect the status of the current implementation, which
8+
may lack features or be considerably different from what is described
9+
in this document. This document is still useful as a description of
10+
the goals and general direction of this feature.
11+
12+
Please refer to the following wiki for latest details:
13+
https://wiki.qemu.org/Features/MultiProcessQEMU
14+
1315
QEMU is often used as the hypervisor for virtual machines running in the
1416
Oracle cloud. Since one of the advantages of cloud computing is the
1517
ability to run many VMs from different tenants in the same cloud

docs/devel/qgraph.rst

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
.. _qgraph:
22

3-
========================================
43
Qtest Driver Framework
5-
========================================
4+
======================
65

76
In order to test a specific driver, plain libqos tests need to
87
take care of booting QEMU with the right machine and devices.
@@ -31,13 +30,15 @@ so the sdhci-test should only care of linking its qgraph node with
3130
that interface. In this way, if the command line of a sdhci driver
3231
is changed, only the respective qgraph driver node has to be adjusted.
3332

33+
QGraph concepts
34+
---------------
35+
3436
The graph is composed by nodes that represent machines, drivers, tests
3537
and edges that define the relationships between them (``CONSUMES``, ``PRODUCES``, and
3638
``CONTAINS``).
3739

38-
3940
Nodes
40-
^^^^^^
41+
~~~~~
4142

4243
A node can be of four types:
4344

@@ -64,7 +65,7 @@ Notes for the nodes:
6465
drivers name, otherwise they won't be discovered
6566

6667
Edges
67-
^^^^^^
68+
~~~~~
6869

6970
An edge relation between two nodes (drivers or machines) ``X`` and ``Y`` can be:
7071

@@ -73,7 +74,7 @@ An edge relation between two nodes (drivers or machines) ``X`` and ``Y`` can be:
7374
- ``X CONTAINS Y``: ``Y`` is part of ``X`` component
7475

7576
Execution steps
76-
^^^^^^^^^^^^^^^
77+
~~~~~~~~~~~~~~~
7778

7879
The basic framework steps are the following:
7980

@@ -92,8 +93,64 @@ The basic framework steps are the following:
9293
Depending on the QEMU binary used, only some drivers/machines will be
9394
available and only test that are reached by them will be executed.
9495

96+
Command line
97+
~~~~~~~~~~~~
98+
99+
Command line is built by using node names and optional arguments
100+
passed by the user when building the edges.
101+
102+
There are three types of command line arguments:
103+
104+
- ``in node`` : created from the node name. For example, machines will
105+
have ``-M <machine>`` to its command line, while devices
106+
``-device <device>``. It is automatically done by the framework.
107+
- ``after node`` : added as additional argument to the node name.
108+
This argument is added optionally when creating edges,
109+
by setting the parameter ``after_cmd_line`` and
110+
``extra_edge_opts`` in ``QOSGraphEdgeOptions``.
111+
The framework automatically adds
112+
a comma before ``extra_edge_opts``,
113+
because it is going to add attributes
114+
after the destination node pointed by
115+
the edge containing these options, and automatically
116+
adds a space before ``after_cmd_line``, because it
117+
adds an additional device, not an attribute.
118+
- ``before node`` : added as additional argument to the node name.
119+
This argument is added optionally when creating edges,
120+
by setting the parameter ``before_cmd_line`` in
121+
``QOSGraphEdgeOptions``. This attribute
122+
is going to add attributes before the destination node
123+
pointed by the edge containing these options. It is
124+
helpful to commands that are not node-representable,
125+
such as ``-fdsev`` or ``-netdev``.
126+
127+
While adding command line in edges is always used, not all nodes names are
128+
used in every path walk: this is because the contained or produced ones
129+
are already added by QEMU, so only nodes that "consumes" will be used to
130+
build the command line. Also, nodes that will have ``{ "abstract" : true }``
131+
as QMP attribute will loose their command line, since they are not proper
132+
devices to be added in QEMU.
133+
134+
Example::
135+
136+
QOSGraphEdgeOptions opts = {
137+
.before_cmd_line = "-drive id=drv0,if=none,file=null-co://,"
138+
"file.read-zeroes=on,format=raw",
139+
.after_cmd_line = "-device scsi-hd,bus=vs0.0,drive=drv0",
140+
141+
opts.extra_device_opts = "id=vs0";
142+
};
143+
144+
qos_node_create_driver("virtio-scsi-device",
145+
virtio_scsi_device_create);
146+
qos_node_consumes("virtio-scsi-device", "virtio-bus", &opts);
147+
148+
Will produce the following command line:
149+
``-drive id=drv0,if=none,file=null-co://, -device virtio-scsi-device,id=vs0 -device scsi-hd,bus=vs0.0,drive=drv0``
150+
95151
Troubleshooting unavailable tests
96-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153+
97154
If there is no path from an available machine to a test then that test will be
98155
unavailable and won't execute. This can happen if a test or driver did not set
99156
up its qgraph node correctly. It can also happen if the necessary machine type
@@ -151,7 +208,7 @@ Typically this is because the QEMU binary lacks support for the necessary
151208
machine type or device.
152209

153210
Creating a new driver and its interface
154-
"""""""""""""""""""""""""""""""""""""""""
211+
---------------------------------------
155212

156213
Here we continue the ``sdhci`` use case, with the following scenario:
157214

@@ -489,7 +546,7 @@ or inverting the consumes edge in consumed_by::
489546
arm/raspi2b --contains--> generic-sdhci
490547

491548
Adding a new test
492-
"""""""""""""""""
549+
-----------------
493550

494551
Given the above setup, adding a new test is very simple.
495552
``sdhci-test``, taken from ``tests/qtest/sdhci-test.c``::
@@ -565,62 +622,7 @@ and for the binary ``QTEST_QEMU_BINARY=./qemu-system-arm``:
565622

566623
Additional examples are also in ``test-qgraph.c``
567624

568-
Command line:
569-
""""""""""""""
570-
571-
Command line is built by using node names and optional arguments
572-
passed by the user when building the edges.
573-
574-
There are three types of command line arguments:
575-
576-
- ``in node`` : created from the node name. For example, machines will
577-
have ``-M <machine>`` to its command line, while devices
578-
``-device <device>``. It is automatically done by the framework.
579-
- ``after node`` : added as additional argument to the node name.
580-
This argument is added optionally when creating edges,
581-
by setting the parameter ``after_cmd_line`` and
582-
``extra_edge_opts`` in ``QOSGraphEdgeOptions``.
583-
The framework automatically adds
584-
a comma before ``extra_edge_opts``,
585-
because it is going to add attributes
586-
after the destination node pointed by
587-
the edge containing these options, and automatically
588-
adds a space before ``after_cmd_line``, because it
589-
adds an additional device, not an attribute.
590-
- ``before node`` : added as additional argument to the node name.
591-
This argument is added optionally when creating edges,
592-
by setting the parameter ``before_cmd_line`` in
593-
``QOSGraphEdgeOptions``. This attribute
594-
is going to add attributes before the destination node
595-
pointed by the edge containing these options. It is
596-
helpful to commands that are not node-representable,
597-
such as ``-fdsev`` or ``-netdev``.
598-
599-
While adding command line in edges is always used, not all nodes names are
600-
used in every path walk: this is because the contained or produced ones
601-
are already added by QEMU, so only nodes that "consumes" will be used to
602-
build the command line. Also, nodes that will have ``{ "abstract" : true }``
603-
as QMP attribute will loose their command line, since they are not proper
604-
devices to be added in QEMU.
605-
606-
Example::
607-
608-
QOSGraphEdgeOptions opts = {
609-
.before_cmd_line = "-drive id=drv0,if=none,file=null-co://,"
610-
"file.read-zeroes=on,format=raw",
611-
.after_cmd_line = "-device scsi-hd,bus=vs0.0,drive=drv0",
612-
613-
opts.extra_device_opts = "id=vs0";
614-
};
615-
616-
qos_node_create_driver("virtio-scsi-device",
617-
virtio_scsi_device_create);
618-
qos_node_consumes("virtio-scsi-device", "virtio-bus", &opts);
619-
620-
Will produce the following command line:
621-
``-drive id=drv0,if=none,file=null-co://, -device virtio-scsi-device,id=vs0 -device scsi-hd,bus=vs0.0,drive=drv0``
622-
623625
Qgraph API reference
624-
^^^^^^^^^^^^^^^^^^^^
626+
--------------------
625627

626628
.. kernel-doc:: tests/qtest/libqos/qgraph.h

0 commit comments

Comments
 (0)