* Fix "unused variable" warnings from Clang 15

* Allow building of guest-agent without emulators or tools
 * White space clean-ups
 * Fixes for typos in the documentation
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmNuI5YRHHRodXRoQHJl
 ZGhhdC5jb20ACgkQLtnXdP5wLbXfjRAAsUf7C77pVZj5VWpAVYSgHdYJ5WCfVQg3
 Nd4Yixyx8b6yhgY1Vv9OL/uuY04AAWifQn0AUnNBJKrOKcuvU3mHlE/s1imw9CUf
 tsX2gE1GAczQqp5dLL2/+FCMZOC/acFkjmA9LAdOfG7eKzodRdsq/ZaIXd2+MmfM
 nG972Zw0/ZJqQs+DtjwNYvgtywEmRqunKIaCaSwtGHWvot081yw1iW3PvgrKulEr
 v9SQhAurD+ZxcJSeTn3c8L//KYVyCUGQ0K/1cbBcyhPi7xMQar8j7xuCk7xZiOMW
 fvhCOSnjbntsf+xnE2VDlakKQvoY6r30Tl0dzSoH79uzGe+ZTPC+L6ly3tzJ0Vo6
 aslppY+8oYxLbJRX1Im8X0rxK6OqcVjjEXu3fVn8/C1WftIltuy3va2LZNZfQ8Bf
 +Yte3swzvFzgQE19c0HkgMd4uvfqGIkyprs1n2RjzZaI7cnQ4Ati/wQsOKCUrqrY
 VYsy3J1IypM7DO/cZ/JpdDV3PPTWv8JI8H2Agn2VhvY86N9ETn71RAj6UYqufW3W
 H3lMv7L6rU8c1tfcjbr0Xf811EwHekkIjyGt0aJ8MacJNkSc1A4pe+UUGVxNefue
 W0kT2htHQL1Q9JWjbKQuqT/rYrKUfqRDnd809YAzEVO7jpabS8g/hN3wBiaeZDgK
 LqLnITUBhRU=
 =H8p7
 -----END PGP SIGNATURE-----

Merge tag 'pull-request-2022-11-11' of https://gitlab.com/thuth/qemu into staging

* Fix "unused variable" warnings from Clang 15
* Allow building of guest-agent without emulators or tools
* White space clean-ups
* Fixes for typos in the documentation

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmNuI5YRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbXfjRAAsUf7C77pVZj5VWpAVYSgHdYJ5WCfVQg3
# Nd4Yixyx8b6yhgY1Vv9OL/uuY04AAWifQn0AUnNBJKrOKcuvU3mHlE/s1imw9CUf
# tsX2gE1GAczQqp5dLL2/+FCMZOC/acFkjmA9LAdOfG7eKzodRdsq/ZaIXd2+MmfM
# nG972Zw0/ZJqQs+DtjwNYvgtywEmRqunKIaCaSwtGHWvot081yw1iW3PvgrKulEr
# v9SQhAurD+ZxcJSeTn3c8L//KYVyCUGQ0K/1cbBcyhPi7xMQar8j7xuCk7xZiOMW
# fvhCOSnjbntsf+xnE2VDlakKQvoY6r30Tl0dzSoH79uzGe+ZTPC+L6ly3tzJ0Vo6
# aslppY+8oYxLbJRX1Im8X0rxK6OqcVjjEXu3fVn8/C1WftIltuy3va2LZNZfQ8Bf
# +Yte3swzvFzgQE19c0HkgMd4uvfqGIkyprs1n2RjzZaI7cnQ4Ati/wQsOKCUrqrY
# VYsy3J1IypM7DO/cZ/JpdDV3PPTWv8JI8H2Agn2VhvY86N9ETn71RAj6UYqufW3W
# H3lMv7L6rU8c1tfcjbr0Xf811EwHekkIjyGt0aJ8MacJNkSc1A4pe+UUGVxNefue
# W0kT2htHQL1Q9JWjbKQuqT/rYrKUfqRDnd809YAzEVO7jpabS8g/hN3wBiaeZDgK
# LqLnITUBhRU=
# =H8p7
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 11 Nov 2022 05:27:34 EST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2022-11-11' of https://gitlab.com/thuth/qemu:
  Fix several typos in documentation (found by codespell)
  net: Replace TAB indentations with spaces
  qga: Allow building of the guest agent without system emulators or tools
  libdecnumber/dpd/decimal64: Fix compiler warning from Clang 15
  host-libusb: Remove unused variable
  qemu-img: remove unused variable
  tulip: Remove unused variable
  rtl8139: Remove unused variable

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2022-11-11 11:44:48 -05:00
commit 6a4cff8e1a
24 changed files with 902 additions and 917 deletions

View File

@ -132,7 +132,7 @@ Under ``tests/avocado/`` as the root we have:
(a) They are python2.7 based scripts and not python 3 scripts.
(b) They are run from within the bios bits VM and is not subjected to QEMU
build/test python script maintainance and dependency resolutions.
build/test python script maintenance and dependency resolutions.
(c) They need not be loaded by avocado framework when running tests.

View File

@ -169,8 +169,9 @@ and with bitrate switch::
cangen can0 -b
The test can be run viceversa, generate messages in the guest system and capture them
in the host one and much more combinations.
The test can also be run the other way around, generating messages in the
guest system and capturing them in the host system. Other combinations are
also possible.
Links to other resources
------------------------

View File

@ -2156,7 +2156,6 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
ip_data_len, saved_size - ETH_HLEN, large_send_mss);
int tcp_send_offset = 0;
int send_count = 0;
/* maximum IP header length is 60 bytes */
uint8_t saved_ip_header[60];
@ -2261,7 +2260,6 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s)
/* add transferred count to TCP sequence number */
stl_be_p(&p_tcp_hdr->th_seq,
chunk_size + ldl_be_p(&p_tcp_hdr->th_seq));
++send_count;
}
/* Stop sending this frame */

View File

@ -870,11 +870,10 @@ static const MemoryRegionOps tulip_ops = {
static void tulip_idblock_crc(TULIPState *s, uint16_t *srom)
{
int word, n;
int word;
int bit;
unsigned char bitval, crc;
const int len = 9;
n = 0;
crc = -1;
for (word = 0; word < len; word++) {
@ -887,7 +886,6 @@ static void tulip_idblock_crc(TULIPState *s, uint16_t *srom)
srom[len - 1] = (srom[len - 1] & 0xff00) | (unsigned short)crc;
break;
}
n++;
bitval = ((srom[word] >> bit) & 1) ^ ((crc >> 7) & 1);
crc = crc << 1;
if (bitval == 1) {

View File

@ -515,7 +515,7 @@ static void do_dma_pdma_cb(ESPState *s)
} else {
/*
* Extra message out bytes received: update cmdfifo_cdb_offset
* and then switch to commmand phase
* and then switch to command phase
*/
s->cmdfifo_cdb_offset = fifo8_num_used(&s->cmdfifo);
s->rregs[ESP_RSTAT] = STAT_TC | STAT_CD;
@ -627,7 +627,7 @@ static void esp_do_dma(ESPState *s)
} else {
/*
* Extra message out bytes received: update cmdfifo_cdb_offset
* and then switch to commmand phase
* and then switch to command phase
*/
s->cmdfifo_cdb_offset = fifo8_num_used(&s->cmdfifo);
s->rregs[ESP_RSTAT] = STAT_TC | STAT_CD;
@ -738,7 +738,7 @@ static void esp_do_nodma(ESPState *s)
} else {
/*
* Extra message out bytes received: update cmdfifo_cdb_offset
* and then switch to commmand phase
* and then switch to command phase
*/
s->cmdfifo_cdb_offset = fifo8_num_used(&s->cmdfifo);
s->rregs[ESP_RSTAT] = STAT_TC | STAT_CD;

View File

@ -1837,7 +1837,6 @@ static void usb_host_auto_check(void *unused)
struct USBAutoFilter *f;
libusb_device **devs = NULL;
struct libusb_device_descriptor ddesc;
int unconnected = 0;
int i, n;
if (usb_host_init() != 0) {
@ -1897,9 +1896,6 @@ static void usb_host_auto_check(void *unused)
libusb_free_device_list(devs, 1);
QTAILQ_FOREACH(s, &hostdevs, next) {
if (s->dh == NULL) {
unconnected++;
}
if (s->seen == 0) {
if (s->dh) {
usb_host_close(s);
@ -1908,17 +1904,6 @@ static void usb_host_auto_check(void *unused)
}
s->seen = 0;
}
#if 0
if (unconnected == 0) {
/* nothing to watch */
if (usb_auto_timer) {
timer_del(usb_auto_timer);
trace_usb_host_auto_scan_disabled();
}
return;
}
#endif
}
if (!usb_vmstate) {

View File

@ -561,7 +561,7 @@ typedef void (*ReplayRamDiscard)(MemoryRegionSection *section, void *opaque);
* A #RamDiscardManager coordinates which parts of specific RAM #MemoryRegion
* regions are currently populated to be used/accessed by the VM, notifying
* after parts were discarded (freeing up memory) and before parts will be
* populated (consuming memory), to be used/acessed by the VM.
* populated (consuming memory), to be used/accessed by the VM.
*
* A #RamDiscardManager can only be set for a RAM #MemoryRegion while the
* #MemoryRegion isn't mapped yet; it cannot change while the #MemoryRegion is
@ -585,7 +585,7 @@ typedef void (*ReplayRamDiscard)(MemoryRegionSection *section, void *opaque);
* Listeners are called in multiples of the minimum granularity (unless it
* would exceed the registered range) and changes are aligned to the minimum
* granularity within the #MemoryRegion. Listeners have to prepare for memory
* becomming discarded in a different granularity than it was populated and the
* becoming discarded in a different granularity than it was populated and the
* other way around.
*/
struct RamDiscardManagerClass {
@ -1247,7 +1247,7 @@ void memory_region_init_ram_flags_nomigrate(MemoryRegion *mr,
Error **errp);
/**
* memory_region_init_resizeable_ram: Initialize memory region with resizeable
* memory_region_init_resizeable_ram: Initialize memory region with resizable
* RAM. Accesses into the region will
* modify memory directly. Only an initial
* portion of this RAM is actually used.

View File

@ -617,7 +617,6 @@ static const uInt multies[]={131073, 26215, 5243, 1049, 210};
#endif
void decDigitsToDPD(const decNumber *dn, uInt *targ, Int shift) {
Int cut; /* work */
Int n; /* output bunch counter */
Int digits=dn->digits; /* digit countdown */
uInt dpd; /* densely packed decimal value */
uInt bin; /* binary value 0-999 */
@ -676,7 +675,7 @@ void decDigitsToDPD(const decNumber *dn, uInt *targ, Int shift) {
bin=0; /* [keep compiler quiet] */
#endif
for(n=0; digits>0; n++) { /* each output bunch */
while (digits > 0) { /* each output bunch */
#if DECDPUN==3 /* fast path, 3-at-a-time */
bin=*inu; /* 3 digits ready for convert */
digits-=3; /* [may go negative] */

View File

@ -13,7 +13,7 @@ util_ss.add(files(
if have_system
util_ss.add(files('qapi-type-helpers.c'))
endif
if have_system or have_tools
if have_system or have_tools or have_ga
util_ss.add(files(
'qmp-dispatch.c',
'qmp-event.c',

View File

@ -321,7 +321,7 @@
# },
# "backend-features": {
# "dev-features": [
# "VHOST_USER_F_PROTOCOL_FEATURES: Vhost-user protocol features negotation supported",
# "VHOST_USER_F_PROTOCOL_FEATURES: Vhost-user protocol features negotiation supported",
# "VIRTIO_NET_F_GSO: Handling GSO-type packets supported",
# "VIRTIO_NET_F_CTRL_MAC_ADDR: MAC address set through control channel",
# "VIRTIO_NET_F_GUEST_ANNOUNCE: Driver sending gratuitous packets supported",
@ -394,7 +394,7 @@
# },
# "host-features": {
# "dev-features": [
# "VHOST_USER_F_PROTOCOL_FEATURES: Vhost-user protocol features negotation supported",
# "VHOST_USER_F_PROTOCOL_FEATURES: Vhost-user protocol features negotiation supported",
# "VIRTIO_NET_F_GSO: Handling GSO-type packets supported",
# "VIRTIO_NET_F_CTRL_MAC_ADDR: MAC address set through control channel",
# "VIRTIO_NET_F_GUEST_ANNOUNCE: Driver sending gratuitous packets supported",

View File

@ -4922,7 +4922,7 @@ static int img_dd(int argc, char **argv)
const char *out_fmt = "raw";
const char *fmt = NULL;
int64_t size = 0;
int64_t block_count = 0, out_pos, in_pos;
int64_t out_pos, in_pos;
bool force_share = false;
struct DdInfo dd = {
.flags = 0,
@ -5122,7 +5122,7 @@ static int img_dd(int argc, char **argv)
in.buf = g_new(uint8_t, in.bsz);
for (out_pos = 0; in_pos < size; block_count++) {
for (out_pos = 0; in_pos < size; ) {
int bytes = (in_pos + in.bsz > size) ? size - in_pos : in.bsz;
ret = blk_pread(blk1, in_pos, bytes, in.buf, 0);

View File

@ -139,7 +139,7 @@ SRST
interleave requirements before enabling the memory devices.
``targets.X=target`` provides the mapping to CXL host bridges
which may be identified by the id provied in the -device entry.
which may be identified by the id provided in the -device entry.
Multiple entries are needed to specify all the targets when
the fixed memory window represents interleaved memory. X is the
target index from 0.
@ -362,7 +362,7 @@ SRST
\
``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]``
\
``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=tpye[,latency=lat][,bandwidth=bw]``
``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=type[,latency=lat][,bandwidth=bw]``
\
``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]``
Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA
@ -1785,7 +1785,7 @@ SRST
directory on host is made directly accessible by guest as a pass-through
file system by using the 9P network protocol for communication between
host and guests, if desired even accessible, shared by several guests
simultaniously.
simultaneously.
Note that ``-virtfs`` is actually just a convenience shortcut for its
generalized form ``-fsdev -device virtio-9p-pci``.

View File

@ -49,7 +49,7 @@ stub_ss.add(files('vmstate.c'))
stub_ss.add(files('vm-stop.c'))
stub_ss.add(files('win32-kbd-hook.c'))
stub_ss.add(files('cpu-synchronize-state.c'))
if have_block
if have_block or have_ga
stub_ss.add(files('replay-tools.c'))
endif
if have_system

View File

@ -381,7 +381,7 @@ QOSGraphObject *qos_driver_new(QOSGraphNode *node, QOSGraphObject *parent,
* mind: only tests with a path down from the actual test case node (leaf) up
* to the graph's root node are actually executed by the qtest framework. And
* the qtest framework uses QMP to automatically check which QEMU drivers are
* actually currently available, and accordingly qos marks certain pathes as
* actually currently available, and accordingly qos marks certain paths as
* 'unavailable' in such cases (e.g. when QEMU was compiled without support for
* a certain feature).
*/

View File

@ -31,7 +31,7 @@
static QGuestAllocator *alloc;
static char *local_test_path;
/* Concatenates the passed 2 pathes. Returned result must be freed. */
/* Concatenates the passed 2 paths. Returned result must be freed. */
static char *concat_path(const char* a, const char* b)
{
return g_build_filename(a, b, NULL);

View File

@ -68,20 +68,25 @@ if have_system
util_ss.add(when: 'CONFIG_LINUX', if_true: files('userfaultfd.c'))
endif
if have_block
util_ss.add(files('aiocb.c', 'async.c', 'aio-wait.c'))
if have_block or have_ga
util_ss.add(files('aiocb.c', 'async.c'))
util_ss.add(files('base64.c'))
util_ss.add(files('lockcnt.c'))
util_ss.add(files('main-loop.c'))
util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-coroutine-io.c'))
util_ss.add(files('coroutine-@0@.c'.format(config_host['CONFIG_COROUTINE_BACKEND'])))
util_ss.add(files('thread-pool.c', 'qemu-timer.c'))
util_ss.add(files('qemu-sockets.c'))
endif
if have_block
util_ss.add(files('aio-wait.c'))
util_ss.add(files('buffer.c'))
util_ss.add(files('bufferiszero.c'))
util_ss.add(files('coroutine-@0@.c'.format(config_host['CONFIG_COROUTINE_BACKEND'])))
util_ss.add(files('hbitmap.c'))
util_ss.add(files('hexdump.c'))
util_ss.add(files('iova-tree.c'))
util_ss.add(files('iov.c', 'qemu-sockets.c', 'uri.c'))
util_ss.add(files('lockcnt.c'))
util_ss.add(files('main-loop.c'))
util_ss.add(files('iov.c', 'uri.c'))
util_ss.add(files('nvdimm-utils.c'))
util_ss.add(files('qemu-coroutine.c', 'qemu-coroutine-lock.c', 'qemu-coroutine-io.c'))
util_ss.add(when: 'CONFIG_LINUX', if_true: [
files('vhost-user-server.c'), vhost_user
])
@ -89,7 +94,6 @@ if have_block
util_ss.add(files('qemu-coroutine-sleep.c'))
util_ss.add(files('qemu-co-shared-resource.c'))
util_ss.add(files('qemu-co-timeout.c'))
util_ss.add(files('thread-pool.c', 'qemu-timer.c'))
util_ss.add(files('readline.c'))
util_ss.add(files('throttle.c'))
util_ss.add(files('timed-average.c'))