mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'pull-request-2023-01-09' of https://gitlab.com/thuth/qemu into staging
* s390x header clean-ups from Philippe * Rework and improvements of the EINTR handling by Nikita * Deprecate the -no-hpet command line option * Disable the qtests in the 32-bit Windows CI job again * Some other misc fixes here and there # gpg: Signature made Mon 09 Jan 2023 14:21:19 GMT # 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-2023-01-09' of https://gitlab.com/thuth/qemu: .gitlab-ci.d/windows: Do not run the qtests in the msys2-32bit job error handling: Use RETRY_ON_EINTR() macro where applicable Refactoring: refactor TFR() macro to RETRY_ON_EINTR() docs/interop: Change the vnc-ledstate-Pseudo-encoding doc into .rst i386: Deprecate the -no-hpet QEMU command line option tests/qtest/bios-tables-test: Replace -no-hpet with hpet=off machine parameter tests/readconfig: spice doesn't support unix socket on windows yet target/s390x: Restrict sysemu/reset.h to system emulation target/s390x/tcg/excp_helper: Restrict system headers to sysemu target/s390x/tcg/misc_helper: Remove unused "memory.h" include hw/s390x/pv: Restrict Protected Virtualization to sysemu exec/memory: Expose memory_region_access_valid() MAINTAINERS: Add MIPS-related docs and configs to the MIPS architecture section tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts qemu-iotests/stream-under-throttle: do not shutdown QEMU Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -116,4 +116,5 @@ msys2-32bit:
|
||||
- ..\msys64\usr\bin\bash -lc '../configure --target-list=ppc64-softmmu
|
||||
--disable-opengl'
|
||||
- ..\msys64\usr\bin\bash -lc 'make'
|
||||
- ..\msys64\usr\bin\bash -lc 'make check || { cat meson-logs/testlog.txt; exit 1; } ;'
|
||||
- ..\msys64\usr\bin\bash -lc 'make check MTESTARGS=\"--no-suite qtest\" ||
|
||||
{ cat meson-logs/testlog.txt; exit 1; }'
|
||||
|
||||
@@ -113,6 +113,8 @@ M: Philippe Mathieu-Daudé <philmd@linaro.org>
|
||||
R: Jiaxun Yang <jiaxun.yang@flygoat.com>
|
||||
S: Odd Fixes
|
||||
K: ^Subject:.*(?i)mips
|
||||
F: docs/system/target-mips.rst
|
||||
F: configs/targets/mips*
|
||||
|
||||
Guest CPU cores (TCG)
|
||||
---------------------
|
||||
|
||||
+16
-21
@@ -1229,9 +1229,7 @@ static int hdev_get_max_segments(int fd, struct stat *st)
|
||||
ret = -errno;
|
||||
goto out;
|
||||
}
|
||||
do {
|
||||
ret = read(sysfd, buf, sizeof(buf) - 1);
|
||||
} while (ret == -1 && errno == EINTR);
|
||||
ret = RETRY_ON_EINTR(read(sysfd, buf, sizeof(buf) - 1));
|
||||
if (ret < 0) {
|
||||
ret = -errno;
|
||||
goto out;
|
||||
@@ -1379,9 +1377,9 @@ static int handle_aiocb_ioctl(void *opaque)
|
||||
RawPosixAIOData *aiocb = opaque;
|
||||
int ret;
|
||||
|
||||
do {
|
||||
ret = ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf);
|
||||
} while (ret == -1 && errno == EINTR);
|
||||
ret = RETRY_ON_EINTR(
|
||||
ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf)
|
||||
);
|
||||
if (ret == -1) {
|
||||
return -errno;
|
||||
}
|
||||
@@ -1463,18 +1461,17 @@ static ssize_t handle_aiocb_rw_vector(RawPosixAIOData *aiocb)
|
||||
{
|
||||
ssize_t len;
|
||||
|
||||
do {
|
||||
if (aiocb->aio_type & QEMU_AIO_WRITE)
|
||||
len = qemu_pwritev(aiocb->aio_fildes,
|
||||
aiocb->io.iov,
|
||||
aiocb->io.niov,
|
||||
aiocb->aio_offset);
|
||||
else
|
||||
len = qemu_preadv(aiocb->aio_fildes,
|
||||
aiocb->io.iov,
|
||||
aiocb->io.niov,
|
||||
aiocb->aio_offset);
|
||||
} while (len == -1 && errno == EINTR);
|
||||
len = RETRY_ON_EINTR(
|
||||
(aiocb->aio_type & QEMU_AIO_WRITE) ?
|
||||
qemu_pwritev(aiocb->aio_fildes,
|
||||
aiocb->io.iov,
|
||||
aiocb->io.niov,
|
||||
aiocb->aio_offset) :
|
||||
qemu_preadv(aiocb->aio_fildes,
|
||||
aiocb->io.iov,
|
||||
aiocb->io.niov,
|
||||
aiocb->aio_offset)
|
||||
);
|
||||
|
||||
if (len == -1) {
|
||||
return -errno;
|
||||
@@ -1899,9 +1896,7 @@ static int allocate_first_block(int fd, size_t max_size)
|
||||
buf = qemu_memalign(max_align, write_size);
|
||||
memset(buf, 0, write_size);
|
||||
|
||||
do {
|
||||
n = pwrite(fd, buf, write_size, 0);
|
||||
} while (n == -1 && errno == EINTR);
|
||||
n = RETRY_ON_EINTR(pwrite(fd, buf, write_size, 0));
|
||||
|
||||
ret = (n == -1) ? -errno : 0;
|
||||
|
||||
|
||||
+1
-1
@@ -198,7 +198,7 @@ int qmp_chardev_open_file_source(char *src, int flags, Error **errp)
|
||||
{
|
||||
int fd = -1;
|
||||
|
||||
TFR(fd = qemu_open_old(src, flags, 0666));
|
||||
fd = RETRY_ON_EINTR(qemu_open_old(src, flags, 0666));
|
||||
if (fd == -1) {
|
||||
error_setg_file_open(errp, errno, src);
|
||||
}
|
||||
|
||||
+5
-3
@@ -131,8 +131,8 @@ static void qemu_chr_open_pipe(Chardev *chr,
|
||||
|
||||
filename_in = g_strdup_printf("%s.in", filename);
|
||||
filename_out = g_strdup_printf("%s.out", filename);
|
||||
TFR(fd_in = qemu_open_old(filename_in, O_RDWR | O_BINARY));
|
||||
TFR(fd_out = qemu_open_old(filename_out, O_RDWR | O_BINARY));
|
||||
fd_in = RETRY_ON_EINTR(qemu_open_old(filename_in, O_RDWR | O_BINARY));
|
||||
fd_out = RETRY_ON_EINTR(qemu_open_old(filename_out, O_RDWR | O_BINARY));
|
||||
g_free(filename_in);
|
||||
g_free(filename_out);
|
||||
if (fd_in < 0 || fd_out < 0) {
|
||||
@@ -142,7 +142,9 @@ static void qemu_chr_open_pipe(Chardev *chr,
|
||||
if (fd_out >= 0) {
|
||||
close(fd_out);
|
||||
}
|
||||
TFR(fd_in = fd_out = qemu_open_old(filename, O_RDWR | O_BINARY));
|
||||
fd_in = fd_out = RETRY_ON_EINTR(
|
||||
qemu_open_old(filename, O_RDWR | O_BINARY)
|
||||
);
|
||||
if (fd_in < 0) {
|
||||
error_setg_file_open(errp, errno, filename);
|
||||
return;
|
||||
|
||||
+1
-3
@@ -93,9 +93,7 @@ static void pty_chr_update_read_handler(Chardev *chr)
|
||||
pfd.fd = fioc->fd;
|
||||
pfd.events = G_IO_OUT;
|
||||
pfd.revents = 0;
|
||||
do {
|
||||
rc = g_poll(&pfd, 1, 0);
|
||||
} while (rc == -1 && errno == EINTR);
|
||||
rc = RETRY_ON_EINTR(g_poll(&pfd, 1, 0));
|
||||
assert(rc >= 0);
|
||||
|
||||
if (pfd.revents & G_IO_HUP) {
|
||||
|
||||
@@ -93,6 +93,12 @@ form is preferred.
|
||||
Using ``-drive if=none`` to configure the OTP device of the sifive_u
|
||||
RISC-V machine is deprecated. Use ``-drive if=pflash`` instead.
|
||||
|
||||
``-no-hpet`` (since 8.0)
|
||||
''''''''''''''''''''''''
|
||||
|
||||
The HPET setting has been turned into a machine property.
|
||||
Use ``-machine hpet=off`` instead.
|
||||
|
||||
|
||||
QEMU Machine Protocol (QMP) commands
|
||||
------------------------------------
|
||||
|
||||
@@ -23,3 +23,4 @@ are useful for making QEMU interoperate with other software.
|
||||
vhost-user-gpu
|
||||
vhost-vdpa
|
||||
virtio-balloon-stats
|
||||
vnc-ledstate-pseudo-encoding
|
||||
|
||||
+2
-6
@@ -470,9 +470,7 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
|
||||
if (fd == -1) {
|
||||
return -1;
|
||||
}
|
||||
do {
|
||||
tsize = read(fd, (void *)buf, bufsz);
|
||||
} while (tsize == -1 && errno == EINTR);
|
||||
tsize = RETRY_ON_EINTR(read(fd, (void *)buf, bufsz));
|
||||
close_preserve_errno(fd);
|
||||
} else if ((fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) ||
|
||||
(fs_ctx->export_flags & V9FS_SM_NONE)) {
|
||||
@@ -908,9 +906,7 @@ static int local_symlink(FsContext *fs_ctx, const char *oldpath,
|
||||
}
|
||||
/* Write the oldpath (target) to the file. */
|
||||
oldpath_size = strlen(oldpath);
|
||||
do {
|
||||
write_size = write(fd, (void *)oldpath, oldpath_size);
|
||||
} while (write_size == -1 && errno == EINTR);
|
||||
write_size = RETRY_ON_EINTR(write(fd, (void *)oldpath, oldpath_size));
|
||||
close_preserve_errno(fd);
|
||||
|
||||
if (write_size != oldpath_size) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "exec/memop.h"
|
||||
#include "exec/memory-internal.h"
|
||||
#include "exec/memory.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "sysemu/hw_accel.h"
|
||||
#include "hw/pci/pci_device.h"
|
||||
|
||||
@@ -38,10 +38,6 @@ void flatview_unref(FlatView *view);
|
||||
|
||||
extern const MemoryRegionOps unassigned_mem_ops;
|
||||
|
||||
bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
|
||||
unsigned size, bool is_write,
|
||||
MemTxAttrs attrs);
|
||||
|
||||
void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section);
|
||||
AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv);
|
||||
void address_space_dispatch_compact(AddressSpaceDispatch *d);
|
||||
|
||||
@@ -2442,6 +2442,10 @@ void memory_global_dirty_log_stop(unsigned int flags);
|
||||
|
||||
void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled);
|
||||
|
||||
bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
|
||||
unsigned size, bool is_write,
|
||||
MemTxAttrs attrs);
|
||||
|
||||
/**
|
||||
* memory_region_dispatch_read: perform a read directly to the specified
|
||||
* MemoryRegion.
|
||||
|
||||
@@ -251,7 +251,13 @@ void QEMU_ERROR("code path is reachable")
|
||||
#define ESHUTDOWN 4099
|
||||
#endif
|
||||
|
||||
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
|
||||
#define RETRY_ON_EINTR(expr) \
|
||||
(__extension__ \
|
||||
({ typeof(expr) __result; \
|
||||
do { \
|
||||
__result = (expr); \
|
||||
} while (__result == -1 && errno == EINTR); \
|
||||
__result; }))
|
||||
|
||||
/* time_t may be either 32 or 64 bits depending on the host OS, and
|
||||
* can be either signed or unsigned, so we can't just hardcode a
|
||||
|
||||
+5
-12
@@ -240,9 +240,7 @@ static ssize_t net_l2tpv3_receive_dgram_iov(NetClientState *nc,
|
||||
message.msg_control = NULL;
|
||||
message.msg_controllen = 0;
|
||||
message.msg_flags = 0;
|
||||
do {
|
||||
ret = sendmsg(s->fd, &message, 0);
|
||||
} while ((ret == -1) && (errno == EINTR));
|
||||
ret = RETRY_ON_EINTR(sendmsg(s->fd, &message, 0));
|
||||
if (ret > 0) {
|
||||
ret -= s->offset;
|
||||
} else if (ret == 0) {
|
||||
@@ -285,9 +283,7 @@ static ssize_t net_l2tpv3_receive_dgram(NetClientState *nc,
|
||||
message.msg_control = NULL;
|
||||
message.msg_controllen = 0;
|
||||
message.msg_flags = 0;
|
||||
do {
|
||||
ret = sendmsg(s->fd, &message, 0);
|
||||
} while ((ret == -1) && (errno == EINTR));
|
||||
ret = RETRY_ON_EINTR(sendmsg(s->fd, &message, 0));
|
||||
if (ret > 0) {
|
||||
ret -= s->offset;
|
||||
} else if (ret == 0) {
|
||||
@@ -434,12 +430,9 @@ static void net_l2tpv3_send(void *opaque)
|
||||
|
||||
msgvec = s->msgvec + s->queue_head;
|
||||
if (target_count > 0) {
|
||||
do {
|
||||
count = recvmmsg(
|
||||
s->fd,
|
||||
msgvec,
|
||||
target_count, MSG_DONTWAIT, NULL);
|
||||
} while ((count == -1) && (errno == EINTR));
|
||||
count = RETRY_ON_EINTR(
|
||||
recvmmsg(s->fd, msgvec, target_count, MSG_DONTWAIT, NULL)
|
||||
);
|
||||
if (count < 0) {
|
||||
/* Recv error - we still need to flush packets here,
|
||||
* (re)set queue head to current position
|
||||
|
||||
+7
-9
@@ -117,15 +117,13 @@ static ssize_t net_socket_receive_dgram(NetClientState *nc, const uint8_t *buf,
|
||||
NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc);
|
||||
ssize_t ret;
|
||||
|
||||
do {
|
||||
if (s->dgram_dst.sin_family != AF_UNIX) {
|
||||
ret = sendto(s->fd, buf, size, 0,
|
||||
(struct sockaddr *)&s->dgram_dst,
|
||||
sizeof(s->dgram_dst));
|
||||
} else {
|
||||
ret = send(s->fd, buf, size, 0);
|
||||
}
|
||||
} while (ret == -1 && errno == EINTR);
|
||||
ret = RETRY_ON_EINTR(
|
||||
s->dgram_dst.sin_family != AF_UNIX ?
|
||||
sendto(s->fd, buf, size, 0,
|
||||
(struct sockaddr *)&s->dgram_dst,
|
||||
sizeof(s->dgram_dst)) :
|
||||
send(s->fd, buf, size, 0)
|
||||
);
|
||||
|
||||
if (ret == -1 && errno == EAGAIN) {
|
||||
net_socket_write_poll(s, true);
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
|
||||
} else {
|
||||
snprintf(dname, sizeof dname, "/dev/tap%d", i);
|
||||
}
|
||||
TFR(fd = open(dname, O_RDWR));
|
||||
fd = RETRY_ON_EINTR(open(dname, O_RDWR));
|
||||
if (fd >= 0) {
|
||||
break;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ static int tap_open_clone(char *ifname, int ifname_size, Error **errp)
|
||||
int fd, s, ret;
|
||||
struct ifreq ifr;
|
||||
|
||||
TFR(fd = open(PATH_NET_TAP, O_RDWR));
|
||||
fd = RETRY_ON_EINTR(open(PATH_NET_TAP, O_RDWR));
|
||||
if (fd < 0) {
|
||||
error_setg_errno(errp, errno, "could not open %s", PATH_NET_TAP);
|
||||
return -1;
|
||||
@@ -159,7 +159,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
|
||||
if (ifname[0] != '\0') {
|
||||
char dname[100];
|
||||
snprintf(dname, sizeof dname, "/dev/%s", ifname);
|
||||
TFR(fd = open(dname, O_RDWR));
|
||||
fd = RETRY_ON_EINTR(open(dname, O_RDWR));
|
||||
if (fd < 0 && errno != ENOENT) {
|
||||
error_setg_errno(errp, errno, "could not open %s", dname);
|
||||
return -1;
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
|
||||
int len = sizeof(struct virtio_net_hdr);
|
||||
unsigned int features;
|
||||
|
||||
TFR(fd = open(PATH_NET_TUN, O_RDWR));
|
||||
fd = RETRY_ON_EINTR(open(PATH_NET_TUN, O_RDWR));
|
||||
if (fd < 0) {
|
||||
error_setg_errno(errp, errno, "could not open %s", PATH_NET_TUN);
|
||||
return -1;
|
||||
|
||||
+4
-4
@@ -84,13 +84,13 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
|
||||
if( ip_fd )
|
||||
close(ip_fd);
|
||||
|
||||
TFR(ip_fd = open("/dev/udp", O_RDWR, 0));
|
||||
ip_fd = RETRY_ON_EINTR(open("/dev/udp", O_RDWR, 0));
|
||||
if (ip_fd < 0) {
|
||||
error_setg(errp, "Can't open /dev/ip (actually /dev/udp)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
TFR(tap_fd = open("/dev/tap", O_RDWR, 0));
|
||||
tap_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
|
||||
if (tap_fd < 0) {
|
||||
error_setg(errp, "Can't open /dev/tap");
|
||||
return -1;
|
||||
@@ -104,7 +104,7 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
|
||||
if ((ppa = ioctl (tap_fd, I_STR, &strioc_ppa)) < 0)
|
||||
error_report("Can't assign new interface");
|
||||
|
||||
TFR(if_fd = open("/dev/tap", O_RDWR, 0));
|
||||
if_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
|
||||
if (if_fd < 0) {
|
||||
error_setg(errp, "Can't open /dev/tap (2)");
|
||||
return -1;
|
||||
@@ -137,7 +137,7 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
|
||||
if (ioctl (ip_fd, I_PUSH, "arp") < 0)
|
||||
error_report("Can't push ARP module (3)");
|
||||
/* Open arp_fd */
|
||||
TFR(arp_fd = open ("/dev/tap", O_RDWR, 0));
|
||||
arp_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
|
||||
if (arp_fd < 0)
|
||||
error_report("Can't open %s", "/dev/tap");
|
||||
|
||||
|
||||
@@ -102,9 +102,7 @@ static ssize_t tap_write_packet(TAPState *s, const struct iovec *iov, int iovcnt
|
||||
{
|
||||
ssize_t len;
|
||||
|
||||
do {
|
||||
len = writev(s->fd, iov, iovcnt);
|
||||
} while (len == -1 && errno == EINTR);
|
||||
len = RETRY_ON_EINTR(writev(s->fd, iov, iovcnt));
|
||||
|
||||
if (len == -1 && errno == EAGAIN) {
|
||||
tap_write_poll(s, true);
|
||||
@@ -577,9 +575,7 @@ static int net_bridge_run_helper(const char *helper, const char *bridge,
|
||||
|
||||
close(sv[1]);
|
||||
|
||||
do {
|
||||
fd = recv_fd(sv[0]);
|
||||
} while (fd == -1 && errno == EINTR);
|
||||
fd = RETRY_ON_EINTR(recv_fd(sv[0]));
|
||||
saved_errno = errno;
|
||||
|
||||
close(sv[0]);
|
||||
@@ -650,7 +646,7 @@ static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr,
|
||||
vnet_hdr_required = 0;
|
||||
}
|
||||
|
||||
TFR(fd = tap_open(ifname, ifname_sz, vnet_hdr, vnet_hdr_required,
|
||||
fd = RETRY_ON_EINTR(tap_open(ifname, ifname_sz, vnet_hdr, vnet_hdr_required,
|
||||
mq_required, errp));
|
||||
if (fd < 0) {
|
||||
return -1;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user