Misc HW / migration / typo fixes

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmk4gN0ACgkQ4+MsLN6t
 wN6wPw/9EiBPEumIFhsGQZdB4pZZBgjBgOilkazeVaitWwfjhZGWTB6l5O0+aEmH
 jCeK2AAUZEashB/CrGI9irQ8Zli/CGgzV8/pF25AHDnDFyhCwR2czxeVDiZtMmcE
 tOYfjqs57/85r0OiQHHzqgp7w25p/p0Toz5g9GR+7Wu8xFi5SkHVM2gblSViz9ks
 JY+RLnQN4KKessqFKwGJb/m6cnBUWTf3DCscD/j+Crb9OI3WQpz2DsbQaZ06NHR7
 hlPzQ05taMhIqh6OdRAGqGS7Mud+eQ58k9qkYGuSBUkuBoJ/3/EqHJXQ4blZt9IN
 reJ6EtN+xYTT+BGBhIXmAtIVERzyk1MF99hgUZJW0RDuE4Ioa7Omp5bnv82Yensz
 UledFAMrGpX25SlJG2oNGnqZTYnCYoQnRQTB90AlaluJqHSpSgBBoJyfukjKQDVa
 NmL+sJOthonvGsydJP8IYfmcBUC1AzmXFxzN+/xZOSJe1qmSh1kUaehsbyytdd/C
 tgyav8DsvxXR8rfYBX5bSml8pAKL5pSD0DYJD3LCyvRoC0SnYROFU1kaUfMpPA+/
 H1r0RO5Lzkcub1JW253gA89GfrK0Y7ShMtoJ+GBivH/cK+ZYT4uEAZajcgUi5kJJ
 FSWz/sNxOJ03s3CWQhlPOEnkLQ41/1+eqbLpmWceRIAfOmmXE00=
 =vcUd
 -----END PGP SIGNATURE-----

Merge tag 'hw-misc-20251209' of https://github.com/philmd/qemu into staging

Misc HW / migration / typo fixes

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmk4gN0ACgkQ4+MsLN6t
# wN6wPw/9EiBPEumIFhsGQZdB4pZZBgjBgOilkazeVaitWwfjhZGWTB6l5O0+aEmH
# jCeK2AAUZEashB/CrGI9irQ8Zli/CGgzV8/pF25AHDnDFyhCwR2czxeVDiZtMmcE
# tOYfjqs57/85r0OiQHHzqgp7w25p/p0Toz5g9GR+7Wu8xFi5SkHVM2gblSViz9ks
# JY+RLnQN4KKessqFKwGJb/m6cnBUWTf3DCscD/j+Crb9OI3WQpz2DsbQaZ06NHR7
# hlPzQ05taMhIqh6OdRAGqGS7Mud+eQ58k9qkYGuSBUkuBoJ/3/EqHJXQ4blZt9IN
# reJ6EtN+xYTT+BGBhIXmAtIVERzyk1MF99hgUZJW0RDuE4Ioa7Omp5bnv82Yensz
# UledFAMrGpX25SlJG2oNGnqZTYnCYoQnRQTB90AlaluJqHSpSgBBoJyfukjKQDVa
# NmL+sJOthonvGsydJP8IYfmcBUC1AzmXFxzN+/xZOSJe1qmSh1kUaehsbyytdd/C
# tgyav8DsvxXR8rfYBX5bSml8pAKL5pSD0DYJD3LCyvRoC0SnYROFU1kaUfMpPA+/
# H1r0RO5Lzkcub1JW253gA89GfrK0Y7ShMtoJ+GBivH/cK+ZYT4uEAZajcgUi5kJJ
# FSWz/sNxOJ03s3CWQhlPOEnkLQ41/1+eqbLpmWceRIAfOmmXE00=
# =vcUd
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 09 Dec 2025 02:04:45 PM CST
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'hw-misc-20251209' of https://github.com/philmd/qemu:
  Revert "hw/net/virtio-net: make VirtIONet.vlans an array instead of a pointer"
  Revert "migration/vmstate: remove VMSTATE_BUFFER_POINTER_UNSAFE macro"
  Fix const qualifier build errors with recent glibc
  scripts/nsis.py: Tell makensis that WoA is 64 bit
  hw/pci: Fix typo in documentation
  migration: Fix order of function arguments
  vhost: Always initialize cached vring data
  scripts: fix broken error path in modinfo-collect.py
  hw/9pfs: Correct typo
  osdep: Undefine FSCALE definition to fix Solaris builds

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2025-12-09 15:08:46 -06:00
commit bf0e7b068b
17 changed files with 61 additions and 35 deletions

View file

@ -211,7 +211,7 @@ static size_t tpm_passthrough_get_buffer_size(TPMBackend *tb)
static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt)
{
int fd = -1;
char *dev;
const char *dev;
char path[PATH_MAX];
if (tpm_pt->options->cancel_path) {

View file

@ -1089,7 +1089,7 @@ vmdk_open_vmdk4(BlockDriverState *bs, BdrvChild *file, int flags,
static int vmdk_parse_description(const char *desc, const char *opt_name,
char *buf, int buf_size)
{
char *opt_pos, *opt_end;
const char *opt_pos, *opt_end;
const char *end = desc + strlen(desc);
opt_pos = strstr(desc, opt_name);

View file

@ -1826,7 +1826,7 @@ cluster_was_modified(BDRVVVFATState *s, uint32_t cluster_num)
static const char* get_basename(const char* path)
{
char* basename = strrchr(path, '/');
const char *basename = strrchr(path, '/');
if (basename == NULL)
return path;
else

View file

@ -362,7 +362,7 @@ static const char *get_feature_xml(const char *p, const char **newp,
* qXfer:features:read:ANNEX:OFFSET,LENGTH'
* ^p ^newp
*/
char *term = strchr(p, ':');
const char *term = strchr(p, ':');
*newp = term + 1;
len = term - p;

View file

@ -310,7 +310,7 @@ static void xen_9pfs_bh(void *opaque)
again:
wait = ring->co != NULL && qemu_coroutine_entered(ring->co);
/* paired with the smb_wmb barriers in xen_9pfs_init_in_iov_from_pdu */
/* paired with the smp_wmb barriers in xen_9pfs_init_in_iov_from_pdu */
smp_rmb();
if (wait) {
cpu_relax();

View file

@ -986,7 +986,7 @@ static void virtio_net_set_features(VirtIODevice *vdev,
virtio_has_feature_ex(vdev->guest_features_ex,
VIRTIO_NET_F_CTRL_VLAN)) {
bool vlan = virtio_has_feature_ex(features, VIRTIO_NET_F_CTRL_VLAN);
memset(n->vlans, vlan ? 0 : 0xff, sizeof(n->vlans));
memset(n->vlans, vlan ? 0 : 0xff, MAX_VLAN >> 3);
}
if (virtio_has_feature_ex(features, VIRTIO_NET_F_STANDBY)) {
@ -3598,8 +3598,7 @@ static const VMStateDescription vmstate_virtio_net_device = {
* buffer; hold onto your endiannesses; it's actually used as a bitmap
* but based on the uint.
*/
VMSTATE_BUFFER_UNSAFE(vlans, VirtIONet, 0,
sizeof(typeof_field(VirtIONet, vlans))),
VMSTATE_BUFFER_POINTER_UNSAFE(vlans, VirtIONet, 0, MAX_VLAN >> 3),
VMSTATE_WITH_TMP(VirtIONet, struct VirtIONetMigTmp,
vmstate_virtio_net_has_vnet),
VMSTATE_UINT8(mac_table.multi_overflow, VirtIONet),
@ -4017,7 +4016,8 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
n->mac_table.macs = g_malloc0(MAC_TABLE_ENTRIES * ETH_ALEN);
memset(n->vlans, 0xff, sizeof(n->vlans));
n->vlans = g_malloc0(MAX_VLAN >> 3);
memset(n->vlans, 0xff, MAX_VLAN >> 3);
nc = qemu_get_queue(n->nic);
nc->rxfilter_notify_enabled = 1;
@ -4066,6 +4066,7 @@ static void virtio_net_device_unrealize(DeviceState *dev)
n->netclient_type = NULL;
g_free(n->mac_table.macs);
g_free(n->vlans);
if (n->failover) {
qobject_unref(n->primary_opts);

View file

@ -1261,7 +1261,7 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
VirtioBusState *vbus = VIRTIO_BUS(qbus);
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
hwaddr s, l, a;
hwaddr l;
int r;
int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx);
struct vhost_vring_file file = {
@ -1272,8 +1272,17 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
};
struct VirtQueue *vvq = virtio_get_queue(vdev, idx);
a = virtio_queue_get_desc_addr(vdev, idx);
if (a == 0) {
vq->desc_size = virtio_queue_get_desc_size(vdev, idx);
vq->desc_phys = virtio_queue_get_desc_addr(vdev, idx);
vq->desc = NULL;
vq->avail_size = virtio_queue_get_avail_size(vdev, idx);
vq->avail_phys = virtio_queue_get_avail_addr(vdev, idx);
vq->avail = NULL;
vq->used_size = virtio_queue_get_used_size(vdev, idx);
vq->used_phys = virtio_queue_get_used_addr(vdev, idx);
vq->used = NULL;
if (vq->desc_phys == 0) {
/* Queue might not be ready for start */
return 0;
}
@ -1301,24 +1310,23 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
}
}
vq->desc_size = s = l = virtio_queue_get_desc_size(vdev, idx);
vq->desc_phys = a;
vq->desc = vhost_memory_map(dev, a, &l, false);
if (!vq->desc || l != s) {
l = vq->desc_size;
vq->desc = vhost_memory_map(dev, vq->desc_phys, &l, false);
if (!vq->desc || l != vq->desc_size) {
r = -ENOMEM;
goto fail_alloc_desc;
}
vq->avail_size = s = l = virtio_queue_get_avail_size(vdev, idx);
vq->avail_phys = a = virtio_queue_get_avail_addr(vdev, idx);
vq->avail = vhost_memory_map(dev, a, &l, false);
if (!vq->avail || l != s) {
l = vq->avail_size;
vq->avail = vhost_memory_map(dev, vq->avail_phys, &l, false);
if (!vq->avail || l != vq->avail_size) {
r = -ENOMEM;
goto fail_alloc_avail;
}
vq->used_size = s = l = virtio_queue_get_used_size(vdev, idx);
vq->used_phys = a = virtio_queue_get_used_addr(vdev, idx);
vq->used = vhost_memory_map(dev, a, &l, true);
if (!vq->used || l != s) {
l = vq->used_size;
vq->used = vhost_memory_map(dev, vq->used_phys, &l, true);
if (!vq->used || l != vq->used_size) {
r = -ENOMEM;
goto fail_alloc_used;
}

View file

@ -751,7 +751,7 @@ int pci_iommu_register_iotlb_notifier(PCIDevice *dev, uint32_t pasid,
/**
* pci_iommu_unregister_iotlb_notifier: unregister a notifier that has been
* registerd with pci_iommu_register_iotlb_notifier.
* registered with pci_iommu_register_iotlb_notifier.
*
* Returns 0 on success, or a negative errno otherwise.
*

View file

@ -202,7 +202,7 @@ struct VirtIONet {
uint8_t uni_overflow;
uint8_t *macs;
} mac_table;
uint32_t vlans[MAX_VLAN];
uint32_t *vlans;
virtio_net_conf net_conf;
NICConf nic_conf;
DeviceState *qdev;

View file

@ -727,6 +727,15 @@ extern const VMStateInfo vmstate_info_qlist;
.offset = offsetof(_state, _field), \
}
#define VMSTATE_BUFFER_POINTER_UNSAFE(_field, _state, _version, _size) { \
.name = (stringify(_field)), \
.version_id = (_version), \
.size = (_size), \
.info = &vmstate_info_buffer, \
.flags = VMS_BUFFER | VMS_POINTER, \
.offset = offsetof(_state, _field), \
}
/* Allocate a temporary of type 'tmp_type', set tmp->parent to _state
* and execute the vmsd on the temporary. Note that we're working with
* the whole of _state here, not a field within it.

View file

@ -141,6 +141,12 @@ QEMU_EXTERN_C int daemon(int, int);
#undef ELF_DATA
#undef ELF_ARCH
/*
* Avoid conflict with Solaris FSCALE definition from <sys/param.h> header,
* but we might as well do this unconditionally.
*/
#undef FSCALE
#ifdef CONFIG_IOVEC
#include <sys/uio.h>
#endif

View file

@ -1467,7 +1467,8 @@ retry:
static int postcopy_temp_pages_setup(MigrationIncomingState *mis)
{
PostcopyTmpPage *tmp_page;
int err, i, channels;
int err;
unsigned i, channels;
void *temp_page;
if (migrate_postcopy_preempt()) {
@ -1479,7 +1480,7 @@ static int postcopy_temp_pages_setup(MigrationIncomingState *mis)
}
channels = mis->postcopy_channels;
mis->postcopy_tmp_pages = g_malloc0_n(sizeof(PostcopyTmpPage), channels);
mis->postcopy_tmp_pages = g_new0(PostcopyTmpPage, channels);
for (i = 0; i < channels; i++) {
tmp_page = &mis->postcopy_tmp_pages[i];

View file

@ -403,7 +403,8 @@ static bool build_guest_fsinfo_for_pci_dev(char const *syspath,
int i, offset, nhosts = 0, pcilen;
GuestPCIAddress *pciaddr = disk->pci_controller;
bool has_ata = false, has_host = false, has_tgt = false;
char *p, *driver = NULL;
const char *p;
char *driver = NULL;
bool ret = false;
p = strstr(syspath, "/devices/pci");
@ -543,7 +544,7 @@ static bool build_guest_fsinfo_for_nonpci_virtio(char const *syspath,
Error **errp)
{
unsigned int tgt[3];
char *p;
const char *p;
if (!strstr(syspath, "/virtio") || !strstr(syspath, "/block")) {
g_debug("Unsupported virtio device '%s'", syspath);
@ -575,7 +576,7 @@ static bool build_guest_fsinfo_for_ccw_dev(char const *syspath,
Error **errp)
{
unsigned int cssid, ssid, subchno, devno;
char *p;
const char *p;
p = strstr(syspath, "/devices/css");
if (!p || sscanf(p + 12, "%*x/%x.%x.%x/%*x.%*x.%x/",

View file

@ -41,7 +41,7 @@ def main(args):
for obj in args:
entry = compile_commands.get(obj, None)
if not entry:
sys.stderr.print('modinfo: Could not find object file', obj)
sys.stderr.write(f'modinfo: Could not find object file {obj}')
sys.exit(1)
src = entry['file']
if not src.endswith('.c'):

View file

@ -114,7 +114,7 @@ def main():
"-DSRCDIR=" + args.srcdir,
"-DBINDIR=" + destdir + prefix,
]
if args.cpu == "x86_64":
if args.cpu == "aarch64" or args.cpu == "x86_64":
makensis += ["-DW64"]
makensis += ["-DDLLDIR=" + dlldir]

View file

@ -418,7 +418,7 @@ err_out:
void sendkey_completion(ReadLineState *rs, int nb_args, const char *str)
{
int i;
char *sep;
const char *sep;
size_t len;
if (nb_args != 2) {

View file

@ -203,7 +203,7 @@ static ValidFilenameTemplateResult
valid_filename_template(const char *filename, bool per_thread, Error **errp)
{
if (filename) {
char *pidstr = strstr(filename, "%");
const char *pidstr = strstr(filename, "%");
if (pidstr) {
/* We only accept one %d, no other format strings */