Skip to content
Snippets Groups Projects
  1. Feb 15, 2018
    • Ross Lagerwall's avatar
      io: Add /dev/fdset/ support to QIOChannelFile · b8f244b1
      Ross Lagerwall authored
      
      Add /dev/fdset/ support to QIOChannelFile by calling qemu_open() instead
      of open() and qemu_close() instead of close(). There is a subtle
      semantic change since qemu_open() automatically sets O_CLOEXEC, but this
      doesn't affect any of the users of the function.
      
      Signed-off-by: default avatarRoss Lagerwall <ross.lagerwall@citrix.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      b8f244b1
    • Ross Lagerwall's avatar
      io: Don't call close multiple times in QIOChannelFile · a2565df1
      Ross Lagerwall authored
      
      If the file descriptor underlying QIOChannelFile is closed in the
      io_close() method, don't close it again in the finalize() method since
      the file descriptor number may have been reused in the meantime.
      
      Signed-off-by: default avatarRoss Lagerwall <ross.lagerwall@citrix.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      a2565df1
    • Ross Lagerwall's avatar
      io: Fix QIOChannelFile when creating and opening read-write · 902f6e14
      Ross Lagerwall authored
      
      The code wrongly passes the mode to open() only if O_WRONLY is set.
      Instead, the mode should be passed when O_CREAT is set (or O_TMPFILE on
      Linux). Fix this by always passing the mode since open() will correctly
      ignore the mode if it is not needed. Add a testcase which exercises this
      bug and also change the existing testcase to check that the mode of the
      created file is correct.
      
      Signed-off-by: default avatarRoss Lagerwall <ross.lagerwall@citrix.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      902f6e14
    • Edgar Kaziakhmedov's avatar
      io/channel-websock: handle continuous reads without any data · a46ded1d
      Edgar Kaziakhmedov authored
      
      According to the current implementation of websocket protocol in QEMU,
      qio_channel_websock_handshake_io tries to read handshake from the
      channel to start communication over socket. But this approach
      doesn't cover scenario when socket was closed while handshaking.
      Therefore, if G_IO_IN is caught and qio_channel_read returns zero,
      error has to be set and connection has to be done.
      
      Such behaviour causes 100% CPU load in main QEMU loop, because main loop
      poll continues to receive and handle G_IO_IN events from websocket.
      
      Step to reproduce 100% CPU load:
      1) start qemu with the simplest configuration
      $ qemu -vnc [::1]:1,websocket=7500
      2) open any vnc listener (which doesn't follow websocket
      protocol)
      $ vncviewer :7500
      3) kill listener
      4) qemu main thread eats 100% CPU
      
      Signed-off-by: default avatarEdgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      a46ded1d
    • Paolo Bonzini's avatar
      io: fix QIONetListener memory leak · 28bb0a59
      Paolo Bonzini authored
      
      The sources array does not escape out of qio_net_listener_wait_client, so
      we have to free it.
      
      Reported by Coverity.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      28bb0a59
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/huth/tags/pull-request-2018-02-14' into staging · 8c5e7bdd
      Peter Maydell authored
      
      Various improvements to the qtest checks:
      - Clean-ups by Eric Blake with regards to the global_qtest variable
      - Some more test cases for the boot-serial tester
      - Re-activation of the m48t59-test
      
      # gpg: Signature made Wed 14 Feb 2018 11:07:44 GMT
      # gpg:                using RSA key 2ED9D774FE702DB5
      # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>"
      # gpg:                 aka "Thomas Huth <thuth@redhat.com>"
      # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>"
      # gpg:                 aka "Thomas Huth <th.huth@posteo.de>"
      # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
      
      * remotes/huth/tags/pull-request-2018-02-14:
        tests/m48t59: Use the m48t59 test on ppc, too
        tests/Makefile: Derive check-qtest-ppc64-y from check-qtest-ppc-y
        tests/m48t59: Make the test independent of global_qtest
        tests/m48t59: Fix and re-enable the test for sparc
        tests/boot-serial-test: Add support for the aarch64 virt machine
        tests/boot-serial: Add tests for PowerPC Mac machines
        tests/boot-serial: Enable the boot-serial test on SPARC machines, too
        wdt_ib700-test: Drop dependence on global_qtest
        tests/boot-sector: Drop dependence on global_qtest
        qmp-test: Drop dependence on global_qtest
        libqos: Use explicit QTestState for remaining libqos operations
        libqos: Use explicit QTestState for ahci operations
        libqos: Use explicit QTestState for i2c operations
        libqos: Use explicit QTestState for rtas operations
        libqos: Use explicit QTestState for fw_cfg operations
        libqos: Track QTestState with QPCIBus
        libqtest: Use qemu_strtoul()
        tests: Clean up wait for event
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8c5e7bdd
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/vivier/tags/m68k-for-2.12-pull-request' into staging · 9f9c5336
      Peter Maydell authored
      
      # gpg: Signature made Wed 14 Feb 2018 10:37:02 GMT
      # gpg:                using RSA key F30C38BD3F2FBE3C
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/vivier/tags/m68k-for-2.12-pull-request:
        m68k: implement movep instruction
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      9f9c5336
  2. Feb 14, 2018
  3. Feb 13, 2018
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 685a4eaf
      Peter Maydell authored
      
      Block layer patches
      
      # gpg: Signature made Tue 13 Feb 2018 17:03:11 GMT
      # gpg:                using RSA key 7F09B272C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
      # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
      
      * remotes/kevin/tags/for-upstream: (55 commits)
        iotests: Add l2-cache-entry-size to iotest 137
        iotests: Test downgrading an image using a small L2 slice size
        iotests: Test valid values of l2-cache-entry-size
        qcow2: Allow configuring the L2 slice size
        qcow2: Rename l2_table in count_cow_clusters()
        qcow2: Rename l2_table in count_contiguous_clusters_unallocated()
        qcow2: Rename l2_table in count_contiguous_clusters()
        qcow2: Rename l2_table in qcow2_alloc_compressed_cluster_offset()
        qcow2: Update qcow2_truncate() to support L2 slices
        qcow2: Update expand_zero_clusters_in_l1() to support L2 slices
        qcow2: Prepare expand_zero_clusters_in_l1() for adding L2 slice support
        qcow2: Read refcount before L2 table in expand_zero_clusters_in_l1()
        qcow2: Update qcow2_update_snapshot_refcount() to support L2 slices
        qcow2: Prepare qcow2_update_snapshot_refcount() for adding L2 slice support
        qcow2: Update zero_single_l2() to support L2 slices
        qcow2: Update discard_single_l2() to support L2 slices
        qcow2: Update handle_alloc() to support L2 slices
        qcow2: Update handle_copied() to support L2 slices
        qcow2: Update qcow2_alloc_cluster_link_l2() to support L2 slices
        qcow2: Update qcow2_get_cluster_offset() to support L2 slices
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      685a4eaf
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · bec9c64e
      Peter Maydell authored
      
      * CAN bus (will be under network maintainner)
      * scsi-block opblockers (myself)
      * Dirty log bitmap cleanup (myself)
      * SDHCI improvements and tests (Philippe)
      * HAX support for larger guest sizese (Yu Ning)
      
      # gpg: Signature made Tue 13 Feb 2018 15:37:14 GMT
      # gpg:                using RSA key BFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream: (48 commits)
        travis: use libgcc-4.8-dev (libgcc-6-dev is not available on Ubuntu 14.04)
        memory: unify loops to sync dirty log bitmap
        memory: hide memory_region_sync_dirty_bitmap behind DirtyBitmapSnapshot
        memory: remove memory_region_test_and_clear_dirty
        g364fb: switch to using DirtyBitmapSnapshot
        sdhci: add Spec v4.2 register definitions
        sdhci: add a check_capab_v3() qtest
        sdhci: check Spec v3 capabilities qtest
        hw/arm/xilinx_zynqmp: enable the UHS-I mode
        hw/arm/xilinx_zynqmp: fix the capabilities/spec version to match the datasheet
        hw/arm/fsl-imx6: implement SDHCI Spec. v3
        hw/arm/bcm2835_peripherals: change maximum block size to 1kB
        hw/arm/bcm2835_peripherals: implement SDHCI Spec v3
        sdhci: implement CMD/DAT[] fields in the Present State register
        sdhci: implement UHS-I voltage switch
        sdbus: add trace events
        sdhci: implement the Host Control 2 register (tuning sequence)
        sdhci: rename the hostctl1 register
        sdhci: add support for v3 capabilities
        hw/arm/xilinx_zynq: fix the capabilities register to match the datasheet
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      bec9c64e
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · b734ed9d
      Peter Maydell authored
      
      virtio,vhost,pci,pc: features, fixes and cleanups
      
      - new stats in virtio balloon
      - virtio eventfd rework for boot speedup
      - vhost memory rework for boot speedup
      - fixes and cleanups all over the place
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Tue 13 Feb 2018 16:29:55 GMT
      # gpg:                using RSA key 281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
      #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
      
      * remotes/mst/tags/for_upstream: (22 commits)
        virtio-balloon: include statistics of disk/file caches
        acpi-test: update FADT
        lpc: drop pcie host dependency
        tests: acpi: fix FADT not being compared to reference table
        hw/pci-bridge: fix pcie root port's IO hints capability
        libvhost-user: Support across-memory-boundary access
        libvhost-user: Fix resource leak
        virtio-balloon: unref the memory region before continuing
        pci: removed the is_express field since a uniform interface was inserted
        virtio-blk: enable multiple vectors when using multiple I/O queues
        pci/bus: let it has higher migration priority
        pci-bridge/i82801b11: clear bridge registers on platform reset
        vhost: Move log_dirty check
        vhost: Merge and delete unused callbacks
        vhost: Clean out old vhost_set_memory and friends
        vhost: Regenerate region list from changed sections list
        vhost: Merge sections added to temporary list
        vhost: Simplify ring verification checks
        vhost: Build temporary section list and deref after commit
        virtio: improve virtio devices initialization time
        ...
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      b734ed9d
    • Tomáš Golembiovský's avatar
    • Michael S. Tsirkin's avatar
      acpi-test: update FADT · e89e7ea6
      Michael S. Tsirkin authored
      
      Previous commit ("tests: acpi: fix FADT not being compared to reference table")
      started tracking changes to the FADT. Generate the expected FACP files -
      apparently these weren't updated since 2013.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      e89e7ea6
    • Michael S. Tsirkin's avatar
      lpc: drop pcie host dependency · 562a1407
      Michael S. Tsirkin authored
      
      Doesn't look like that header is used.
      
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      562a1407
    • Igor Mammedov's avatar
      tests: acpi: fix FADT not being compared to reference table · 92146b7a
      Igor Mammedov authored
      
      It turns out that FADT isn't actually tested for changes
      against reference table, since it happens to be the 1st
      table in RSDT which is currently ignored.
      Fix it by making sure that all tables from RSDT are added
      to test list.
      
      NOTE: FADT contains guest allocated pointers to FACS/DSDT,
      zero them out so that possible FACS/DSDT address change
      won't affect test results.
      
      Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      92146b7a
    • Marcel Apfelbaum's avatar
      hw/pci-bridge: fix pcie root port's IO hints capability · fc67208f
      Marcel Apfelbaum authored
      
      The gen_pcie_root_port mem-reserve and pref32-reserve properties are
      defined as size (so uint64_t), but passed as uint32_t when building
      the 'IO hints' vendor specific capability.
      Passing 4G (or more) gets truncated and passed as a zero reservation.
      Is not a huge issue since the guest firmware will always compare the
      hints with the default value and take the maximum.
      
      Fix it by passing the values as uint64_t and failing to init the
      gen_pcie_root_port id invalid values are used.
      
      Signed-off-by: default avatarMarcel Apfelbaum <marcel@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      fc67208f
    • Yongji Xie's avatar
      libvhost-user: Support across-memory-boundary access · 293084a7
      Yongji Xie authored
      
      The sg list/indirect descriptor table may be contigious
      in GPA but not in HVA address space. But libvhost-user
      wasn't aware of that. This would cause out-of-bounds
      access. Even a malicious guest could use it to get
      information from the vhost-user backend.
      
      Introduce a plen parameter in vu_gpa_to_va() so we can
      handle this case, returning the actual mapped length.
      
      Signed-off-by: default avatarYongji Xie <xieyongji@baidu.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarMaxime Coquelin <maxime.coquelin@redhat.com>
      293084a7
    • Yongji Xie's avatar
      libvhost-user: Fix resource leak · bb102d1d
      Yongji Xie authored
      
      Free the mmaped memory when we need to mmap new memory
      space on vu_set_mem_table_exec() and vu_set_log_base_exec() to
      avoid memory leak.
      
      Also close the corresponding fd after mmap() on
      vu_set_log_base_exec() to avoid fd leak.
      
      Signed-off-by: default avatarYongji Xie <xieyongji@baidu.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      bb102d1d
    • Tiwei Bie's avatar
      virtio-balloon: unref the memory region before continuing · b86107ab
      Tiwei Bie authored
      
      Signed-off-by: default avatarTiwei Bie <tiwei.bie@intel.com>
      Cc: qemu-stable@nongnu.org
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      b86107ab
    • Kevin Wolf's avatar
      Merge remote-tracking branch 'mreitz/tags/pull-block-2018-02-13' into queue-block · 0a4dc980
      Kevin Wolf authored
      
      Block patches for the block queue
      
      # gpg: Signature made Tue Feb 13 17:00:13 2018 CET
      # gpg:                using RSA key F407DB0061D5CF40
      # gpg: Good signature from "Max Reitz <mreitz@redhat.com>"
      # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
      
      * mreitz/tags/pull-block-2018-02-13: (40 commits)
        iotests: Add l2-cache-entry-size to iotest 137
        iotests: Test downgrading an image using a small L2 slice size
        iotests: Test valid values of l2-cache-entry-size
        qcow2: Allow configuring the L2 slice size
        qcow2: Rename l2_table in count_cow_clusters()
        qcow2: Rename l2_table in count_contiguous_clusters_unallocated()
        qcow2: Rename l2_table in count_contiguous_clusters()
        qcow2: Rename l2_table in qcow2_alloc_compressed_cluster_offset()
        qcow2: Update qcow2_truncate() to support L2 slices
        qcow2: Update expand_zero_clusters_in_l1() to support L2 slices
        qcow2: Prepare expand_zero_clusters_in_l1() for adding L2 slice support
        qcow2: Read refcount before L2 table in expand_zero_clusters_in_l1()
        qcow2: Update qcow2_update_snapshot_refcount() to support L2 slices
        qcow2: Prepare qcow2_update_snapshot_refcount() for adding L2 slice support
        qcow2: Update zero_single_l2() to support L2 slices
        qcow2: Update discard_single_l2() to support L2 slices
        qcow2: Update handle_alloc() to support L2 slices
        qcow2: Update handle_copied() to support L2 slices
        qcow2: Update qcow2_alloc_cluster_link_l2() to support L2 slices
        qcow2: Update qcow2_get_cluster_offset() to support L2 slices
        ...
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      0a4dc980
    • Alberto Garcia's avatar
      iotests: Add l2-cache-entry-size to iotest 137 · 03b1b6f0
      Alberto Garcia authored
      
      This test tries reopening a qcow2 image with valid and invalid
      options. This patch adds l2-cache-entry-size to the set.
      
      Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 3d3b7d2dbfc020deaef60fb58739b0801eb9517c.1517840877.git.berto@igalia.com
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      03b1b6f0
    • Alberto Garcia's avatar
      iotests: Test downgrading an image using a small L2 slice size · 2ecec911
      Alberto Garcia authored
      
      expand_zero_clusters_in_l1() is used when downgrading qcow2 images
      from v3 to v2 (compat=0.10). This is one of the functions that needed
      more changes to support L2 slices, so this patch extends iotest 061 to
      test downgrading a qcow2 image using a smaller slice size.
      
      Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
      Message-id: 3e5662dce5e4926c8fabbad4c0b9142b2a506dd4.1517840877.git.berto@igalia.com
      Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
      2ecec911
Loading