1. 23 9月, 2017 3 次提交
    • P
      scsi: add persistent reservation manager using qemu-pr-helper · 9bad2a6b
      Paolo Bonzini 提交于
      This adds a concrete subclass of pr-manager that talks to qemu-pr-helper.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9bad2a6b
    • P
      scsi: add multipath support to qemu-pr-helper · fe8fc5ae
      Paolo Bonzini 提交于
      Proper support of persistent reservation for multipath devices requires
      communication with the multipath daemon, so that the reservation is
      registered and applied when a path comes up.  The device mapper
      utilities provide a library to do so; this patch makes qemu-pr-helper.c
      detect multipath devices and, when one is found, delegate the operation
      to libmpathpersist.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fe8fc5ae
    • P
      scsi: build qemu-pr-helper · b855f8d1
      Paolo Bonzini 提交于
      Introduce a privileged helper to run persistent reservation commands.
      This lets virtual machines send persistent reservations without using
      CAP_SYS_RAWIO or out-of-tree patches.  The helper uses Unix permissions
      and SCM_RIGHTS to restrict access to processes that can access its socket
      and prove that they have an open file descriptor for a raw SCSI device.
      
      The next patch will also correct the usage of persistent reservations
      with multipath devices.
      
      It would also be possible to support for Linux's IOC_PR_* ioctls in
      the future, to support NVMe devices.  For now, however, only SCSI is
      supported.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b855f8d1
  2. 22 9月, 2017 21 次提交
  3. 21 9月, 2017 6 次提交
    • P
      atomic: update documentation · db81b995
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      db81b995
    • K
      memory: avoid a name clash with access macro · 05e015f7
      KONRAD Frederic 提交于
      This avoids a name clash with the access macro on windows 64:
      
      make
      	CHK version_gen.h
        CC      aarch64-softmmu/memory.o
      /home/konrad/qemu/memory.c: In function 'access_with_adjusted_size':
      /home/konrad/qemu/memory.c:591:73: error: macro "access" passed 7 arguments, \
                               but takes just 2
                               (size - access_size - i) * 8, access_mask, attrs);
                                                                               ^
      Signed-off-by: NKONRAD Frederic <frederic.konrad@adacore.com>
      Message-Id: <1505988260-8483-1-git-send-email-frederic.konrad@adacore.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      05e015f7
    • D
      kvm: drop wrong assertion creating problems with pflash · 3110cdbd
      David Hildenbrand 提交于
      pflash toggles mr->romd_mode. So this assert does not always hold.
      
      1) a device was added with !mr->romd_mode, therefore effectively not
         creating a kvm slot as we want to trap every access (add = false).
      2) mr->romd_mode was toggled on before remove it. There is now
         actually no slot to remove and the assert is wrong.
      
      So let's just drop the assert.
      Reported-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170920145025.19403-1-david@redhat.com>
      Tested-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3110cdbd
    • P
      virtio-serial: add enable_backend callback · 55289fb0
      Pavel Butsykin 提交于
      We should guarantee that RAM will not be modified while VM has a stopped
      state, otherwise it can lead to negative consequences during post-copy
      migration. In RUN_STATE_FINISH_MIGRATE step, it's expected that RAM on
      source side will not be modified as this could lead to non-consistent vm state
      on the destination side. Also RAM access during postcopy-ram migration with
      enabled release-ram capability can lead to sad consequences.
      
      Let's add enable_backend() callback to avoid undesirable virtioqueue changes
      in the guest memory.
      Signed-off-by: NPavel Butsykin <pbutsykin@virtuozzo.com>
      Message-Id: <20170919120733.22020-1-pbutsykin@virtuozzo.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      55289fb0
    • P
      Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging · b62b7ed0
      Peter Maydell 提交于
      These patches fix regressions in 2.10
      
      # gpg: Signature made Wed 20 Sep 2017 07:51:07 BST
      # gpg:                using DSA key 0x02FC3AEB0101DBC2
      # gpg: Good signature from "Greg Kurz <groug@kaod.org>"
      # gpg:                 aka "Greg Kurz <groug@free.fr>"
      # gpg:                 aka "Greg Kurz <gkurz@linux.vnet.ibm.com>"
      # gpg:                 aka "Gregory Kurz (Groug) <groug@free.fr>"
      # gpg:                 aka "[jpeg image of size 3330]"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2
      
      * remotes/gkurz/tags/for-upstream:
        9pfs: check the size of transport buffer before marshaling
        9pfs: fix name_to_path assertion in v9fs_complete_rename()
        9pfs: fix readdir() for 9p2000.u
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b62b7ed0
    • P
      Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging · d3f5433c
      Peter Maydell 提交于
      Machine/CPU/NUMA queue, 2017-09-19
      
      # gpg: Signature made Tue 19 Sep 2017 21:17:01 BST
      # gpg:                using RSA key 0x2807936F984DC5A6
      # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
      # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
      
      * remotes/ehabkost/tags/machine-next-pull-request:
        MAINTAINERS: Update git URLs for my trees
        hw/acpi-build: Fix SRAT memory building in case of node 0 without RAM
        NUMA: Replace MAX_NODES with nb_numa_nodes in for loop
        numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed
        arm: drop intermediate cpu_model -> cpu type parsing and use cpu type directly
        pc: use generic cpu_model parsing
        vl.c: convert cpu_model to cpu type and set of global properties before machine_init()
        cpu: make cpu_generic_init() abort QEMU on error
        qom: cpus: split cpu_generic_init() on feature parsing and cpu creation parts
        hostmem-file: Add "discard-data" option
        osdep: Define QEMU_MADV_REMOVE
        vl: Clean up user-creatable objects when exiting
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      d3f5433c
  4. 20 9月, 2017 10 次提交
    • J
      9pfs: check the size of transport buffer before marshaling · 772a7369
      Jan Dakinevich 提交于
      v9fs_do_readdir_with_stat() should check for a maximum buffer size
      before an attempt to marshal gathered data. Otherwise, buffers assumed
      as misconfigured and the transport would be broken.
      
      The patch brings v9fs_do_readdir_with_stat() in conformity with
      v9fs_do_readdir() behavior.
      Signed-off-by: NJan Dakinevich <jan.dakinevich@gmail.com>
      [groug, regression caused my commit 8d37de41 # 2.10]
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      772a7369
    • J
      9pfs: fix name_to_path assertion in v9fs_complete_rename() · 4d8bc733
      Jan Dakinevich 提交于
      The third parameter of v9fs_co_name_to_path() must not contain `/'
      character.
      
      The issue is most likely related to 9p2000.u protocol only.
      Signed-off-by: NJan Dakinevich <jan.dakinevich@gmail.com>
      [groug, regression caused by commit f57f5878 # 2.10]
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      4d8bc733
    • J
      9pfs: fix readdir() for 9p2000.u · 6069537f
      Jan Dakinevich 提交于
      If the client is using 9p2000.u, the following occurs:
      
      $ cd ${virtfs_shared_dir}
      $ mkdir -p a/b/c
      $ ls a/b
      ls: cannot access 'a/b/a': No such file or directory
      ls: cannot access 'a/b/b': No such file or directory
      a  b  c
      
      instead of the expected:
      
      $ ls a/b
      c
      
      This is a regression introduced by commit f57f5878;
      local_name_to_path() now resolves ".." and "." in paths,
      and v9fs_do_readdir_with_stat()->stat_to_v9stat() then
      copies the basename of the resulting path to the response.
      With the example above, this means that "." and ".." are
      turned into "b" and "a" respectively...
      
      stat_to_v9stat() currently assumes it is passed a full
      canonicalized path and uses it to do two different things:
      1) to pass it to v9fs_co_readlink() in case the file is a symbolic
         link
      2) to set the name field of the V9fsStat structure to the basename
         part of the given path
      
      It only has two users: v9fs_stat() and v9fs_do_readdir_with_stat().
      
      v9fs_stat() really needs 1) and 2) to be performed since it starts
      with the full canonicalized path stored in the fid. It is different
      for v9fs_do_readdir_with_stat() though because the name we want to
      put into the V9fsStat structure is the d_name field of the dirent
      actually (ie, we want to keep the "." and ".." special names). So,
      we only need 1) in this case.
      
      This patch hence adds a basename argument to stat_to_v9stat(), to
      be used to set the name field of the V9fsStat structure, and moves
      the basename logic to v9fs_stat().
      Signed-off-by: NJan Dakinevich <jan.dakinevich@gmail.com>
      (groug, renamed old name argument to path and updated changelog)
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      6069537f
    • E
      MAINTAINERS: Update git URLs for my trees · e3d038b8
      Eduardo Habkost 提交于
      List the branches where I queue patches for Machine Core, NUMA,
      Memory Backends, and X86.  Update the NUMA section to list the
      "machine-next" branch instead of "numa".
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170901153928.17058-1-ehabkost@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      e3d038b8
    • E
      hw/acpi-build: Fix SRAT memory building in case of node 0 without RAM · 4926403c
      Eduardo Habkost 提交于
      Currently, Using the fisrt node without memory on the machine makes
      QEMU unhappy. With this example command line:
        ... \
        -m 1024M,slots=4,maxmem=32G \
        -numa node,nodeid=0 \
        -numa node,mem=1024M,nodeid=1 \
        -numa node,nodeid=2 \
        -numa node,nodeid=3 \
      Guest reports "No NUMA configuration found" and the NUMA topology is
      wrong.
      
      This is because when QEMU builds ACPI SRAT, it regards node 0 as the
      default node to deal with the memory hole(640K-1M). this means the
      node0 must have some memory(>1M), but, actually it can have no
      memory.
      
      Fix this problem by cut out the 640K hole in the same way the PCI
      4G hole does.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NDou Liyang <douly.fnst@cn.fujitsu.com>
      Message-Id: <1504231805-30957-2-git-send-email-douly.fnst@cn.fujitsu.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      4926403c
    • D
      NUMA: Replace MAX_NODES with nb_numa_nodes in for loop · f51878ba
      Dou Liyang 提交于
      In QEMU, the number of the NUMA nodes is determined by parse_numa_opts().
      Then, QEMU uses it for iteration, for example:
        for (i = 0; i < nb_numa_nodes; i++)
      
      However, in memory_region_allocate_system_memory(), it uses MAX_NODES
      not nb_numa_nodes.
      
      So, replace MAX_NODES with nb_numa_nodes to keep code consistency and
      reduce the loop times.
      Signed-off-by: NDou Liyang <douly.fnst@cn.fujitsu.com>
      Message-Id: <1503387936-3483-1-git-send-email-douly.fnst@cn.fujitsu.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      f51878ba
    • I
      numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed · 79e07936
      Igor Mammedov 提交于
      Calculating default node-ids for CPUs in possible_cpu_arch_ids()
      is rather fragile since defaults calculation uses nb_numa_nodes but
      callback might be potentially called early before all -numa CLI
      options are parsed, which would lead to cpus assigned only upto
      nb_numa_nodes at the time possible_cpu_arch_ids() is called.
      
      Issue was introduced by
      (7c88e65d numa: mirror cpu to node mapping in MachineState::possible_cpus)
      and for example CLI:
        -smp 4 -numa node,cpus=0 -numa node
      would set props.node-id in possible_cpus array for every non
      explicitly mapped CPU to the first node.
      
      Issue is not visible to guest nor to mgmt interface due to
        1) implictly mapped cpus are forced to the first node in
           case of partial mapping
        2) in case of default mapping possible_cpu_arch_ids() is
           called after all -numa options are parsed (resulting
           in correct mapping).
      
      However it's fragile to rely on late execution of
      possible_cpu_arch_ids(), therefore add machine specific
      callback that returns node-id for CPU and use it to calculate/
      set defaults at machine_numa_finish_init() time when all -numa
      options are parsed.
      Reported-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1496314408-163972-1-git-send-email-imammedo@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      79e07936
    • P
      Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20170919-v2' into staging · c5170027
      Peter Maydell 提交于
      Assorted s390x patches:
      - introduce virtio-gpu-ccw, with virtio-gpu endian fixes
      - lots of cleanup in the s390x code
      - make device_add work for s390x cpus
      - enable seccomp on s390x
      - an ivshmem endian fix
      - set the reserved DHCP client architecture id for netboot
      - fixes in the css and pci support
      
      # gpg: Signature made Tue 19 Sep 2017 17:39:45 BST
      # gpg:                using RSA key 0xDECF6B93C6F02FAF
      # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>"
      # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>"
      # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
      # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>"
      # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>"
      # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
      
      * remotes/cohuck/tags/s390x-20170919-v2: (38 commits)
        MAINTAINERS/s390x: add terminal3270.c
        virtio-ccw: Create a virtio gpu device for the ccw bus
        virtio-gpu: Handle endian conversion
        s390x/ccw: create s390 phb for compat reasons as well
        configure: Allow --enable-seccomp on s390x, too
        virtio-ccw: remove stale comments on endianness
        s390x: allow CPU hotplug in random core-id order
        s390x: generate sclp cpu information from possible_cpus
        s390x: get rid of cpu_s390x_create()
        s390x: get rid of cpu_states and use possible_cpus instead
        s390x: implement query-hotpluggable-cpus
        s390x: CPU hot unplug via device_del cannot work for now
        s390x: allow cpu hotplug via device_add
        s390x: print CPU definitions in sorted order
        target/s390x: rename next_cpu_id to next_core_id
        target/s390x: use "core-id" for cpu number/address/id handling
        target/s390x: set cpu->id for linux user when realizing
        s390x: allow only 1 CPU with TCG
        target/s390x: use program_interrupt() in per_check_exception()
        target/s390x: use trigger_pgm_exception() in s390_cpu_handle_mmu_fault()
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c5170027
    • C
      MAINTAINERS/s390x: add terminal3270.c · 9d1c4449
      Christian Borntraeger 提交于
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Acked-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Message-Id: <20170918130455.144262-1-borntraeger@de.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      9d1c4449
    • F
      virtio-ccw: Create a virtio gpu device for the ccw bus · 1f8ad889
      Farhan Ali 提交于
      Wire up the virtio-gpu device for the CCW bus. The virtio-gpu
      is a virtio-1 device, so disable revision 0.
      Signed-off-by: NFarhan Ali <alifm@linux.vnet.ibm.com>
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Message-Id: <6c53f939cf2d64b66d2a6878b29c9bf3820f3d5b.1505485574.git.alifm@linux.vnet.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      1f8ad889