/qemu/python/qemu/qmp/ |
H A D | util.py | 28 # -------------------------- 30 # -------------------------- 33 async def flush(writer: asyncio.StreamWriter) -> None: 38 the "high-water mark". This function ensures we flush the entire 39 buffer -- by setting the high water mark to 0 and then calling 43 transport = cast( # type: ignore[redundant-cast] 56 def upper_half(func: T) -> T: 58 Do-nothing decorator that annotates a method as an "upper-half" method. 60 These methods must not call bottom-half functions directly, but can 66 def bottom_half(func: T) -> T: [all …]
|
H A D | protocol.py | 2 Generic Asynchronous Message-based Protocol Support 14 # pylint: disable=too-many-lines 51 _TaskFN = Callable[[], Awaitable[None]] # aka ``async def func() -> None`` 79 :param error_message: Human-readable string describing the error. 80 :param exc: The root-cause exception. 84 #: Human-readable error string 89 def __str__(self) -> str: 105 :param error_message: Human-readable string describing the state violation. 117 F = TypeVar('F', bound=Callable[..., Any]) # pylint: disable=invalid-name 121 def require(required_state: Runstate) -> Callable[[F], F]: [all …]
|
/qemu/tests/qemu-iotests/ |
H A D | 032 | 4 # Test that AIO requests are drained before an image is closed. This used 56 # actually loop a while and issue many I/O requests for the lower layer 62 $QEMU_IO -c "aio_write 0 4M" -c "close" "$TEST_IMG" | _filter_qemu_io 67 rm -f $seq.full
|
/qemu/tests/unit/ |
H A D | test-io-channel-socket.c | 4 * Copyright (c) 2015-2016 Red Hat, Inc. 22 #include "io/channel-socket.h" 23 #include "io/channel-util.h" 24 #include "io-channel-helpers.h" 25 #include "socket-helpers.h" 28 #include "qemu/main-loop.h" 40 setsockopt(((QIOChannelSocket *)src)->fd, in test_io_channel_set_socket_bufs() 45 setsockopt(((QIOChannelSocket *)dst)->fd, in test_io_channel_set_socket_bufs() 63 if (listen_addr->type == SOCKET_ADDRESS_TYPE_INET) { in test_io_channel_setup_sync() 67 g_free(connect_addr->u.inet.port); in test_io_channel_setup_sync() [all …]
|
H A D | test-char.c | 5 #include "qemu/config-file.h" 9 #include "chardev/char-fe.h" 12 #include "qapi/qapi-commands-char.h" 14 #include "qom/qom-qobject.h" 15 #include "io/channel-socket.h" 16 #include "qapi/qobject-input-visitor.h" 17 #include "qapi/qapi-visit-sockets.h" 18 #include "socket-helpers.h" 43 return sizeof(h->read_buf) - h->read_count; in fe_can_read() 52 memcpy(h->read_buf + h->read_count, buf, size); in fe_read() [all …]
|
/qemu/qga/ |
H A D | channel-posix.c | 13 #define GA_CHANNEL_BAUDRATE_DEFAULT B38400 /* for isa-serial channels */ 35 if (client_fd == -1) { in ga_channel_listen_accept() 54 * indicates we should use the existing s->listen_channel 59 c->listen_channel = g_io_channel_unix_new(listen_fd); in ga_channel_listen_add() 61 g_io_add_watch(c->listen_channel, G_IO_IN, ga_channel_listen_accept, c); in ga_channel_listen_add() 66 g_assert(c->listen_channel); in ga_channel_listen_close() 67 g_io_channel_shutdown(c->listen_channel, true, NULL); in ga_channel_listen_close() 68 g_io_channel_unref(c->listen_channel); in ga_channel_listen_close() 69 c->listen_channel = NULL; in ga_channel_listen_close() 72 /* cleanup state for closed connection/session, start accepting new [all …]
|
/qemu/scripts/oss-fuzz/ |
H A D | minimize_qtest_trace.py | 2 # -*- coding: utf-8 -*- 34 By default, will try to use the second-to-last line in the output to identify 40 -M1: enable a loop around the remove minimizer, which may help decrease some 42 -M2: try setting bits in operand of write/out to zero. Off by default. 57 rc = subprocess.Popen("timeout -s 9 {timeout}s {qemu_path} {qemu_args} 2>&1\ 65 encoding="utf-8") 70 CRASH_TOKEN = " ".join(outs.splitlines()[-2].split()[0:3]) 80 if "CLOSED" in line: 86 print(" There is no 'CLOSED'or CRASH_TOKEN in the stdout of subprocess.") 95 if i <=(HINT_LEN-1): [all …]
|
/qemu/util/ |
H A D | vhost-user-server.c | 2 * Sharing QEMU devices via vhost-user protocol 8 * later. See the COPYING file in the top-level directory. 11 #include "qemu/error-report.h" 12 #include "qemu/main-loop.h" 13 #include "qemu/vhost-user-server.h" 14 #include "block/aio-wait.h" 20 * vhost_user_server_stop() from the main loop thread. Starting the server 21 * opens a vhost-user UNIX domain socket and listens for incoming connections. 25 * VuServer->ctx AioContext. The coroutine consists of a vu_dispatch() loop 26 * where libvhost-user calls vu_message_read() to receive the next vhost-user [all …]
|
H A D | oslib-win32.c | 2 * os-win32.c 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * Copyright (c) 2010-2016 Red Hat, Inc. 32 #include "qemu/main-loop.h" 36 #include "qemu/error-report.h" 191 return -socket_error(); in qemu_socket_try_set_nonblock() 207 * http://msdn.microsoft.com/en-us/library/windows/desktop/ms740621.aspx */ in socket_set_fast_reuse() 217 ia->s_addr = addr; in inet_aton() 273 sz = (sz + pagesize - 1) & -pagesize; in qemu_prealloc_mem() 327 int listener = -1; in qemu_socketpair() [all …]
|
/qemu/linux-headers/linux/ |
H A D | vhost.h | 1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 4 /* Userspace interface for in-kernel virtio accelerators. */ 18 #define VHOST_FILE_UNBIND -1 64 * the kernel will free all the device's workers when the device is closed. 80 * or VHOST_VRING_BIG_ENDIAN (other values return -EINVAL). 82 * returns -EBUSY. 114 /* Set busy loop timeout (in us) */ 117 /* Get busy loop timeout (in us) */ 130 * used for transmit. Pass fd -1 to unbind from the socket and the transmit 152 * the device id defined in virtio-spec. [all …]
|
/qemu/qapi/ |
H A D | misc.json | 1 # -*- Mode: Python -*- 18 # fail and the FD will be closed. 21 # "@dbus-display" or the name of a character device (e.g. from 22 # -chardev id=XXXX) 33 # .. qmp-example:: 35 # -> { "execute": "add_client", "arguments": { "protocol": "vnc", 37 # <- { "return": {} } 55 # @query-name: 63 # .. qmp-example:: 65 # -> { "execute": "query-name" } [all …]
|
/qemu/hw/xen/ |
H A D | xen_pvdev.c | 2 * Xen para-virtualization device 22 #include "qemu/main-loop.h" 23 #include "hw/qdev-core.h" 24 #include "hw/xen/xen-legacy-backend.h" 25 #include "hw/xen/xen-bus-helper.h" 42 /* ------------------------------------------------------------- */ 49 d->xs_dir = dir; in xenstore_cleanup_dir() 58 qemu_xen_xs_destroy(xenstore, 0, d->xs_dir); in xen_config_cleanup() 66 return -1; in xenstore_mkdir() 78 return -1; in xenstore_write_str() [all …]
|
H A D | xen-legacy-backend.c | 17 * Contributions after 2012-01-13 are licensed under the terms of the 29 #include "hw/qdev-properties.h" 30 #include "qemu/main-loop.h" 32 #include "hw/xen/xen-legacy-backend.h" 39 /* ------------------------------------------------------------- */ 51 return xenstore_write_str(xendev->be, node, val); in xenstore_write_be_str() 57 return xenstore_write_int(xendev->be, node, ival); in xenstore_write_be_int() 63 return xenstore_write_int64(xendev->be, node, ival); in xenstore_write_be_int64() 68 return xenstore_read_str(xendev->be, node); in xenstore_read_be_str() 74 return xenstore_read_int(xendev->be, node, ival); in xenstore_read_be_int() [all …]
|
H A D | xen-bus.c | 5 * See the COPYING file in the top-level directory. 9 #include "qemu/main-loop.h" 12 #include "hw/qdev-properties.h" 15 #include "hw/xen/xen-backend.h" 16 #include "hw/xen/xen-legacy-backend.h" /* xen_be_init() */ 17 #include "hw/xen/xen-bus.h" 18 #include "hw/xen/xen-bus-helper.h" 31 const char *backend = xendev_class->backend; in xen_device_get_backend_path() 38 xenbus->backend_id, backend, xendev->frontend_id, in xen_device_get_backend_path() 39 xendev->name); in xen_device_get_backend_path() [all …]
|
/qemu/ui/ |
H A D | dbus-clipboard.c | 4 * Copyright (c) 2021 Marc-André Lureau <marcandre.lureau@redhat.com> 26 #include "qemu/error-report.h" 27 #include "qemu/main-loop.h" 35 #define MIME_TEXT_PLAIN_UTF8 "text/plain;charset=utf-8" 46 info->types[type].data, in dbus_clipboard_complete_request() 47 info->types[type].size, in dbus_clipboard_complete_request() 53 dpy->clipboard, invocation, in dbus_clipboard_complete_request() 60 bool self_update = info->owner == &dpy->clipboard_peer; in dbus_clipboard_update_info() 65 if (info->owner == NULL) { in dbus_clipboard_update_info() 66 if (dpy->clipboard_proxy) { in dbus_clipboard_update_info() [all …]
|
/qemu/chardev/ |
H A D | char-socket.c | 4 * Copyright (c) 2003-2008 Fabrice Bellard 27 #include "io/channel-socket.h" 28 #include "io/channel-websock.h" 29 #include "qemu/error-report.h" 33 #include "qapi/clone-visitor.h" 34 #include "qapi/qapi-visit-sockets.h" 38 #include "chardev/char-io.h" 39 #include "chardev/char-socket.h" 50 assert(s->state == TCP_CHARDEV_STATE_DISCONNECTED); in tcp_chr_change_state() 53 assert(s->state == TCP_CHARDEV_STATE_CONNECTING); in tcp_chr_change_state() [all …]
|
/qemu/block/export/ |
H A D | fuse.c | 24 #include "block/block_int-common.h" 29 #include "qapi/qapi-commands-block.h" 30 #include "qemu/main-loop.h" 31 #include "system/block-backend.h" 86 aio_set_fd_handler(exp->common.ctx, in fuse_export_drained_begin() 87 fuse_session_fd(exp->fuse_session), in fuse_export_drained_begin() 89 exp->fd_handler_set_up = false; in fuse_export_drained_begin() 97 exp->common.ctx = blk_get_aio_context(exp->common.blk); in fuse_export_drained_end() 99 aio_set_fd_handler(exp->common.ctx, in fuse_export_drained_end() 100 fuse_session_fd(exp->fuse_session), in fuse_export_drained_end() [all …]
|
/qemu/block/ |
H A D | nbd.c | 36 #include "qemu/main-loop.h" 38 #include "qapi/qapi-visit-sockets.h" 40 #include "qapi/clone-visitor.h" 52 #define COOKIE_TO_INDEX(cookie) ((cookie) - 1) 115 BDRVNBDState *s = (BDRVNBDState *)bs->opaque; in nbd_clear_bdrvstate() 117 nbd_client_connection_release(s->conn); in nbd_clear_bdrvstate() 118 s->conn = NULL; in nbd_clear_bdrvstate() 120 yank_unregister_instance(BLOCKDEV_YANK_INSTANCE(bs->node_name)); in nbd_clear_bdrvstate() 123 assert(!s->reconnect_delay_timer); in nbd_clear_bdrvstate() 124 assert(!s->open_timer); in nbd_clear_bdrvstate() [all …]
|
H A D | parallels.c | 32 #include "qemu/error-report.h" 36 #include "system/block-backend.h" 40 #include "qapi/qobject-input-visitor.h" 41 #include "qapi/qapi-visit-block-core.h" 64 #define PARALLELS_OPT_PREALLOC_MODE "prealloc-mode" 65 #define PARALLELS_OPT_PREALLOC_SIZE "prealloc-size" 89 .name = "parallels-create-opts", 110 return (uint64_t)le32_to_cpu(s->bat_bitmap[idx]) * s->off_multiplier; in bat2sect() 122 index = sector_num / s->tracks; in seek_to_sector() 123 offset = sector_num % s->tracks; in seek_to_sector() [all …]
|
H A D | io.c | 27 #include "system/block-backend.h" 28 #include "block/aio-wait.h" 33 #include "block/dirty-bitmap.h" 34 #include "block/write-threshold.h" 38 #include "qemu/error-report.h" 39 #include "qemu/main-loop.h" 43 /* Maximum bounce buffer for copy-on-read and write zeroes, in bytes */ 62 QLIST_FOREACH_SAFE(c, &bs->parents, next_parent, next) { in bdrv_parent_drained_begin() 74 assert(c->quiesced_parent); in bdrv_parent_drained_end_single() 75 c->quiesced_parent = false; in bdrv_parent_drained_end_single() [all …]
|
H A D | qed.c | 11 * See the COPYING.LIB file in the top-level directory. 20 #include "qemu/main-loop.h" 26 #include "system/block-backend.h" 28 #include "qapi/qobject-input-visitor.h" 29 #include "qapi/qapi-visit-block-core.h" 41 if (le32_to_cpu(header->magic) != QED_MAGIC) { in bdrv_qed_probe() 59 cpu->magic = le32_to_cpu(le->magic); in qed_header_le_to_cpu() 60 cpu->cluster_size = le32_to_cpu(le->cluster_size); in qed_header_le_to_cpu() 61 cpu->table_size = le32_to_cpu(le->table_size); in qed_header_le_to_cpu() 62 cpu->header_size = le32_to_cpu(le->header_size); in qed_header_le_to_cpu() [all …]
|
/qemu/hw/9pfs/ |
H A D | 9p.c | 10 * the COPYING file in the top-level directory. 26 #include "qemu/error-report.h" 28 #include "qemu/main-loop.h" 30 #include "virtio-9p.h" 31 #include "fsdev/qemu-fsdev.h" 32 #include "9p-xattr.h" 33 #include "9p-util.h" 64 ret = pdu->s->transport->pdu_vmarshal(pdu, offset, fmt, ap); in pdu_marshal() 76 ret = pdu->s->transport->pdu_vunmarshal(pdu, offset, fmt, ap); in pdu_unmarshal() 167 credp->fc_uid = -1; in cred_init() [all …]
|
/qemu/nbd/ |
H A D | server.c | 24 #include "block/dirty-bitmap.h" 28 #include "nbd-internal.h" 117 bool allocation_depth; /* export qemu:allocation-depth */ 119 * export qemu:dirty-bitmap:<export bitmap name>, 120 * sized by exp->nr_export_bitmaps 150 uint32_t check_align; /* If non-zero, check for aligned client requests */ 174 ---- 192 stq_be_p(&rep->magic, NBD_REP_MAGIC); in set_be_option_rep() 193 stl_be_p(&rep->option, option); in set_be_option_rep() 194 stl_be_p(&rep->type, type); in set_be_option_rep() [all …]
|
/qemu/migration/ |
H A D | savevm.c | 4 * Copyright (c) 2003-2008 Fabrice Bellard 5 * Copyright (c) 2009-2015 Red Hat Inc 34 #include "migration-stats.h" 39 #include "migration/channel-block.h" 42 #include "qemu-file.h" 44 #include "postcopy-ram.h" 46 #include "qapi/qapi-commands-migration.h" 47 #include "qapi/clone-visitor.h" 48 #include "qapi/qapi-builtin-visit.h" 49 #include "qemu/error-report.h" [all …]
|
/qemu/ |
H A D | block.c | 30 #include "block/dirty-bitmap.h" 34 #include "qemu/error-report.h" 36 #include "qemu/main-loop.h" 43 #include "qapi/qobject-output-visitor.h" 44 #include "qapi/qapi-visit-block-core.h" 45 #include "system/block-backend.h" 113 /* If non-zero, use only whitelisted block drivers */ 138 if (!bs || !bs->drv) { in bdrv_opt_mem_align() 144 return bs->bl.opt_mem_alignment; in bdrv_opt_mem_align() 149 if (!bs || !bs->drv) { in bdrv_min_mem_align() [all …]
|