qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging

trivial patches for 2017-01-24

# gpg: Signature made Tue 24 Jan 2017 20:27:08 GMT
# gpg: using RSA key 0x701B4F6B1A693E59
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg: aka "Michael Tokarev <mjt@corpit.ru>"
# gpg: aka "Michael Tokarev <mjt@debian.org>"
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5
# Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59

* remotes/mjt/tags/trivial-patches-fetch: (31 commits)
hw/isa/isa-bus: Set category of the "isabus-bridge" device
usb: Set category and description of the MTP device
gdbstub.c: update old error report statements
gdbstub.c: fix GDB connection segfault caused by empty machines
scsi-disk: add 'fall through' comment to switch VERIFY cases
Drop duplicate display option documentation
hw/display/framebuffer.c: Avoid overflow for framebuffers > 4GB
win32: use glib gpoll if glib >= 2.50
util/mmap-alloc: refactor a little bit for readability
util/mmap-alloc: check parameter before using
vfio: remove a duplicated word in comments
docs: sync pci-ids.txt
disas/cris.c: Fix Coverity warning about unchecked NULL
lm32: milkymist-tmu2: fix another integer overflow
hw/i386/kvmvapic: Remove dead code in patch_hypercalls()
doc/usb2: fix typo
qga: fix erroneous argument to strerror
block: remove dead check
pci-assign: avoid pointless stat
qemu-img: remove dead check
...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

+88 -104
+1
README
··· 45 45 Additional information can also be found online via the QEMU website: 46 46 47 47 http://qemu-project.org/Hosts/Linux 48 + http://qemu-project.org/Hosts/Mac 48 49 http://qemu-project.org/Hosts/W32 49 50 50 51
+1 -1
block.c
··· 1851 1851 bdrv_refresh_filename(bs); 1852 1852 1853 1853 /* Check if any unknown options were used */ 1854 - if (options && (qdict_size(options) != 0)) { 1854 + if (qdict_size(options) != 0) { 1855 1855 const QDictEntry *entry = qdict_first(options); 1856 1856 if (flags & BDRV_O_PROTOCOL) { 1857 1857 error_setg(errp, "Block protocol '%s' doesn't support the option "
+1 -1
disas/cris.c
··· 2490 2490 const struct cris_spec_reg *sregp 2491 2491 = spec_reg_info ((insn >> 12) & 15, disdata->distype); 2492 2492 2493 - if (sregp->name == NULL) 2493 + if (sregp == NULL || sregp->name == NULL) 2494 2494 /* Should have been caught as a non-match earlier. */ 2495 2495 *tp++ = '?'; 2496 2496 else
+3
docs/specs/pci-ids.txt
··· 57 57 1b36:0005 PCI test device (docs/specs/pci-testdev.txt) 58 58 1b36:0006 PCI Rocker Ethernet switch device 59 59 1b36:0007 PCI SD Card Host Controller Interface (SDHCI) 60 + 1b36:0008 PCIe host bridge 61 + 1b36:0009 PCI Expander Bridge (-device pxb) 60 62 1b36:000a PCI-PCI bridge (multiseat) 63 + 1b36:000b PCIe Expander Bridge (-device pxb-pcie) 61 64 62 65 All these devices are documented in docs/specs. 63 66
+1 -1
docs/usb-storage.txt
··· 34 34 Number three emulates the classic bulk-only transport protocol too. 35 35 It's called "usb-bot". It shares most code with "usb-storage", and 36 36 the guest will not be able to see the difference. The qemu command 37 - line interface is simliar to usb-uas though, i.e. no automatic scsi 37 + line interface is similar to usb-uas though, i.e. no automatic scsi 38 38 disk creation. It also features support for up to 16 LUNs. The LUN 39 39 numbers must be continuous, i.e. for three devices you must use 0+1+2. 40 40 The 0+1+5 numbering from the "usb-uas" example isn't going to work
+1 -1
docs/usb2.txt
··· 19 19 '-device usb-ehci,id=ehci". This will give you a USB 2.0 bus named 20 20 "ehci.0". 21 21 22 - I strongly recomment to also use -device to attach usb devices because 22 + I strongly recommend to also use -device to attach usb devices because 23 23 you can specify the bus they should be attached to this way. Here is 24 24 a complete example: 25 25
+12 -5
gdbstub.c
··· 18 18 */ 19 19 #include "qemu/osdep.h" 20 20 #include "qapi/error.h" 21 + #include "qemu/error-report.h" 21 22 #include "qemu/cutils.h" 22 23 #include "cpu.h" 23 24 #ifdef CONFIG_USER_ONLY ··· 637 638 *p = s; 638 639 if (g_pos) { 639 640 if (g_pos != s->base_reg) { 640 - fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n" 641 - "Expected %d got %d\n", xml, g_pos, s->base_reg); 641 + error_report("Error: Bad gdb register numbering for '%s', " 642 + "expected %d got %d", xml, g_pos, s->base_reg); 642 643 } else { 643 644 cpu->gdb_num_g_regs = cpu->gdb_num_regs; 644 645 } ··· 890 891 } 891 892 case 'k': 892 893 /* Kill the target */ 893 - fprintf(stderr, "\nQEMU: Terminated via GDBstub\n"); 894 + error_report("QEMU: Terminated via GDBstub"); 894 895 exit(0); 895 896 case 'D': 896 897 /* Detach packet */ ··· 1358 1359 break; 1359 1360 default: 1360 1361 bad_format: 1361 - fprintf(stderr, "gdbstub: Bad syscall format string '%s'\n", 1362 - fmt - 1); 1362 + error_report("gdbstub: Bad syscall format string '%s'", 1363 + fmt - 1); 1363 1364 break; 1364 1365 } 1365 1366 } else { ··· 1731 1732 CharDriverState *chr = NULL; 1732 1733 CharDriverState *mon_chr; 1733 1734 ChardevCommon common = { 0 }; 1735 + 1736 + if (!first_cpu) { 1737 + error_report("gdbstub: meaningless to attach gdb to a " 1738 + "machine without any CPU."); 1739 + return -1; 1740 + } 1734 1741 1735 1742 if (!device) 1736 1743 return -1;
+2 -2
hw/block/m25p80.c
··· 147 147 #define CFG_DUMMY_CLK_LEN 4 148 148 #define NVCFG_DUMMY_CLK_POS 12 149 149 #define VCFG_DUMMY_CLK_POS 4 150 - #define EVCFG_OUT_DRIVER_STRENGHT_DEF 7 150 + #define EVCFG_OUT_DRIVER_STRENGTH_DEF 7 151 151 #define EVCFG_VPP_ACCELERATOR (1 << 3) 152 152 #define EVCFG_RESET_HOLD_ENABLED (1 << 4) 153 153 #define NVCFG_DUAL_IO_MASK (1 << 2) ··· 747 747 ); 748 748 749 749 s->enh_volatile_cfg = 0; 750 - s->enh_volatile_cfg |= EVCFG_OUT_DRIVER_STRENGHT_DEF; 750 + s->enh_volatile_cfg |= EVCFG_OUT_DRIVER_STRENGTH_DEF; 751 751 s->enh_volatile_cfg |= EVCFG_VPP_ACCELERATOR; 752 752 s->enh_volatile_cfg |= EVCFG_RESET_HOLD_ENABLED; 753 753 if (s->nonvolatile_cfg & NVCFG_DUAL_IO_MASK) {
+2 -2
hw/core/generic-loader.c
··· 27 27 * this it needs a backend to manage the datas, the same as other 28 28 * memory-related devices. In this case as the backend is so trivial we 29 29 * have merged it with the frontend instead of creating and maintaining a 30 - * seperate backend. 30 + * separate backend. 31 31 */ 32 32 33 33 #include "qemu/osdep.h" ··· 79 79 "loading memory values"); 80 80 return; 81 81 } else if (!s->data_len) { 82 - /* We cant' check for !data here as a value of 0 is still valid. */ 82 + /* We can't check for !data here as a value of 0 is still valid. */ 83 83 error_setg(errp, "Both data and data-len must be specified"); 84 84 return; 85 85 } else if (s->data_len > 8) {
+1 -1
hw/core/qdev-properties.c
··· 711 711 712 712 /* 713 713 * Catch "invalid" device reference from vfio-pci and allow the 714 - * default buffer representing the non-existant device to be used. 714 + * default buffer representing the non-existent device to be used. 715 715 */ 716 716 if (~addr->domain || ~addr->bus || ~addr->slot || ~addr->function) { 717 717 rc = snprintf(buffer, sizeof(buffer), "%04x:%02x:%02x.%0d",
+1 -1
hw/display/framebuffer.c
··· 78 78 79 79 i = *first_row; 80 80 *first_row = -1; 81 - src_len = src_width * rows; 81 + src_len = (hwaddr)src_width * rows; 82 82 83 83 mem = mem_section->mr; 84 84 if (!mem) {
+1 -1
hw/display/milkymist-tmu2.c
··· 257 257 glColor4f(m, m, m, (float)(s->regs[R_ALPHA] + 1) / 64.0f); 258 258 259 259 /* Read the QEMU dest. framebuffer into the OpenGL framebuffer */ 260 - fb_len = 2 * s->regs[R_DSTHRES] * s->regs[R_DSTVRES]; 260 + fb_len = 2ULL * s->regs[R_DSTHRES] * s->regs[R_DSTVRES]; 261 261 fb = cpu_physical_memory_map(s->regs[R_DSTFBUF], &fb_len, 0); 262 262 if (fb == NULL) { 263 263 glDeleteTextures(1, &texture);
+2 -2
hw/display/xlnx_dp.c
··· 555 555 if ((width != 0) && (height != 0)) { 556 556 /* 557 557 * As dpy_gfx_replace_surface calls qemu_free_displaysurface on the 558 - * surface we need to be carefull and don't free the surface associated 558 + * surface we need to be careful and don't free the surface associated 559 559 * to the console or double free will happen. 560 560 */ 561 561 if (s->bout_plane.surface != current_console_surface) { ··· 1160 1160 */ 1161 1161 if (!xlnx_dpdma_start_operation(s->dpdma, 3, false)) { 1162 1162 /* 1163 - * An error occured don't do anything with the data.. 1163 + * An error occurred don't do anything with the data.. 1164 1164 * Trigger an underflow interrupt. 1165 1165 */ 1166 1166 s->core_registers[DP_INT_STATUS] |= (1 << 21);
-6
hw/i386/kvmvapic.c
··· 535 535 uint8_t alternates[2]; 536 536 const uint8_t *pattern; 537 537 const uint8_t *patch; 538 - int patches = 0; 539 538 off_t pos; 540 539 uint8_t *rom; 541 540 ··· 566 565 } 567 566 568 567 g_free(rom); 569 - 570 - if (patches != 0 && patches != 2) { 571 - return -1; 572 - } 573 - 574 568 return 0; 575 569 } 576 570
+1 -1
hw/i386/pc.c
··· 1777 1777 1778 1778 /* returns pointer to CPUArchId descriptor that matches CPU's apic_id 1779 1779 * in pcms->possible_cpus->cpus, if pcms->possible_cpus->cpus has no 1780 - * entry correponding to CPU's apic_id returns NULL. 1780 + * entry corresponding to CPU's apic_id returns NULL. 1781 1781 */ 1782 1782 static CPUArchId *pc_find_cpu_slot(PCMachineState *pcms, CPUState *cpu, 1783 1783 int *idx)
+8 -8
hw/i386/pci-assign-load-rom.c
··· 39 39 "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/rom", 40 40 domain, bus, slot, function); 41 41 42 - if (stat(rom_file, &st)) { 43 - if (errno != ENOENT) { 44 - error_report("pci-assign: Invalid ROM."); 45 - } 46 - return NULL; 47 - } 48 - 49 42 /* Write "1" to the ROM file to enable it */ 50 43 fp = fopen(rom_file, "r+"); 51 44 if (fp == NULL) { 52 - error_report("pci-assign: Cannot open %s: %s", rom_file, strerror(errno)); 45 + if (errno != ENOENT) { 46 + error_report("pci-assign: Cannot open %s: %s", rom_file, strerror(errno)); 47 + } 53 48 return NULL; 54 49 } 50 + if (fstat(fileno(fp), &st) == -1) { 51 + error_report("pci-assign: Cannot stat %s: %s", rom_file, strerror(errno)); 52 + goto close_rom; 53 + } 54 + 55 55 val = 1; 56 56 if (fwrite(&val, 1, 1, fp) != 1) { 57 57 goto close_rom;
+1
hw/isa/isa-bus.c
··· 219 219 { 220 220 DeviceClass *dc = DEVICE_CLASS(klass); 221 221 222 + set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); 222 223 dc->fw_name = "isa"; 223 224 } 224 225
+1 -1
hw/net/cadence_gem.c
··· 896 896 897 897 DB_PRINT("config bufsize: %d packet size: %ld\n", rxbufsize, size); 898 898 899 - /* Find which queue we are targetting */ 899 + /* Find which queue we are targeting */ 900 900 q = get_queue_from_screen(s, rxbuf_ptr, rxbufsize); 901 901 902 902 while (bytes_to_copy) {
+2 -2
hw/net/spapr_llan.c
··· 105 105 uint32_t add_buf_ptr, use_buf_ptr, rx_bufs; 106 106 hwaddr rxq_ptr; 107 107 QEMUTimer *rxp_timer; 108 - uint32_t compat_flags; /* Compatability flags for migration */ 108 + uint32_t compat_flags; /* Compatibility flags for migration */ 109 109 RxBufPool *rx_pool[RX_MAX_POOLS]; /* Receive buffer descriptor pools */ 110 110 } VIOsPAPRVLANDevice; 111 111 ··· 559 559 if (pool < 0) { 560 560 /* 561 561 * No matching pool found? Try to use a new one. If the guest used all 562 - * pools before, but changed the size of one pool inbetween, we might 562 + * pools before, but changed the size of one pool in the meantime, we might 563 563 * need to recycle that pool here (if it's empty already). Thus scan 564 564 * all buffer pools now, starting with the last (likely empty) one. 565 565 */
+1 -1
hw/pci/pcie.c
··· 656 656 } 657 657 658 658 /* 659 - * caller must supply valid (offset, size) * such that the range shouldn't 659 + * Caller must supply valid (offset, size) such that the range wouldn't 660 660 * overlap with other capability or other registers. 661 661 * This function doesn't check it. 662 662 */
+1 -1
hw/ppc/spapr_drc.c
··· 59 59 trace_spapr_drc_set_isolation_state(get_index(drc), state); 60 60 61 61 if (state == SPAPR_DR_ISOLATION_STATE_UNISOLATED) { 62 - /* cannot unisolate a non-existant resource, and, or resources 62 + /* cannot unisolate a non-existent resource, and, or resources 63 63 * which are in an 'UNUSABLE' allocation state. (PAPR 2.7, 13.5.3.5) 64 64 */ 65 65 if (!drc->dev ||
+2 -2
hw/s390x/s390-pci-bus.h
··· 183 183 * may enter an error state 184 184 * blocked: ignore all DMA and interrupts; transition back to enabled or from 185 185 * error state via mpcifc 186 - * error: an error occured; transition back to enabled via mpcifc 187 - * permanent error: an unrecoverable error occured; transition to standby via 186 + * error: an error occurred; transition back to enabled via mpcifc 187 + * permanent error: an unrecoverable error occurred; transition to standby via 188 188 * sclp deconfigure 189 189 */ 190 190 typedef enum {
+1
hw/scsi/scsi-disk.c
··· 2157 2157 DPRINTF("Write %s(sector %" PRId64 ", count %u)\n", 2158 2158 (command & 0xe) == 0xe ? "And Verify " : "", 2159 2159 r->req.cmd.lba, len); 2160 + /* fall through */ 2160 2161 case VERIFY_10: 2161 2162 case VERIFY_12: 2162 2163 case VERIFY_16:
+3 -1
hw/usb/dev-mtp.c
··· 1093 1093 } 1094 1094 break; 1095 1095 case PROP_PERSISTENT_UNIQUE_OBJECT_IDENTIFIER: 1096 - /* Should be persistant between sessions, 1096 + /* Should be persistent between sessions, 1097 1097 * but using our objedt ID is "good enough" 1098 1098 * for now */ 1099 1099 usb_mtp_add_u64(d, 0x0000000000000000); ··· 1580 1580 uc->handle_reset = usb_mtp_handle_reset; 1581 1581 uc->handle_control = usb_mtp_handle_control; 1582 1582 uc->handle_data = usb_mtp_handle_data; 1583 + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); 1584 + dc->desc = "USB Media Transfer Protocol device"; 1583 1585 dc->fw_name = "mtp"; 1584 1586 dc->vmsd = &vmstate_usb_mtp; 1585 1587 dc->props = mtp_properties;
+1 -1
hw/vfio/pci-quirks.c
··· 1171 1171 * IGD LPC/ISA bridge support code. The vBIOS needs this, but we can't write 1172 1172 * arbitrary values into just any bridge, so we must create our own. We try 1173 1173 * to handle if the user has created it for us, which they might want to do 1174 - * to enable multifuction so we don't occupy the whole PCI slot. 1174 + * to enable multifunction so we don't occupy the whole PCI slot. 1175 1175 */ 1176 1176 static void vfio_pci_igd_lpc_bridge_realize(PCIDevice *pdev, Error **errp) 1177 1177 {
+2 -2
hw/vfio/pci.c
··· 1881 1881 * 0 is reserved for this since absence of capabilities is indicated by 1882 1882 * 0 for the ID, version, AND next pointer. However, pcie_add_capability() 1883 1883 * uses ID 0 as reserved for list management and will incorrectly match and 1884 - * assert if we attempt to pre-load the head of the chain with with this 1885 - * ID. Use ID 0xFFFF temporarily since it is also seems to be reserved in 1884 + * assert if we attempt to pre-load the head of the chain with this ID. 1885 + * Use ID 0xFFFF temporarily since it is also seems to be reserved in 1886 1886 * part for identifying absence of capabilities in a root complex register 1887 1887 * block. If the ID still exists after adding capabilities, switch back to 1888 1888 * zero. We'll mark this entire first dword as emulated for this purpose.
+1 -1
hw/virtio/virtio-crypto.c
··· 786 786 vcrypto->max_queues = MAX(vcrypto->cryptodev->conf.peers.queues, 1); 787 787 if (vcrypto->max_queues + 1 > VIRTIO_QUEUE_MAX) { 788 788 error_setg(errp, "Invalid number of queues (= %" PRIu32 "), " 789 - "must be a postive integer less than %d.", 789 + "must be a positive integer less than %d.", 790 790 vcrypto->max_queues, VIRTIO_QUEUE_MAX); 791 791 return; 792 792 }
+1 -1
include/glib-compat.h
··· 39 39 #define g_get_monotonic_time() qemu_g_get_monotonic_time() 40 40 #endif 41 41 42 - #ifdef _WIN32 42 + #if defined(_WIN32) && !GLIB_CHECK_VERSION(2, 50, 0) 43 43 /* 44 44 * g_poll has a problem on Windows when using 45 45 * timeouts < 10ms, so use wrapper.
+2 -1
include/hw/dma/xlnx_dpdma.h
··· 53 53 * data to the buffer specified by 54 54 * dpdma_set_host_data_location(). 55 55 * 56 - * Returns The number of bytes transfered by the DPDMA or 0 if an error occured. 56 + * Returns The number of bytes transferred by the DPDMA 57 + * or 0 if an error occurred. 57 58 * 58 59 * @s The DPDMA state. 59 60 * @channel The channel to start.
+1 -1
include/hw/pci-host/q35.h
··· 180 180 uint64_t mch_mcfg_base(void); 181 181 182 182 /* 183 - * Arbitary but unique BNF number for IOAPIC device. 183 + * Arbitrary but unique BNF number for IOAPIC device. 184 184 * 185 185 * TODO: make sure there would have no conflict with real PCI bus 186 186 */
+1 -1
include/hw/register.h
··· 92 92 * This structure is used to group all of the individual registers which are 93 93 * modeled using the RegisterInfo structure. 94 94 * 95 - * @r is an aray containing of all the relevent RegisterInfo structures. 95 + * @r is an array containing of all the relevant RegisterInfo structures. 96 96 * 97 97 * @num_elements is the number of elements in the array r 98 98 *
+1 -1
include/qapi/dealloc-visitor.h
··· 19 19 typedef struct QapiDeallocVisitor QapiDeallocVisitor; 20 20 21 21 /* 22 - * The dealloc visitor is primarly used only by generated 22 + * The dealloc visitor is primarily used only by generated 23 23 * qapi_free_FOO() functions, and is the only visitor designed to work 24 24 * correctly in the face of a partially-constructed QAPI tree. 25 25 */
+1 -1
include/qemu/qht.h
··· 72 72 * In case of successful operation, smp_wmb() is implied before the pointer is 73 73 * inserted into the hash table. 74 74 * 75 - * Returns true on sucess. 75 + * Returns true on success. 76 76 * Returns false if the @p-@hash pair already exists in the hash table. 77 77 */ 78 78 bool qht_insert(struct qht *ht, void *p, uint32_t hash);
+1 -1
include/qemu/xattr.h
··· 14 14 #define QEMU_XATTR_H 15 15 16 16 /* 17 - * Modern distributions (e.g. Fedora 15, have no libattr.so, place attr.h 17 + * Modern distributions (e.g. Fedora 15), have no libattr.so, place attr.h 18 18 * in /usr/include/sys, and don't have ENOATTR. 19 19 */ 20 20
+1 -25
include/qom/object.h
··· 432 432 * @class_base_init: This function is called for all base classes after all 433 433 * parent class initialization has occurred, but before the class itself 434 434 * is initialized. This is the function to use to undo the effects of 435 - * memcpy from the parent class to the descendents. 435 + * memcpy from the parent class to the descendants. 436 436 * @class_finalize: This function is called during class destruction and is 437 437 * meant to release and dynamic parameters allocated by @class_init. 438 438 * @class_data: Data to pass to the @class_init, @class_base_init and ··· 587 587 Object *object_new(const char *typename); 588 588 589 589 /** 590 - * object_new_with_type: 591 - * @type: The type of the object to instantiate. 592 - * 593 - * This function will initialize a new object using heap allocated memory. 594 - * The returned object has a reference count of 1, and will be freed when 595 - * the last reference is dropped. 596 - * 597 - * Returns: The newly allocated and instantiated object. 598 - */ 599 - Object *object_new_with_type(Type type); 600 - 601 - /** 602 590 * object_new_with_props: 603 591 * @typename: The name of the type of the object to instantiate. 604 592 * @parent: the parent object ··· 725 713 int object_set_propv(Object *obj, 726 714 Error **errp, 727 715 va_list vargs); 728 - 729 - /** 730 - * object_initialize_with_type: 731 - * @data: A pointer to the memory to be used for the object. 732 - * @size: The maximum size available at @data for the object. 733 - * @type: The type of the object to instantiate. 734 - * 735 - * This function will initialize an object. The memory for the object should 736 - * have already been allocated. The returned object has a reference count of 1, 737 - * and will be finalized when the last reference is dropped. 738 - */ 739 - void object_initialize_with_type(void *data, size_t size, Type type); 740 716 741 717 /** 742 718 * object_initialize:
+1 -1
qemu-doc.texi
··· 1037 1037 @node disk_images_gluster 1038 1038 @subsection GlusterFS disk images 1039 1039 1040 - GlusterFS is an user space distributed file system. 1040 + GlusterFS is a user space distributed file system. 1041 1041 1042 1042 You can boot from the GlusterFS disk image with the command: 1043 1043 @example
+5 -7
qemu-img.c
··· 3455 3455 3456 3456 create_opts = qemu_opts_append(create_opts, bs->drv->create_opts); 3457 3457 opts = qemu_opts_create(create_opts, NULL, 0, &error_abort); 3458 - if (options) { 3459 - qemu_opts_do_parse(opts, options, NULL, &err); 3460 - if (err) { 3461 - error_report_err(err); 3462 - ret = -1; 3463 - goto out; 3464 - } 3458 + qemu_opts_do_parse(opts, options, NULL, &err); 3459 + if (err) { 3460 + error_report_err(err); 3461 + ret = -1; 3462 + goto out; 3465 3463 } 3466 3464 3467 3465 /* In case the driver does not call amend_status_cb() */
+3 -4
qemu-options.hx
··· 32 32 " selects emulated machine ('-machine help' for list)\n" 33 33 " property accel=accel1[:accel2[:...]] selects accelerator\n" 34 34 " supported accelerators are kvm, xen, tcg (default: tcg)\n" 35 - " kernel_irqchip=on|off controls accelerated irqchip support\n" 36 35 " kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n" 37 36 " vmport=on|off|auto controls emulation of vmport (default: auto)\n" 38 37 " kvm_shadow_mem=size of KVM shadow MMU in bytes\n" ··· 250 249 ETEXI 251 250 252 251 DEF("m", HAS_ARG, QEMU_OPTION_m, 253 - "-m[emory] [size=]megs[,slots=n,maxmem=size]\n" 252 + "-m [size=]megs[,slots=n,maxmem=size]\n" 254 253 " configure guest RAM\n" 255 254 " size: initial amount of guest memory\n" 256 255 " slots: number of hotplug slots (default: none)\n" ··· 927 926 928 927 DEF("display", HAS_ARG, QEMU_OPTION_display, 929 928 "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n" 930 - " [,window_close=on|off][,gl=on|off]|curses|none|\n" 929 + " [,window_close=on|off][,gl=on|off]\n" 931 930 "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n" 932 931 "-display vnc=<display>[,<optargs>]\n" 933 932 "-display curses\n" ··· 2589 2588 See also @url{http://http://www.osrg.net/sheepdog/}. 2590 2589 2591 2590 @item GlusterFS 2592 - GlusterFS is an user space distributed file system. 2591 + GlusterFS is a user space distributed file system. 2593 2592 QEMU supports the use of GlusterFS volumes for hosting VM disk images using 2594 2593 TCP, Unix Domain Sockets and RDMA transport protocols. 2595 2594
+2 -2
qga/main.c
··· 558 558 rsp = qmp_dispatch(QOBJECT(req)); 559 559 if (rsp) { 560 560 ret = send_response(s, rsp); 561 - if (ret) { 562 - g_warning("error sending response: %s", strerror(ret)); 561 + if (ret < 0) { 562 + g_warning("error sending response: %s", strerror(-ret)); 563 563 } 564 564 qobject_decref(rsp); 565 565 }
+2 -2
qom/object.c
··· 357 357 } 358 358 } 359 359 360 - void object_initialize_with_type(void *data, size_t size, TypeImpl *type) 360 + static void object_initialize_with_type(void *data, size_t size, TypeImpl *type) 361 361 { 362 362 Object *obj = data; 363 363 ··· 473 473 } 474 474 } 475 475 476 - Object *object_new_with_type(Type type) 476 + static Object *object_new_with_type(Type type) 477 477 { 478 478 Object *obj; 479 479
+8 -9
util/mmap-alloc.c
··· 12 12 13 13 #include "qemu/osdep.h" 14 14 #include "qemu/mmap-alloc.h" 15 + #include "qemu/host-utils.h" 15 16 16 17 #define HUGETLBFS_MAGIC 0x958458f6 17 18 ··· 61 62 #else 62 63 void *ptr = mmap(0, total, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); 63 64 #endif 64 - size_t offset = QEMU_ALIGN_UP((uintptr_t)ptr, align) - (uintptr_t)ptr; 65 + size_t offset; 65 66 void *ptr1; 66 67 67 68 if (ptr == MAP_FAILED) { 68 69 return MAP_FAILED; 69 70 } 70 71 71 - /* Make sure align is a power of 2 */ 72 - assert(!(align & (align - 1))); 72 + assert(is_power_of_2(align)); 73 73 /* Always align to host page size */ 74 74 assert(align >= getpagesize()); 75 75 76 + offset = QEMU_ALIGN_UP((uintptr_t)ptr, align) - (uintptr_t)ptr; 76 77 ptr1 = mmap(ptr + offset, size, PROT_READ | PROT_WRITE, 77 78 MAP_FIXED | 78 79 (fd == -1 ? MAP_ANONYMOUS : 0) | ··· 83 84 return MAP_FAILED; 84 85 } 85 86 86 - ptr += offset; 87 - total -= offset; 88 - 89 87 if (offset > 0) { 90 - munmap(ptr - offset, offset); 88 + munmap(ptr, offset); 91 89 } 92 90 93 91 /* 94 92 * Leave a single PROT_NONE page allocated after the RAM block, to serve as 95 93 * a guard page guarding against potential buffer overflows. 96 94 */ 95 + total -= offset; 97 96 if (total > size + getpagesize()) { 98 - munmap(ptr + size + getpagesize(), total - size - getpagesize()); 97 + munmap(ptr1 + size + getpagesize(), total - size - getpagesize()); 99 98 } 100 99 101 - return ptr; 100 + return ptr1; 102 101 } 103 102 104 103 void qemu_ram_munmap(void *ptr, size_t size)
+2
util/oslib-win32.c
··· 327 327 return g_strdup(exec_dir); 328 328 } 329 329 330 + #if !GLIB_CHECK_VERSION(2, 50, 0) 330 331 /* 331 332 * The original implementation of g_poll from glib has a problem on Windows 332 333 * when using timeouts < 10 ms. ··· 530 531 531 532 return retval; 532 533 } 534 + #endif 533 535 534 536 int getpagesize(void) 535 537 {
+2 -2
util/uri.c
··· 342 342 * @uri: pointer to an URI structure 343 343 * @str: the string to analyze 344 344 * 345 - * Parse an user informations part and fills in the appropriate fields 345 + * Parse a user information part and fill in the appropriate fields 346 346 * of the @uri structure 347 347 * 348 348 * userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) ··· 508 508 509 509 cur = *str; 510 510 /* 511 - * try to parse an userinfo and check for the trailing @ 511 + * try to parse a userinfo and check for the trailing @ 512 512 */ 513 513 ret = rfc3986_parse_user_info(uri, &cur); 514 514 if ((ret != 0) || (*cur != '@'))