qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 7abea5: fix: unrealize virtio device if we fa


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 7abea5: fix: unrealize virtio device if we fail to hotplug...
Date: Fri, 17 Nov 2017 01:24:43 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7abea552aba6e85b338015726648974d6d6f19c8
      
https://github.com/qemu/qemu/commit/7abea552aba6e85b338015726648974d6d6f19c8
  Author: linzhecheng <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M hw/virtio/virtio.c

  Log Message:
  -----------
  fix: unrealize virtio device if we fail to hotplug it

If we fail to hotplug virtio-blk device and then suspend
or shutdown VM, qemu is likely to crash.

Re-production steps:
1. Run VM named vm001
2. Create a virtio-blk.xml which contains wrong configurations:
<disk device="lun" rawio="yes" type="block">
  <driver cache="none" io="native" name="qemu" type="raw" />
  <source dev="/dev/mapper/11-dm" />
  <target bus="virtio" dev="vdx" />
</disk>
3. Run command : virsh attach-device vm001 virtio-blk.xml
error: Failed to attach device from blk-scsi.xml
error: internal error: unable to execute QEMU command 'device_add': Please set 
scsi=off for virtio-blk devices in order to use virtio 1.0
it means hotplug virtio-blk device failed.
4. Suspend or shutdown VM will leads to qemu crash

Problem happens in virtio_vmstate_change which is called by
vm_state_notify:
vdev’s parent_bus is NULL, so qdev_get_parent_bus(DEVICE(vdev)) will crash.
virtio_vmstate_change is added to the list vm_change_state_head at 
virtio_blk_device_realize(virtio_init),
but after hotplug virtio-blk failed, virtio_vmstate_change will not be removed 
from vm_change_state_head.
Adding unrealize function of virtio-blk device can solve this problem.

Signed-off-by: linzhecheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: d06bce95ff8c6e2f290db150695f826c3d57324f
      
https://github.com/qemu/qemu/commit/d06bce95ff8c6e2f290db150695f826c3d57324f
  Author: Alexey Kardashevskiy <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M hw/pci/pci.c

  Log Message:
  -----------
  pci: Initialize pci_dev->name before use

This moves pci_dev->name initialization earlier so
pci_dev->bus_master_as could get a name instead of an empty string.

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 9fa99d2519cbf71f871e46871df12cb446dc1c3e
      
https://github.com/qemu/qemu/commit/9fa99d2519cbf71f871e46871df12cb446dc1c3e
  Author: Marcel Apfelbaum <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M hw/i386/pc.c
    M hw/pci-host/piix.c
    M hw/pci-host/q35.c
    M include/hw/i386/pc.h
    M include/hw/pci-host/q35.h

  Log Message:
  -----------
  hw/pci-host: Fix x86 Host Bridges 64bit PCI hole

Currently there is no MMIO range over 4G
reserved for PCI hotplug. Since the 32bit PCI hole
depends on the number of cold-plugged PCI devices
and other factors, it is very possible is too small
to hotplug PCI devices with large BARs.

Fix it by reserving 2G for I4400FX chipset
in order to comply with older Win32 Guest OSes
and 32G for Q35 chipset.

Even if the new defaults of pci-hole64-size will appear in
"info qtree" also for older machines, the property was
not implemented so no changes will be visible to guests.

Note this is a regression since prev QEMU versions had
some range reserved for 64bit PCI hotplug.

Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Gerd Hoffmann <address@hidden>
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 2d0f99ed38e291498613633bcab79811c7c4fd07
      
https://github.com/qemu/qemu/commit/2d0f99ed38e291498613633bcab79811c7c4fd07
  Author: Marcel Apfelbaum <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M hw/pci-bridge/Makefile.objs

  Log Message:
  -----------
  hw/pcie-pci-bridge: restrict to X86 and ARM

The PCIE-PCI bridge is specific to "pure" PCIe systems
(on QEMU we have X86 and ARM), it does not make sense to
have it in other archs.

Reported-by: Thomas Huth <address@hidden>
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Tested-by: Yongbok Kim <address@hidden>


  Commit: 45bd4b1c099843565e1686f09ae307984a08a3d6
      
https://github.com/qemu/qemu/commit/45bd4b1c099843565e1686f09ae307984a08a3d6
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M tests/acpi-test-data/pc/DSDT
    M tests/acpi-test-data/pc/DSDT.bridge
    M tests/acpi-test-data/pc/DSDT.cphp
    M tests/acpi-test-data/pc/DSDT.ipmikcs
    M tests/acpi-test-data/pc/DSDT.memhp
    M tests/acpi-test-data/q35/DSDT
    M tests/acpi-test-data/q35/DSDT.bridge
    M tests/acpi-test-data/q35/DSDT.cphp
    M tests/acpi-test-data/q35/DSDT.ipmibt
    M tests/acpi-test-data/q35/DSDT.memhp

  Log Message:
  -----------
  tests/acpi-test-data: update _CRS in DSDT

commit dadf988e81b15065ac1d6dbaf4b87b5b80c7b670
    hw/pci-host: Fix x86 Host Bridges 64bit PCI hole

Added a 64 bit hole to _CRS of PCI0.
Update the expected files accordingly.

Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 7b8be49d36fc0a48e41ede7ba7e046c1db2b89bc
      
https://github.com/qemu/qemu/commit/7b8be49d36fc0a48e41ede7ba7e046c1db2b89bc
  Author: Dou Liyang <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M include/hw/boards.h
    M numa.c
    M vl.c

  Log Message:
  -----------
  NUMA: Enable adding NUMA node implicitly

Linux and Windows need ACPI SRAT table to make memory hotplug work properly,
however currently QEMU doesn't create SRAT table if numa options aren't present
on CLI.

Which breaks both linux and windows guests in certain conditions:
 * Windows: won't enable memory hotplug without SRAT table at all
 * Linux: if QEMU is started with initial memory all below 4Gb and no SRAT table
   present, guest kernel will use nommu DMA ops, which breaks 32bit hw drivers
   when memory is hotplugged and guest tries to use it with that drivers.

Fix above issues by automatically creating a numa node when QEMU is started with
memory hotplug enabled but without '-numa' options on CLI.
(PS: auto-create numa node only for new machine types so not to break 
migration).

Which would provide SRAT table to guests without explicit -numa options on CLI
and would allow:
 * Windows: to enable memory hotplug
 * Linux: switch to SWIOTLB DMA ops, to bounce DMA transfers to 32bit allocated
   buffers that legacy drivers/hw can handle.

[Rewritten by Igor]

Reported-by: Thadeu Lima de Souza Cascardo <address@hidden>
Suggested-by: Igor Mammedov <address@hidden>
Signed-off-by: Dou Liyang <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Cc: Richard Henderson <address@hidden>
Cc: Eduardo Habkost <address@hidden>
Cc: "Michael S. Tsirkin" <address@hidden>
Cc: Marcel Apfelbaum <address@hidden>
Cc: Igor Mammedov <address@hidden>
Cc: David Hildenbrand <address@hidden>
Cc: Thomas Huth <address@hidden>
Cc: Alistair Francis <address@hidden>
Cc: Takao Indoh <address@hidden>
Cc: Izumi Taku <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: b948bb55dac527ae6b0c5e6dc69d00866a3a6fee
      
https://github.com/qemu/qemu/commit/b948bb55dac527ae6b0c5e6dc69d00866a3a6fee
  Author: Marc-André Lureau <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M hw/misc/vmcoreinfo.c

  Log Message:
  -----------
  vmcoreinfo: put it in the 'misc' device category

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: f865da7c369fa00b2ccaf6bce158ad2701b2a27c
      
https://github.com/qemu/qemu/commit/f865da7c369fa00b2ccaf6bce158ad2701b2a27c
  Author: Marc-André Lureau <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M default-configs/arm-softmmu.mak
    M default-configs/i386-softmmu.mak
    M default-configs/x86_64-softmmu.mak
    M hw/misc/Makefile.objs

  Log Message:
  -----------
  build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets

vmcoreinfo is built for all targets. However, it requires fw_cfg with
DMA operations support (write operation). Restrict vmcoreinfo exposure
to architectures that are supporting FW_CFG_DMA, that is arm-virt and
x86 only atm.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Daniel Henrique Barboza <address@hidden>
Tested-by: Daniel Henrique Barboza <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 3831c07b89ab1f7aa1427bc56e9cdf70f5367933
      
https://github.com/qemu/qemu/commit/3831c07b89ab1f7aa1427bc56e9cdf70f5367933
  Author: Thomas Huth <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M tests/acpi-utils.h
    M tests/bios-tables-test.c
    M tests/vmgenid-test.c

  Log Message:
  -----------
  tests/bios-tables-test: Fix endianess problems when passing data to iasl

The bios-tables-test was writing out files that we pass to iasl in
with the wrong endianness in the header when running on a big endian
host. So instead of storing mixed endian information in our structures,
let's keep everything in little endian and byte-swap it only when we
need a value in the code.

Reported-by: Daniel P. Berrange <address@hidden>
Buglink: https://bugs.launchpad.net/qemu/+bug/1724570
Suggested-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Tested-by: "Daniel P. Berrange" <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: b91f0f25c7fd84776af2ae6c5683cbd70d060783
      
https://github.com/qemu/qemu/commit/b91f0f25c7fd84776af2ae6c5683cbd70d060783
  Author: Peter Maydell <address@hidden>
  Date:   2017-11-16 (Thu, 16 Nov 2017)

  Changed paths:
    M default-configs/arm-softmmu.mak
    M default-configs/i386-softmmu.mak
    M default-configs/x86_64-softmmu.mak
    M hw/i386/pc.c
    M hw/i386/pc_piix.c
    M hw/i386/pc_q35.c
    M hw/misc/Makefile.objs
    M hw/misc/vmcoreinfo.c
    M hw/pci-bridge/Makefile.objs
    M hw/pci-host/piix.c
    M hw/pci-host/q35.c
    M hw/pci/pci.c
    M hw/virtio/virtio.c
    M include/hw/boards.h
    M include/hw/i386/pc.h
    M include/hw/pci-host/q35.h
    M numa.c
    M tests/acpi-test-data/pc/DSDT
    M tests/acpi-test-data/pc/DSDT.bridge
    M tests/acpi-test-data/pc/DSDT.cphp
    M tests/acpi-test-data/pc/DSDT.ipmikcs
    M tests/acpi-test-data/pc/DSDT.memhp
    M tests/acpi-test-data/q35/DSDT
    M tests/acpi-test-data/q35/DSDT.bridge
    M tests/acpi-test-data/q35/DSDT.cphp
    M tests/acpi-test-data/q35/DSDT.ipmibt
    M tests/acpi-test-data/q35/DSDT.memhp
    M tests/acpi-utils.h
    M tests/bios-tables-test.c
    M tests/vmgenid-test.c
    M vl.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc, pci, virtio: fixes for rc1

A bunch of fixes all over the place.

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Thu 16 Nov 2017 16:37:21 GMT
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"
# 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:
  tests/bios-tables-test: Fix endianess problems when passing data to iasl
  build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets
  vmcoreinfo: put it in the 'misc' device category
  NUMA: Enable adding NUMA node implicitly
  tests/acpi-test-data: update _CRS in DSDT
  hw/pcie-pci-bridge: restrict to X86 and ARM
  hw/pci-host: Fix x86 Host Bridges 64bit PCI hole
  pci: Initialize pci_dev->name before use
  fix: unrealize virtio device if we fail to hotplug it

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/afdad8b6840d...b91f0f25c7fd

reply via email to

[Prev in Thread] Current Thread [Next in Thread]