/qemu/util/ |
H A D | fifo8.c | 21 fifo->num = 0; in fifo8_reset() 22 fifo->head = 0; in fifo8_reset() 27 fifo->data = g_new(uint8_t, capacity); in fifo8_create() 28 fifo->capacity = capacity; in fifo8_create() 34 g_free(fifo->data); in fifo8_destroy() 39 assert(fifo->num < fifo->capacity); in fifo8_push() 40 fifo->data[(fifo->head + fifo->num) % fifo->capacity] = data; in fifo8_push() 41 fifo->num++; in fifo8_push() 48 assert(fifo->num + num <= fifo->capacity); in fifo8_push_all() 50 start = (fifo->head + fifo->num) % fifo->capacity; in fifo8_push_all() [all …]
|
H A D | buffer.c | 22 #include "qemu/host-utils.h" 34 static size_t buffer_req_size(Buffer *buffer, size_t len) in buffer_req_size() argument 36 return MAX(BUFFER_MIN_INIT_SIZE, in buffer_req_size() 37 pow2ceil(buffer->offset + len)); in buffer_req_size() 40 static void buffer_adj_size(Buffer *buffer, size_t len) in buffer_adj_size() argument 42 size_t old = buffer->capacity; in buffer_adj_size() 43 buffer->capacity = buffer_req_size(buffer, len); in buffer_adj_size() 44 buffer->buffer = g_realloc(buffer->buffer, buffer->capacity); in buffer_adj_size() 45 trace_buffer_resize(buffer->name ?: "unnamed", in buffer_adj_size() 46 old, buffer->capacity); in buffer_adj_size() [all …]
|
/qemu/tests/qemu-iotests/ |
H A D | 257.out | 4 --- Preparing image & VM --- 6 {"execute": "blockdev-add", "arguments": {"driver": "qcow2", "file": {"driver": "file", "filename":… 9 --- Write #0 --- 11 write -P0x49 0x0000000 0x10000 13 write -P0x6c 0x0100000 0x10000 15 write -P0x6f 0x2000000 0x10000 17 write -P0x76 0x3ff0000 0x10000 23 --- Reference Backup #0 --- 26 {"execute": "job-dismiss", "arguments": {"id": "bdc-file-job"}} 30 {"execute": "job-dismiss", "arguments": {"id": "bdc-fmt-job"}} [all …]
|
H A D | 258.out | 5 {"execute": "object-add", "arguments": {"id": "tg", "limits": {"iops-write": 1, "iops-write-max": 1… 7 …-add", "arguments": {"backing": {"backing": {"backing": {"backing": {"driver": "raw", "file": {"dr… 9 …k-commit", "arguments": {"auto-finalize": false, "base-node": "node0", "device": "node4", "filter-… 11 {"execute": "block-stream", "arguments": {"base-node": "commit-filter", "device": "node3", "job-id"… 13 {"execute": "job-finalize", "arguments": {"id": "commit"}} 16 {"data": {"device": "commit", "len": 67108864, "offset": 67108864, "speed": 0, "type": "commit"}, "… 17 {"data": {"device": "stream", "len": 67108864, "offset": 67108864, "speed": 0, "type": "stream"}, "… 21 {"execute": "object-add", "arguments": {"id": "tg", "limits": {"iops-write": 1, "iops-write-max": 1… 23 …-add", "arguments": {"backing": {"backing": {"backing": {"backing": {"driver": "raw", "file": {"dr… 25 …k-commit", "arguments": {"auto-finalize": false, "base-node": "node0", "device": "node4", "filter-… [all …]
|
/qemu/tests/bench/ |
H A D | bufferiszero-bench.c | 6 * top-level directory. 14 size_t max = 64 * KiB; in test() local 15 void *buf = g_malloc0(max); in test() 22 for (size_t len = 1 * KiB; len <= max; len *= 4) { in test() local 27 buffer_is_zero_ge256(buf, len); in test() 28 total += len; in test() 33 accel_index, len / (size_t)KiB, in test()
|
/qemu/include/user/ |
H A D | page-protection.h | 6 * SPDX-License-Identifier: LGPL-2.1+ 16 #include "exec/translation-block.h" 40 * @len: length of range 43 * Return true if every page in [@start, @start+@len) has @flags set. 64 * @max: last byte of search range 65 * @len: size of the hole required 68 * If there is a range [x, x+@len) within [@min, @max] such that 69 * x % @align == 0, then return x. Otherwise return -1. 73 vaddr page_find_range_empty(vaddr min, vaddr max, vaddr len, vaddr align); 78 * @size: per-page size [all …]
|
/qemu/hw/virtio/ |
H A D | virtio.c | 10 * the COPYING file in the top-level directory. 16 #include "qapi/qapi-commands-virtio.h" 18 #include "qemu/defer-call.h" 19 #include "qemu/error-report.h" 21 #include "qemu/main-loop.h" 28 #include "migration/qemu-file-types.h" 30 #include "hw/virtio/virtio-bus.h" 31 #include "hw/qdev-properties.h" 32 #include "hw/virtio/virtio-access.h" 35 #include "virtio-qmp.h" [all …]
|
/qemu/tests/qtest/ |
H A D | virtio-net-test.c | 7 * See the COPYING file in the top-level directory. 11 #include "libqtest-single.h" 15 #include "hw/virtio/virtio-net.h" 17 #include "libqos/virtio-net.h" 40 int len = htonl(sizeof(test)); in rx_test() local 43 .iov_base = &len, in rx_test() 44 .iov_len = sizeof(len), in rx_test() 57 ret = iov_send(socket, iov, 2, 0, sizeof(len) + sizeof(test)); in rx_test() 58 g_assert_cmpint(ret, ==, sizeof(test) + sizeof(len)); in rx_test() 75 uint32_t len; in tx_test() local [all …]
|
H A D | boot-sector.c | 11 * See the COPYING file in the top-level directory. 14 #include "boot-sector.h" 58 /* 7c0e: jmp 0x7c07=0x7c0f-3 */ 60 [0x0e] = LOW(-3), 74 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 /* in the s390-ccw bios */ 91 size_t len; in boot_sector_init() local 103 len = MAX(0x7e000, sizeof(x86_boot_sector)); in boot_sector_init() 104 boot_code = g_malloc0(len); in boot_sector_init() 111 len = strlen(boot_code); in boot_sector_init() 113 len = 0x10000 + sizeof(s390x_code); in boot_sector_init() [all …]
|
/qemu/scripts/ |
H A D | analyse-locks-simpletrace.py | 2 # -*- coding: utf-8 -*- 46 acquire_time = rec["locked_time"] - rec["lock_time"] 54 held_time = timestamp[0] - rec["locked_time"] 62 parser.add_argument("--output", "-o", type=str, help="Render plot to file") 84 if len(acquire_times) > 0: 85 print (" Acquire Time: min:%d median:%d avg:%.2f max:%d" % 87 acquire_times.mean(), acquire_times.max())) 90 if len(held_times) > 0: 91 print (" Held Time: min:%d median:%d avg:%.2f max:%d" % 93 held_times.mean(), held_times.max()))
|
/qemu/tests/image-fuzzer/qcow2/ |
H A D | layout.py | 80 return len(self.data) 159 free_space = self.cluster_size - self.ext_offset - \ 165 (free_space >= len(backing_file_name)): 166 self.header['backing_file_size'][0].value = len(backing_file_name) 168 self.cluster_size - len(backing_file_name) 176 data_len = len(backing_file_name) 189 (self.cluster_size - 1)) - \ 191 free_space = high_border - self.ext_offset 192 ext_size = 2 * UINT32_S + ((len(backing_file_fmt) + 7) & ~7) 195 ext_data_len = len(backing_file_fmt) [all …]
|
/qemu/scripts/simplebench/ |
H A D | bench-backup.py | 3 # Bench backup block-job 31 cmd_options = env['cmd-options'] if 'cmd-options' in env else {} 32 return bench_block_copy(env['qemu-binary'], env['cmd'], 47 port = '10809' if len(nbd) == 1 else nbd[1] 57 raise ValueError("'nbd' label used but --nbd is not given") 62 source = drv_qcow2(drv_file(dirs[src] + '/test-source.qcow2')) 64 source = drv_file(dirs[src] + '/test-source') 77 fname = dirs[dst] + '/test-target' 94 if len(name_path) == 1: 98 assert len(name_path) == 2 # paths with colon not supported [all …]
|
/qemu/backends/tpm/ |
H A D | trace-events | 8 tpm_util_get_buffer_size_hdr_len(uint32_t len, size_t expected) "tpm_resp->hdr.len = %u, expected =… 9 tpm_util_get_buffer_size_len(uint32_t len, size_t expected) "tpm_resp->len = %u, expected = %zu" 10 tpm_util_get_buffer_size_hdr_len2(uint32_t len, size_t expected) "tpm2_resp->hdr.len = %u, expected… 11 tpm_util_get_buffer_size_len2(uint32_t len, size_t expected) "tpm2_resp->len = %u, expected = %zu" 12 tpm_util_get_buffer_size(size_t len) "buffersize of device: %zu" 13 tpm_util_show_buffer_header(const char *direction, size_t len) "direction: %s len: %zu" 20 …r_size(uint32_t buffersize, uint32_t minsize, uint32_t maxsize) "buffer size: %u, min: %u, max: %u"
|
/qemu/pc-bios/s390-ccw/ |
H A D | sclp.c | 7 * your option) any later version. See the COPYING file in the top-level 12 #include "s390-ccw.h" 15 long write(int fd, const void *str, size_t len); 24 "-/.........,%_>?.........`:#@'=\""/* 7F */ 30 /* Perform service call. Return 0 on success, non-zero otherwise. */ 43 return -EIO; in sclp_service_call() 45 return -EBUSY; in sclp_service_call() 53 sccb->h.length = sizeof(WriteEventMask); in sclp_set_write_mask() 54 sccb->mask_length = sizeof(unsigned int); in sclp_set_write_mask() 55 sccb->cp_receive_mask = receive_mask; in sclp_set_write_mask() [all …]
|
/qemu/hw/char/ |
H A D | spapr_vty.c | 2 #include "qemu/error-report.h" 6 #include "chardev/char-fe.h" 9 #include "hw/qdev-properties.h" 10 #include "hw/qdev-properties-system.h" 22 #define TYPE_VIO_SPAPR_VTY_DEVICE "spapr-vty" 29 return VTERM_BUFSIZE - (dev->in - dev->out); in OBJECT_DECLARE_SIMPLE_TYPE() 37 if ((dev->in == dev->out) && size) { in vty_receive() 39 spapr_vio_irq_pulse(&dev->sdev); in vty_receive() 42 if (dev->in - dev->out >= VTERM_BUFSIZE) { in vty_receive() 45 error_report("VTY input buffer exhausted - characters dropped." in vty_receive() [all …]
|
H A D | xen_console.c | 29 #include "chardev/char-fe.h" 30 #include "hw/xen/xen-backend.h" 31 #include "hw/xen/xen-bus-helper.h" 32 #include "hw/qdev-properties.h" 33 #include "hw/qdev-properties-system.h" 61 #define TYPE_XEN_CONSOLE_DEVICE "xen-console" 66 struct buffer *buffer = &con->buffer; in OBJECT_DECLARE_SIMPLE_TYPE() 68 struct xencons_interface *intf = con->sring; in OBJECT_DECLARE_SIMPLE_TYPE() 70 cons = intf->out_cons; in OBJECT_DECLARE_SIMPLE_TYPE() 71 prod = intf->out_prod; in OBJECT_DECLARE_SIMPLE_TYPE() [all …]
|
/qemu/block/ |
H A D | backup.c | 11 * See the COPYING file in the top-level directory. 22 #include "block/block-copy.h" 23 #include "block/dirty-bitmap.h" 26 #include "system/block-backend.h" 28 #include "qemu/error-report.h" 30 #include "block/copy-before-write.h" 44 uint64_t len; member 59 bool sync = (((ret == 0) || (job->bitmap_mode == BITMAP_SYNC_MODE_ALWAYS)) \ in backup_cleanup_sync_bitmap() 60 && (job->bitmap_mode != BITMAP_SYNC_MODE_NEVER)); in backup_cleanup_sync_bitmap() 67 bm = bdrv_dirty_bitmap_abdicate(job->sync_bitmap, NULL); in backup_cleanup_sync_bitmap() [all …]
|
/qemu/hw/scsi/ |
H A D | trace-events | 3 # scsi-bus.c 6 scsi_req_data(int target, int lun, int tag, int len) "target %d lun %d tag %d len %d" 7 scsi_req_data_canceled(int target, int lun, int tag, int len) "target %d lun %d tag %d len %d" 34 mptsas_process_scsi_io_request(void *dev, int bus, int target, int lun, uint64_t len) "dev %p dev %… 47 …len, uint32_t head, uint32_t tail, uint32_t flags) "queue at 0x%" PRIx64 " len %d head 0x%" PRIx32… 50 megasas_initq_mismatch(int queue_len, int fw_cmds) "queue size %d max fw cmds %d" 63 …cdb_len(const char *frame, int bus, int dev, int lun, int len) "%s dev %x/%x/%x invalid cdb len %d" 64 megasas_iov_read_overflow(int cmd, int bytes, int len) "scmd %d: %d/%d bytes" 65 megasas_iov_write_overflow(int cmd, int bytes, int len) "scmd %d: %d/%d bytes" 66 megasas_iov_read_underflow(int cmd, int bytes, int len) "scmd %d: %d/%d bytes" [all …]
|
/qemu/bsd-user/netbsd/ |
H A D | target_os_elf.h | 25 #include "user/tswap-target.h" 52 /* max code+data+bss space allocated to elf interpreter */ 55 /* max code+data+bss+brk space allocated to ET_DYN executables */ 61 ~(unsigned long)(TARGET_ELF_EXEC_PAGESIZE - 1)) 62 #define TARGET_ELF_PAGEOFFSET(_v) ((_v) & (TARGET_ELF_EXEC_PAGESIZE - 1)) 84 size_t len = strlen(k_platform) + 1; in target_create_elf_tables() local 85 sp -= (len + n - 1) & ~(n - 1); in target_create_elf_tables() 87 /* FIXME - check return value of memcpy_to_target() for failure */ in target_create_elf_tables() 88 memcpy_to_target(sp, k_platform, len); in target_create_elf_tables() 105 sp -= 16 - (size & 15); in target_create_elf_tables() [all …]
|
/qemu/bsd-user/openbsd/ |
H A D | target_os_elf.h | 25 #include "user/tswap-target.h" 52 /* max code+data+bss space allocated to elf interpreter */ 55 /* max code+data+bss+brk space allocated to ET_DYN executables */ 61 ~(unsigned long)(TARGET_ELF_EXEC_PAGESIZE - 1)) 62 #define TARGET_ELF_PAGEOFFSET(_v) ((_v) & (TARGET_ELF_EXEC_PAGESIZE - 1)) 84 size_t len = strlen(k_platform) + 1; in target_create_elf_tables() local 85 sp -= (len + n - 1) & ~(n - 1); in target_create_elf_tables() 87 /* FIXME - check return value of memcpy_to_target() for failure */ in target_create_elf_tables() 88 memcpy_to_target(sp, k_platform, len); in target_create_elf_tables() 105 sp -= 16 - (size & 15); in target_create_elf_tables() [all …]
|
/qemu/hw/smbios/ |
H A D | smbios_build.h | 4 * Copyright (C) 2009 Hewlett-Packard Development Company, L.P. 13 * the COPYING file in the top-level directory. 15 * Contributions after 2012-01-13 are licensed under the terms of the 51 t->header.type = tbl_type; \ 52 t->header.length = tbl_len; \ 53 t->header.handle = cpu_to_le16(tbl_handle); \ 58 int len = (value != NULL) ? strlen(value) + 1 : 0; \ 59 if (len > 1) { \ 61 smbios_tables_len + len); \ 62 memcpy(smbios_tables + smbios_tables_len, value, len); \ [all …]
|
/qemu/hw/tpm/ |
H A D | tpm_spapr.c | 12 * COPYING file in the top-level directory. 17 #include "qemu/error-report.h" 19 #include "hw/qdev-properties.h" 39 /* 0x81-0x83: CRQ message response */ 41 uint16_t len; /* len of TPM request; len of TPM response */ member 96 tpm_util_show_buffer(s->buffer, s->be_buffer_size, "To TPM"); in tpm_spapr_tpm_send() 98 s->state = SPAPR_VTPM_STATE_EXECUTION; in tpm_spapr_tpm_send() 99 s->cmd = (TPMBackendCmd) { in tpm_spapr_tpm_send() 101 .in = s->buffer, in tpm_spapr_tpm_send() 102 .in_len = MIN(tpm_cmd_get_size(s->buffer), s->be_buffer_size), in tpm_spapr_tpm_send() [all …]
|
/qemu/hw/acpi/ |
H A D | ghes.c | 25 #include "hw/acpi/aml-build.h" 26 #include "qemu/error-report.h" 34 /* The max size in bytes for one error block */ 46 * Table 18-343 Generic Error Data Entry 59 * Table 18-380 Generic Error Status Block 190 * Table 17-13 Generic Error Data Entry in ghes_gen_err_data_uncorrectable_recoverable() 224 * (GHESv2 - Type 10) in build_ghes_error_table() 230 error_status_block_offset = hardware_errors->len; in build_ghes_error_table() 273 * Generic Hardware Error Source version 2(GHESv2 - Type 10) in build_ghes_v2() 285 /* Number of Records To Pre-allocate */ in build_ghes_v2() [all …]
|
/qemu/subprojects/libvduse/ |
H A D | libvduse.c | 5 * Portions of codes and concepts borrowed from libvhost-user.c, so: 12 * Marc-André Lureau <mlureau@redhat.com> 16 * later. See the COPYING file in the top-level directory. 41 #include "linux-headers/linux/virtio_ring.h" 42 #include "linux-headers/linux/virtio_config.h" 43 #include "linux-headers/linux/vduse.h" 55 #define ALIGN_UP(n, m) ALIGN_DOWN((n) + (m) - 1, (m)) 150 if (fd == -1) { in vduse_log_get() 154 if (ftruncate(fd, size) == -1) { in vduse_log_get() 173 return has_feature(dev->features, fbit); in vduse_dev_has_feature() [all …]
|
/qemu/subprojects/libvhost-user/ |
H A D | libvhost-user.c | 9 * Marc-André Lureau <mlureau@redhat.com> 13 * later. See the COPYING file in the top-level directory. 39 #include "standard-headers/linux/virtio_config.h" 57 #include "libvhost-user.h" 83 #define ALIGN_UP(n, m) ALIGN_DOWN((n) + (m) - 1, (m)) 117 return has_feature(dev->features, fbit); in vu_has_feature() 122 return has_feature(dev->protocol_features, fbit); in vu_has_protocol_feature() 190 dev->broken = true; in vu_panic() 191 dev->panic(dev, buf); in vu_panic() 205 int high = dev->nregions - 1; in vu_gpa_to_mem_region() [all …]
|