1. 20 9月, 2017 3 次提交
    • 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
  2. 19 9月, 2017 8 次提交
  3. 18 9月, 2017 4 次提交
  4. 17 9月, 2017 18 次提交
  5. 16 9月, 2017 7 次提交
    • P
      Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging · 5ee53d15
      Peter Maydell 提交于
      Python queue, 2017-09-15
      
      # gpg: Signature made Sat 16 Sep 2017 00:14: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/python-next-pull-request:
        qemu.py: include debug information on launch error
        qemu.py: improve message on negative exit code
        qemu.py: use os.path.null instead of /dev/null
        qemu.py: avoid writing to stdout/stderr
        qemu.py: fix is_running() return before first launch()
        qtest.py: Few pylint/style fixes
        qmp.py: Avoid overriding a builtin object
        qmp.py: Avoid "has_key" usage
        qmp.py: Use object-based class for QEMUMonitorProtocol
        qmp.py: Couple of pylint/style fixes
        qemu.py: Use custom exceptions rather than Exception
        qemu.py: Simplify QMP key-conversion
        qemu.py: Use iteritems rather than keys()
        qemu|qtest: Avoid dangerous arguments
        qemu.py: Pylint/style fixes
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5ee53d15
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging · d8782a11
      Peter Maydell 提交于
      # gpg: Signature made Fri 15 Sep 2017 18:39:41 BST
      # gpg:                using RSA key 0x9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/tracing-pull-request:
        trace: Immediately apply per-vCPU state changes if a vCPU is being created
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      d8782a11
    • A
      qemu.py: include debug information on launch error · b92a0011
      Amador Pahim 提交于
      When launching a VM, if an exception happens and the VM is not
      initiated, it might be useful to see the qemu command line and
      the qemu command output.
      
      This patch creates that message. Notice that self._iolog needs to be
      cleaned up in the beginning of the launch() to make sure we will not
      expose the qemu log from a previous launch if the current one fails.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      Message-Id: <20170901112829.2571-6-apahim@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      b92a0011
    • A
      qemu.py: improve message on negative exit code · dab91d9a
      Amador Pahim 提交于
      The current message shows 'self._args', which contains only part of the
      options used in the Qemu command line.
      
      This patch makes the qemu full args list an instance variable and then
      uses it in the negative exit code message.
      
      Message was moved outside the 'if is_running' block to make sure it will
      be logged if the VM finishes before the call to shutdown().
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      Message-Id: <20170901112829.2571-5-apahim@redhat.com>
      [ehabkost: removed superfluous parenthesis]
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      dab91d9a
    • A
      qemu.py: use os.path.null instead of /dev/null · 63e0ba55
      Amador Pahim 提交于
      For increased portability, let's use os.path.devnull.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      Message-Id: <20170901112829.2571-4-apahim@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      63e0ba55
    • A
      qemu.py: avoid writing to stdout/stderr · 4738b0a8
      Amador Pahim 提交于
      This module should not write directly to stdout/stderr. Instead, it
      should either raise exceptions or just log the messages and let the
      callers handle them and decide what to do. For example, scripts could
      choose to send the log messages stderr or/and write them to a file if
      verbose or debugging mode is enabled.
      
      This patch replaces the writes to stderr by an exception in the
      send_fd_scm() when _socket_scm_helper is not set or not present. In the
      same method, the subprocess Popen will now redirect the stdout/stderr to
      logging.debug instead of writing to system stderr. As consequence, since
      the Popen.communicate() is now used (in order to get the stdout), the
      further call to wait() became redundant and was replaced by
      Popen.returncode.
      
      The shutdown() message on negative exit code will now be logged
      to logging.warn instead of written to system stderr.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      Message-Id: <20170901112829.2571-3-apahim@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      4738b0a8
    • A
      qemu.py: fix is_running() return before first launch() · f6cf7f5a
      Amador Pahim 提交于
      is_running() returns None when called before the first time we
      call launch():
      
          >>> import qemu
          >>> vm = qemu.QEMUMachine('qemu-system-x86_64')
          >>> vm.is_running()
          >>>
      
      It should return False instead. This patch fixes that.
      
      For consistence, this patch removes the parenthesis from the
      second clause as it's not really needed.
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      Message-Id: <20170901112829.2571-2-apahim@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      f6cf7f5a