diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 30ab72b2a4..9386cffba2 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -54,20 +54,6 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``. However, short-form booleans are deprecated and full explicit ``arg_name=on`` form is preferred. -``-smp`` (Unsupported "parameter=1" SMP configurations) (since 9.0) -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -Specified CPU topology parameters must be supported by the machine. - -In the SMP configuration, users should provide the CPU topology parameters that -are supported by the target machine. - -However, historically it was allowed for users to specify the unsupported -topology parameter as "1", which is meaningless. So support for this kind of -configurations (e.g. -smp drawers=1,books=1,clusters=1 for x86 PC machine) is -marked deprecated since 9.0, users have to ensure that all the topology members -described with -smp are supported by the target machine. - QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/hw/core/machine.c b/hw/core/machine.c index 06e0c9a179..27372bb01e 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -1204,6 +1204,8 @@ static void machine_class_init(ObjectClass *oc, const void *data) object_class_property_add_bool(oc, "aux-ram-share", machine_get_aux_ram_share, machine_set_aux_ram_share); + object_class_property_set_description(oc, "aux-ram-share", + "Use anonymous shared memory for auxiliary guest RAMs"); #endif object_class_property_add_bool(oc, "usb", diff --git a/hw/misc/aspeed_xdma.c b/hw/misc/aspeed_xdma.c index cc03c422b0..c448ad32ff 100644 --- a/hw/misc/aspeed_xdma.c +++ b/hw/misc/aspeed_xdma.c @@ -113,7 +113,7 @@ static void aspeed_xdma_write(void *opaque, hwaddr addr, uint64_t val, static const MemoryRegionOps aspeed_xdma_ops = { .read = aspeed_xdma_read, .write = aspeed_xdma_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, .valid.min_access_size = 4, .valid.max_access_size = 4, }; diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 8c7f6709e2..b35476d057 100644 --- a/hw/pci/msix.c +++ b/hw/pci/msix.c @@ -318,7 +318,7 @@ static void msix_mask_all(struct PCIDevice *dev, unsigned nentries) * also means a programming error, except device assignment, which can check * if a real HW is broken. */ -int msix_init(struct PCIDevice *dev, unsigned short nentries, +int msix_init(struct PCIDevice *dev, uint32_t nentries, MemoryRegion *table_bar, uint8_t table_bar_nr, unsigned table_offset, MemoryRegion *pba_bar, uint8_t pba_bar_nr, unsigned pba_offset, uint8_t cap_pos, @@ -392,7 +392,7 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries, return 0; } -int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries, +int msix_init_exclusive_bar(PCIDevice *dev, uint32_t nentries, uint8_t bar_nr, Error **errp) { int ret; @@ -401,6 +401,12 @@ int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries, uint32_t bar_pba_offset = bar_size / 2; uint32_t bar_pba_size = QEMU_ALIGN_UP(nentries, 64) / 8; + /* Sanity-check nentries before we use it in BAR size calculations */ + if (nentries < 1 || nentries > PCI_MSIX_FLAGS_QSIZE + 1) { + error_setg(errp, "The number of MSI-X vectors is invalid"); + return -EINVAL; + } + /* * Migration compatibility dictates that this remains a 4k * BAR with the vector table in the lower half and PBA in diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c index c4feea23a0..6793e253f4 100644 --- a/hw/rtc/aspeed_rtc.c +++ b/hw/rtc/aspeed_rtc.c @@ -131,7 +131,7 @@ static void aspeed_rtc_reset(DeviceState *d) static const MemoryRegionOps aspeed_rtc_ops = { .read = aspeed_rtc_read, .write = aspeed_rtc_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, }; static const VMStateDescription vmstate_aspeed_rtc = { diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c index cdf405b0f8..239138c931 100644 --- a/hw/scsi/vhost-scsi.c +++ b/hw/scsi/vhost-scsi.c @@ -245,8 +245,7 @@ static void vhost_scsi_realize(DeviceState *dev, Error **errp) } else { vhostfd = open("/dev/vhost-scsi", O_RDWR); if (vhostfd < 0) { - error_setg(errp, "vhost-scsi: open vhost char device failed: %s", - strerror(errno)); + error_setg_file_open(errp, errno, "/dev/vhost-scsi"); return; } } diff --git a/hw/sd/aspeed_sdhci.c b/hw/sd/aspeed_sdhci.c index fc38ad39ce..f5c0c4956a 100644 --- a/hw/sd/aspeed_sdhci.c +++ b/hw/sd/aspeed_sdhci.c @@ -124,7 +124,7 @@ static void aspeed_sdhci_write(void *opaque, hwaddr addr, uint64_t val, static const MemoryRegionOps aspeed_sdhci_ops = { .read = aspeed_sdhci_read, .write = aspeed_sdhci_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, .valid.min_access_size = 4, .valid.max_access_size = 4, }; diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 8dd2ce415e..714e33989f 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -259,10 +259,9 @@ static void usb_qdev_realize(DeviceState *qdev, Error **errp) } if (dev->pcap_filename) { - int fd = qemu_open_old(dev->pcap_filename, - O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0666); + int fd = qemu_create(dev->pcap_filename, + O_WRONLY | O_TRUNC | O_BINARY, 0666, errp); if (fd < 0) { - error_setg(errp, "open %s failed", dev->pcap_filename); usb_qdev_unrealize(qdev); return; } diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c index 107d88babe..7940b60d8a 100644 --- a/hw/virtio/vhost-vsock.c +++ b/hw/virtio/vhost-vsock.c @@ -153,8 +153,7 @@ static void vhost_vsock_device_realize(DeviceState *dev, Error **errp) } else { vhostfd = open("/dev/vhost-vsock", O_RDWR); if (vhostfd < 0) { - error_setg_errno(errp, errno, - "vhost-vsock: failed to open vhost device"); + error_setg_file_open(errp, errno, "/dev/vhost-vsock"); return; } diff --git a/include/hw/pci/msix.h b/include/hw/pci/msix.h index 11ef9454c1..551a2bcfe7 100644 --- a/include/hw/pci/msix.h +++ b/include/hw/pci/msix.h @@ -7,12 +7,12 @@ void msix_set_message(PCIDevice *dev, int vector, MSIMessage msg); MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector); -int msix_init(PCIDevice *dev, unsigned short nentries, +int msix_init(PCIDevice *dev, uint32_t nentries, MemoryRegion *table_bar, uint8_t table_bar_nr, unsigned table_offset, MemoryRegion *pba_bar, uint8_t pba_bar_nr, unsigned pba_offset, uint8_t cap_pos, Error **errp); -int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries, +int msix_init_exclusive_bar(PCIDevice *dev, uint32_t nentries, uint8_t bar_nr, Error **errp); void msix_write_config(PCIDevice *dev, uint32_t address, uint32_t val, int len); diff --git a/replay/replay-char.c b/replay/replay-char.c index 81dc416e98..4e58dd154a 100644 --- a/replay/replay-char.c +++ b/replay/replay-char.c @@ -126,8 +126,8 @@ int replay_char_read_all_load(uint8_t *buf) int res; replay_get_array(buf, &size); replay_finish_event(); + assert(size <= INT_MAX); res = (int)size; - assert(res >= 0); return res; } else if (replay_next_event_is(EVENT_CHAR_READ_ALL_ERROR)) { int res = replay_get_dword(); diff --git a/system/qtest.c b/system/qtest.c index cbeb7f3772..67e2385f4b 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -69,6 +69,9 @@ static void *qtest_server_send_opaque; * so clients should always handle many async messages before the response * comes in. * + * Extra ASCII space characters in command inputs are permitted and ignored. + * Lines containing only spaces are permitted and ignored. + * * Valid requests * ^^^^^^^^^^^^^^ * @@ -367,7 +370,11 @@ static void qtest_process_command(CharFrontend *chr, gchar **words) fprintf(qtest_log_fp, "\n"); } - g_assert(command); + if (!command) { + /* Input line was blank: ignore it */ + return; + } + if (strcmp(words[0], "irq_intercept_out") == 0 || strcmp(words[0], "irq_intercept_in") == 0) { DeviceState *dev;