chardev patches
From: Marc-André Lureau <[email protected]>
The following changes since commit dbc4f48b5ab3e6d85f78aa4df6bd6ad561c3d152:
Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into staging (2022-09-27 11:08:36 -0400)
are available in the Git repository at:
https://gitlab.com/marcandre.lureau/qemu.git tags/char-pull-request
for you to fetch changes up to 9cbda7b354389e536d546cc2091365bc402b3206:
vhost-user: Call qemu_socketpair() instead of socketpair() (2022-09-29 14:38:05 +0400)
----------------------------------------------------------------
chardev related patches
----------------------------------------------------------------
Arwed Meyer (5):
msmouse: Handle mouse reset
chardev: src buffer const for write functions
msmouse: Use fifo8 instead of array
msmouse: Add pnp data
serial: Allow unaligned i/o access
Guoyi Tu (2):
oslib-posix: Introduce qemu_socketpair()
vhost-user: Call qemu_socketpair() instead of socketpair()
Maksim Davydov (1):
chardev: fix segfault in finalize
include/chardev/char.h | 4 +- include/qemu/sockets.h | 18 +++++ include/sysemu/replay.h | 2 +- chardev/char.c | 4 +- chardev/msmouse.c | 152 ++++++++++++++++++++++++++++++------ chardev/wctablet.c | 4 +- hw/char/serial.c | 3 + hw/display/vhost-user-gpu.c | 3 +- hw/virtio/vhost-user.c | 2 +- replay/replay-char.c | 2 +- stubs/replay-tools.c | 2 +- util/oslib-posix.c | 19 +++++ 12 files changed, 179 insertions(+), 36 deletions(-)
Signature · 1 line
2.37.3
[PULL 5/8] serial: Allow unaligned i/o access
From: Arwed Meyer <[email protected]>
Unaligned i/o access on serial UART works on real PCs. This is used for example by FreeDOS CTMouse driver. Without this it can't reset and detect serial mice.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/77
Message-Id: <[email protected]>
--- hw/char/serial.c | 3 +++ 1 file changed, 3 insertions(+)
hw/char/serial.c +3 -0
@@ -961,6 +961,9 @@ void serial_set_frequency(SerialState *s, uint32_t frequency)const MemoryRegionOps serial_io_ops = { .read = serial_ioport_read, .write = serial_ioport_write, + .valid = { + .unaligned =1 , + }, .impl = { .min_access_size =1 , .max_access_size =1 ,
Signature · 1 line
2.37.3
[PULL 2/8] chardev: src buffer const for write functions
In reply to [email protected]From: Arwed Meyer <[email protected]>
Make source buffers const for char be write functions.
This allows using buffers returned by fifo as buf parameter and source buffer should not be changed by write functions anyway.
Message-Id: <[email protected]>
--- include/chardev/char.h | 4 ++-- include/sysemu/replay.h | 2 +- chardev/char.c | 4 ++-- replay/replay-char.c | 2 +- stubs/replay-tools.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-)
include/chardev/char.h +2 -2
@@ -186,7 +186,7 @@ int qemu_chr_be_can_write(Chardev *s);* the caller should call @qemu_chr_be_can_write to determine how much data * the front end can currently accept. */ -void qemu_chr_be_write (Chardev *s,uint8_t *buf,int len); +void qemu_chr_be_write (Chardev *s,const uint8_t *buf,int len);/** * qemu_chr_be_write_impl:
@@ -195,7 +195,7 @@ void qemu_chr_be_write(Chardev *s, uint8_t *buf, int len);* * Implementation of back end writing. Used by replay module. */ -void qemu_chr_be_write_impl (Chardev *s,uint8_t *buf,int len); +void qemu_chr_be_write_impl (Chardev *s,const uint8_t *buf,int len);/** * qemu_chr_be_update_read_handlers:
include/sysemu/replay.h +1 -1
@@ -198,7 +198,7 @@ uint64_t blkreplay_next_id(void);/*! Registers char driver to save it's events */ void replay_register_char_driver (struct Chardev *chr);/*! Saves write to char device event to the log */ -void replay_chr_be_write (struct Chardev *s,uint8_t *buf,int len); +void replay_chr_be_write (struct Chardev *s,const uint8_t *buf,int len);/*! Writes char write return value to the replay log. */ void replay_char_write_event_save (int res,int offset);/*! Reads char write return value from the replay log. */
chardev/char.c +2 -2
@@ -193,7 +193,7 @@ int qemu_chr_be_can_write(Chardev *s)return be->chr_can_read (be->opaque); } -void qemu_chr_be_write_impl (Chardev *s,uint8_t *buf,int len) +void qemu_chr_be_write_impl (Chardev *s,const uint8_t *buf,int len) {CharBackend *be = s->be;
@@ -202,7 +202,7 @@ void qemu_chr_be_write_impl(Chardev *s, uint8_t *buf, int len) } } -void qemu_chr_be_write (Chardev *s,uint8_t *buf,int len) +void qemu_chr_be_write (Chardev *s,const uint8_t *buf,int len) {if (qemu_chr_replay (s)) {if (replay_mode ==REPLAY_MODE_PLAY ) {
replay/replay-char.c +1 -1
@@ -48,7 +48,7 @@ void replay_register_char_driver(Chardev *chr) char_drivers[drivers_count++] = chr; } -void replay_chr_be_write (Chardev *s,uint8_t *buf,int len) +void replay_chr_be_write (Chardev *s,const uint8_t *buf,int len) {CharEvent *event =g_new0 (CharEvent,1 );
stubs/replay-tools.c +1 -1
@@ -53,7 +53,7 @@ void replay_register_char_driver(struct Chardev *chr) { } -void replay_chr_be_write (struct Chardev *s,uint8_t *buf,int len) +void replay_chr_be_write (struct Chardev *s,const uint8_t *buf,int len) {abort (); }
Signature · 1 line
2.37.3
[PULL 4/8] msmouse: Add pnp data
In reply to [email protected]From: Arwed Meyer <[email protected]>
Make msmouse send serial pnp data.
Enables you to see nice qemu device name in Win9x.
Message-Id: <[email protected]>
--- chardev/msmouse.c | 58 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 11 deletions(-)
chardev/msmouse.c +47 -11
@@ -35,11 +35,24 @@#define MSMOUSE_HI2 (n) (((n) & 0xc0) >> 6)#define MSMOUSE_PWR (cm) (cm & (CHR_TIOCM_RTS | CHR_TIOCM_DTR)) +/* Serial PnP for 6 bit devices/mice sends all ASCII chars - 0x20 */ +#define M (c) (c - 0x20)/* Serial fifo size. */ #define MSMOUSE_BUF_SZ 64/* Mouse ID: Send "M3" cause we behave like a 3 button logitech mouse. */ const uint8_t mouse_id[] = {'M' ,'3' }; +/* +* PnP start "(", PnP version (1.0), vendor ID, product ID, '\\', +* serial ID (omitted), '\\', MS class name, '\\', driver ID (omitted), '\\', +* product description, checksum, ")" +* Missing parts are inserted later. +*/ +const uint8_t pnp_data[] = {M ('(' ),1 ,'$' ,M ('Q' ),M ('M' ),M ('U' ), +M ('0' ),M ('0' ),M ('0' ),M ('1' ), +M ('\\' ),M ('\\' ), +M ('M' ),M ('O' ),M ('U' ),M ('S' ),M ('E' ), +M ('\\' ),M ('\\' )};struct MouseChardev {Chardev parent;
@@ -158,11 +171,22 @@ static int msmouse_chr_write(struct Chardev *s, const uint8_t *buf, int len)return len; } +static QemuInputHandler msmouse_handler = { + .name ="QEMU Microsoft Mouse" , + .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_REL , + .event = msmouse_input_event, + .sync = msmouse_input_sync, +}; +static int msmouse_ioctl (Chardev *chr,int cmd,void *arg) {MouseChardev *mouse =MOUSE_CHARDEV (chr); -int c; +int c, i, j; +uint8_t bytes[MSMOUSE_BUF_SZ /2 ];int *targ = (int *)arg; +const uint8_t hexchr[16 ] = {M ('0' ),M ('1' ),M ('2' ),M ('3' ),M ('4' ),M ('5' ), +M ('6' ),M ('7' ),M ('8' ),M ('9' ),M ('A' ),M ('B' ), +M ('C' ),M ('D' ),M ('E' ),M ('F' )};switch (cmd) {case CHR_IOCTL_SERIAL_SET_TIOCM :
@@ -171,11 +195,30 @@ static int msmouse_ioctl(Chardev *chr, int cmd, void *arg)if (MSMOUSE_PWR (mouse->tiocm)) {if (!MSMOUSE_PWR (c)) {/* -* Power on after reset: send "M3" -* cause we behave like a 3 button logitech -* mouse. +* Power on after reset: Send ID and PnP data +* No need to check fifo space as it is empty at this point. */ fifo8_push_all (&mouse->outbuf, mouse_id,sizeof (mouse_id)); +/* Add PnP data: */ +fifo8_push_all (&mouse->outbuf, pnp_data,sizeof (pnp_data)); +/* +* Add device description from qemu handler name. +* Make sure this all fits into the queue beforehand! +*/ + c =M (')' ); +for (i =0 ; msmouse_handler.name[i]; i++) { + bytes[i] =M (msmouse_handler.name[i]); + c += bytes[i]; + } +/* Calc more of checksum */ +for (j =0 ; j <sizeof (pnp_data); j++) { + c += pnp_data[j]; + } + c &=0xff ; + bytes[i++] = hexchr[c >>4 ]; + bytes[i++] = hexchr[c &0x0f ]; + bytes[i++] =M (')' ); +fifo8_push_all (&mouse->outbuf, bytes, i);/* Start sending data to serial. */ msmouse_chr_accept_input (chr); }
@@ -208,13 +251,6 @@ static void char_msmouse_finalize(Object *obj)fifo8_destroy (&mouse->outbuf); } -static QemuInputHandler msmouse_handler = { - .name ="QEMU Microsoft Mouse" , - .mask =INPUT_EVENT_MASK_BTN |INPUT_EVENT_MASK_REL , - .event = msmouse_input_event, - .sync = msmouse_input_sync, -}; - static void msmouse_chr_open(Chardev *chr, ChardevBackend *backend, bool *be_opened,
Signature · 1 line
2.37.3
[PULL 1/8] msmouse: Handle mouse reset
In reply to [email protected]From: Arwed Meyer <[email protected]>
Detect mouse reset via RTS or DTR line:
Don't send or process anything while in reset. When coming out of reset, send ID sequence first thing. This allows msmouse to be detected by common mouse drivers.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/77
Message-Id: <[email protected]>
--- chardev/msmouse.c | 63 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-)
chardev/msmouse.c +61 -2
@@ -25,17 +25,20 @@#include "qemu/osdep.h" #include "qemu/module.h" #include "chardev/char.h" +#include "chardev/char-serial.h" #include "ui/console.h" #include "ui/input.h" #include "qom/object.h" -#define MSMOUSE_LO6 (n) ((n) & 0x3f) -#define MSMOUSE_HI2 (n) (((n) & 0xc0) >> 6) +#define MSMOUSE_LO6 (n) ((n) & 0x3f) +#define MSMOUSE_HI2 (n) (((n) & 0xc0) >> 6) +#define MSMOUSE_PWR (cm) (cm & (CHR_TIOCM_RTS | CHR_TIOCM_DTR))struct MouseChardev {Chardev parent;QemuInputHandlerState *hs; +int tiocm;int axis[INPUT_AXIS__MAX ];bool btns[INPUT_BUTTON__MAX ];bool btnc[INPUT_BUTTON__MAX ];
@@ -109,6 +112,11 @@ static void msmouse_input_event(DeviceState *dev, QemuConsole *src,InputMoveEvent *move;InputBtnEvent *btn; +/* Ignore events if serial mouse powered down. */ +if (!MSMOUSE_PWR (mouse->tiocm)) { +return ; + } +switch (evt->type) {case INPUT_EVENT_KIND_REL : move = evt->u.rel.data;
@@ -132,6 +140,11 @@ static void msmouse_input_sync(DeviceState *dev)MouseChardev *mouse =MOUSE_CHARDEV (dev);Chardev *chr =CHARDEV (dev); +/* Ignore events if serial mouse powered down. */ +if (!MSMOUSE_PWR (mouse->tiocm)) { +return ; + } +msmouse_queue_event (mouse);msmouse_chr_accept_input (chr); }
@@ -142,6 +155,50 @@ static int msmouse_chr_write(struct Chardev *s, const uint8_t *buf, int len)return len; } +static int msmouse_ioctl (Chardev *chr,int cmd,void *arg) +{ +MouseChardev *mouse =MOUSE_CHARDEV (chr); +int c; +int *targ = (int *)arg; + +switch (cmd) { +case CHR_IOCTL_SERIAL_SET_TIOCM : + c = mouse->tiocm; + mouse->tiocm = *(int *)arg; +if (MSMOUSE_PWR (mouse->tiocm)) { +if (!MSMOUSE_PWR (c)) { +/* +* Power on after reset: send "M3" +* cause we behave like a 3 button logitech +* mouse. +*/ + mouse->outbuf[0 ] ='M' ; + mouse->outbuf[1 ] ='3' ; + mouse->outlen =2 ; +/* Start sending data to serial. */ +msmouse_chr_accept_input (chr); + } +break ; + } +/* +* Reset mouse buffers on power down. +* Mouse won't send anything without power. +*/ + mouse->outlen =0 ; +memset (mouse->axis,0 ,sizeof (mouse->axis)); +memset (mouse->btns, false,sizeof (mouse->btns)); +memset (mouse->btnc, false,sizeof (mouse->btns)); +break ; +case CHR_IOCTL_SERIAL_GET_TIOCM : +/* Remember line control status. */ + *targ = mouse->tiocm; +break ; +default : +return -ENOTSUP ; + } +return 0 ; +} +static void char_msmouse_finalize (Object *obj) {MouseChardev *mouse =MOUSE_CHARDEV (obj);
@@ -166,6 +223,7 @@ static void msmouse_chr_open(Chardev *chr, *be_opened = false; mouse->hs =qemu_input_handler_register ((DeviceState *)mouse, &msmouse_handler); + mouse->tiocm =0 ; }static void char_msmouse_class_init (ObjectClass *oc,void *data)
@@ -175,6 +233,7 @@ static void char_msmouse_class_init(ObjectClass *oc, void *data) cc->open = msmouse_chr_open; cc->chr_write = msmouse_chr_write; cc->chr_accept_input = msmouse_chr_accept_input; + cc->chr_ioctl = msmouse_ioctl; }static const TypeInfo char_msmouse_type_info = {
Signature · 1 line
2.37.3
[PULL 7/8] oslib-posix: Introduce qemu_socketpair()
In reply to [email protected]From: Guoyi Tu <[email protected]>
qemu_socketpair() will create a pair of connected sockets with FD_CLOEXEC set
Message-Id: <17fa1eff729eeabd9a001f4639abccb127ceec81.1661240709.git.tugy@chinatelecom.cn>
--- include/qemu/sockets.h | 18 ++++++++++++++++++ util/oslib-posix.c | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+)
include/qemu/sockets.h +18 -0
@@ -14,6 +14,24 @@ int inet_aton(const char *cp, struct in_addr *ia);/* misc helpers */ bool fd_is_socket (int fd);int qemu_socket (int domain,int type,int protocol); + +#ifndef WIN32 +/** +* qemu_socketpair: +* @domain: specifies a communication domain, such as PF_UNIX +* @type: specifies the socket type. +* @protocol: specifies a particular protocol to be used with the socket +* @sv: an array to store the pair of socket created +* +* Creates an unnamed pair of connected sockets in the specified domain, +* of the specified type, and using the optionally specified protocol. +* And automatically set the close-on-exec flags on the returned sockets +* +* Return 0 on success. +*/ +int qemu_socketpair (int domain,int type,int protocol,int sv[2 ]); +#endif +int qemu_accept (int s,struct sockaddr *addr,socklen_t *addrlen);int socket_set_cork (int fd,int v);int socket_set_nodelay (int fd);
util/oslib-posix.c +19 -0
@@ -253,6 +253,25 @@ void qemu_set_cloexec(int fd)assert (f !=-1 ); } +int qemu_socketpair (int domain,int type,int protocol,int sv[2 ]) +{ +int ret; + +#ifdef SOCK_CLOEXEC + ret =socketpair (domain, type |SOCK_CLOEXEC , protocol, sv); +if (ret !=-1 || errno !=EINVAL ) { +return ret; + } +#endif + ret =socketpair (domain, type, protocol, sv);; +if (ret ==0 ) { +qemu_set_cloexec (sv[0 ]); +qemu_set_cloexec (sv[1 ]); + } + +return ret; +} +char *qemu_get_local_state_dir (void ) {
Signature · 1 line
2.37.3
[PULL 6/8] chardev: fix segfault in finalize
In reply to [email protected]From: Maksim Davydov <[email protected]>
If finalize chardev-msmouse or chardev-wctable is called immediately after init it cases QEMU to crash with segfault. This happens because of QTAILQ_REMOVE in qemu_input_handler_unregister tries to dereference NULL pointer.
For instance, this error can be reproduced via qom-list-properties command.
Message-Id: <[email protected]>
--- chardev/msmouse.c | 4 +++- chardev/wctablet.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)
chardev/msmouse.c +3 -1
@@ -247,7 +247,9 @@ static void char_msmouse_finalize(Object *obj) {MouseChardev *mouse =MOUSE_CHARDEV (obj); -qemu_input_handler_unregister (mouse->hs); +if (mouse->hs) { +qemu_input_handler_unregister (mouse->hs); + }fifo8_destroy (&mouse->outbuf); }
chardev/wctablet.c +3 -1
@@ -319,7 +319,9 @@ static void wctablet_chr_finalize(Object *obj) {TabletChardev *tablet =WCTABLET_CHARDEV (obj); -qemu_input_handler_unregister (tablet->hs); +if (tablet->hs) { +qemu_input_handler_unregister (tablet->hs); + } } static void wctablet_chr_open(Chardev *chr,
Signature · 1 line
2.37.3
[PULL 3/8] msmouse: Use fifo8 instead of array
In reply to [email protected]From: Arwed Meyer <[email protected]>
Make use of fifo8 functions instead of implementing own fifo code. This makes the code more readable and reduces risk of bugs.
Message-Id: <[email protected]>
--- chardev/msmouse.c | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-)
chardev/msmouse.c +25 -22
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "qemu/module.h" +#include "qemu/fifo8.h" #include "chardev/char.h" #include "chardev/char-serial.h" #include "ui/console.h"
@@ -34,6 +35,12 @@#define MSMOUSE_HI2 (n) (((n) & 0xc0) >> 6)#define MSMOUSE_PWR (cm) (cm & (CHR_TIOCM_RTS | CHR_TIOCM_DTR)) +/* Serial fifo size. */ +#define MSMOUSE_BUF_SZ 64 + +/* Mouse ID: Send "M3" cause we behave like a 3 button logitech mouse. */ +const uint8_t mouse_id[] = {'M' ,'3' }; +struct MouseChardev {Chardev parent;
@@ -42,8 +49,7 @@ struct MouseChardev {int axis[INPUT_AXIS__MAX ];bool btns[INPUT_BUTTON__MAX ];bool btnc[INPUT_BUTTON__MAX ]; -uint8_t outbuf[32 ]; -int outlen; +Fifo8 outbuf; };typedef struct MouseChardev MouseChardev ;
@@ -54,20 +60,18 @@ DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV,static void msmouse_chr_accept_input (Chardev *chr) {MouseChardev *mouse =MOUSE_CHARDEV (chr); -int len; +uint32_t len, avail; len =qemu_chr_be_can_write (chr); -if (len > mouse->outlen) { - len = mouse->outlen; - } -if (!len) { -return ; - } - -qemu_chr_be_write (chr, mouse->outbuf, len); - mouse->outlen -= len; -if (mouse->outlen) { -memmove (mouse->outbuf, mouse->outbuf + len, mouse->outlen); + avail =fifo8_num_used (&mouse->outbuf); +while (len >0 && avail >0 ) { +const uint8_t *buf; +uint32_t size; + + buf =fifo8_pop_buf (&mouse->outbuf,MIN (len, avail), &size); +qemu_chr_be_write (chr, buf, size); + len =qemu_chr_be_can_write (chr); + avail -= size; } }
@@ -94,12 +98,11 @@ static void msmouse_queue_event(MouseChardev *mouse) mouse->btnc[INPUT_BUTTON_MIDDLE]) { bytes[3 ] |= (mouse->btns[INPUT_BUTTON_MIDDLE ] ?0x20 :0x00 ); mouse->btnc[INPUT_BUTTON_MIDDLE ] = false; - count =4 ; + count++; } -if (mouse->outlen <=sizeof (mouse->outbuf) - count) { -memcpy (mouse->outbuf + mouse->outlen, bytes, count); - mouse->outlen += count; +if (fifo8_num_free (&mouse->outbuf) >= count) { +fifo8_push_all (&mouse->outbuf, bytes, count); }else {/* queue full -> drop event */ }
@@ -172,9 +175,7 @@ static int msmouse_ioctl(Chardev *chr, int cmd, void *arg)* cause we behave like a 3 button logitech * mouse. */ - mouse->outbuf[0 ] ='M' ; - mouse->outbuf[1 ] ='3' ; - mouse->outlen =2 ; +fifo8_push_all (&mouse->outbuf, mouse_id,sizeof (mouse_id));/* Start sending data to serial. */ msmouse_chr_accept_input (chr); }
@@ -184,7 +185,7 @@ static int msmouse_ioctl(Chardev *chr, int cmd, void *arg)* Reset mouse buffers on power down. * Mouse won't send anything without power. */ - mouse->outlen =0 ; +fifo8_reset (&mouse->outbuf);memset (mouse->axis,0 ,sizeof (mouse->axis));memset (mouse->btns, false,sizeof (mouse->btns));memset (mouse->btnc, false,sizeof (mouse->btns));
@@ -204,6 +205,7 @@ static void char_msmouse_finalize(Object *obj)MouseChardev *mouse =MOUSE_CHARDEV (obj);qemu_input_handler_unregister (mouse->hs); +fifo8_destroy (&mouse->outbuf); }static QemuInputHandler msmouse_handler = {
@@ -224,6 +226,7 @@ static void msmouse_chr_open(Chardev *chr, mouse->hs =qemu_input_handler_register ((DeviceState *)mouse, &msmouse_handler); mouse->tiocm =0 ; +fifo8_create (&mouse->outbuf,MSMOUSE_BUF_SZ ); }static void char_msmouse_class_init (ObjectClass *oc,void *data)
Signature · 1 line
2.37.3
[PULL 8/8] vhost-user: Call qemu_socketpair() instead of socketpair()
In reply to [email protected]From: Guoyi Tu <[email protected]>
As the close-on-exec flags is not set on the file descriptors returned by socketpair() at default, the fds will survive across exec' function.
In the case that exec' function get invoked, such as the live-update feature which is been developing, it will cause fd leaks.
To address this problem, we should call qemu_socketpair() to create an pair of connected sockets with the close-on-exec flag set.
Message-Id: <7002b12a5fb0a30cd878e14e07da61c36da72913.1661240709.git.tugy@chinatelecom.cn>
--- hw/display/vhost-user-gpu.c | 3 ++- hw/virtio/vhost-user.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
hw/display/vhost-user-gpu.c +2 -1
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qemu/sockets.h" #include "hw/qdev-properties.h" #include "hw/virtio/virtio-gpu.h" #include "chardev/char-fe.h"
@@ -375,7 +376,7 @@ vhost_user_gpu_do_set_socket(VhostUserGPU *g, Error **errp)Chardev *chr;int sv[2 ]; -if (socketpair (PF_UNIX ,SOCK_STREAM ,0 , sv) ==-1 ) { +if (qemu_socketpair (PF_UNIX ,SOCK_STREAM ,0 , sv) ==-1 ) {error_setg_errno (errp, errno,"socketpair() failed" );return false; }
hw/virtio/vhost-user.c +1 -1
@@ -1726,7 +1726,7 @@ static int vhost_setup_slave_channel(struct vhost_dev *dev)return 0 ; } -if (socketpair (PF_UNIX ,SOCK_STREAM ,0 , sv) ==-1 ) { +if (qemu_socketpair (PF_UNIX ,SOCK_STREAM ,0 , sv) ==-1 ) {int saved_errno = errno;error_report ("socketpair() failed" );return -saved_errno;
Signature · 1 line
2.37.3
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes.