From 8fa70dbd8bb478d9483c1da3e9976a2d86b3f9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 15 Feb 2019 10:32:39 +0000 Subject: Revert "globals: Allow global properties to be optional" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d7741743f4f3d2683d1bb6938f88dc0167c21afa. Relying on setting properties on parents types which may not be relevant to certain sub-classes had unexpected side-effects causing bugs in device config defaults. It is preferrable to be explicit about which devices get which properties, even if this needs repetition. Signed-off-by: Daniel P. Berrangé Message-Id: <20190215103239.28640-3-berrange@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/qdev-core.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/hw') diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 33ed3b8..fa55dc1 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -251,8 +251,6 @@ struct PropertyInfo { /** * GlobalProperty: * @used: Set to true if property was used when initializing a device. - * @optional: If set to true, GlobalProperty will be skipped without errors - * if the property doesn't exist. * * An error is fatal for non-hotplugged devices, when the global is applied. */ @@ -261,7 +259,6 @@ typedef struct GlobalProperty { const char *property; const char *value; bool used; - bool optional; } GlobalProperty; static inline void -- cgit v1.1 From badaf79cfdbd32b22df00bca1a1797036063dc48 Mon Sep 17 00:00:00 2001 From: Xie Yongji Date: Wed, 20 Mar 2019 19:26:40 +0800 Subject: virtio: Introduce started flag to VirtioDevice The virtio 1.0 transitional devices support driver uses the device before setting the DRIVER_OK status bit. So we introduce a started flag to indicate whether driver has started the device or not. Signed-off-by: Xie Yongji Signed-off-by: Zhang Yu Message-Id: <20190320112646.3712-2-xieyongji@baidu.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/hw') diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 7140381..27c0efc 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -105,6 +105,8 @@ struct VirtIODevice uint16_t device_id; bool vm_running; bool broken; /* device in invalid state, needs reset */ + bool started; + bool start_on_kick; /* virtio 1.0 transitional devices support that */ VMChangeStateEntry *vmstate; char *bus_name; uint8_t device_endian; -- cgit v1.1 From 77542d431491788d1e8e79d93ce10172ef207775 Mon Sep 17 00:00:00 2001 From: Xie Yongji Date: Wed, 20 Mar 2019 19:26:45 +0800 Subject: vhost-user-blk: Add support to reconnect backend Since we now support the message VHOST_USER_GET_INFLIGHT_FD and VHOST_USER_SET_INFLIGHT_FD. The backend is able to restart safely because it can track inflight I/O in shared memory. This patch allows qemu to reconnect the backend after connection closed. Signed-off-by: Xie Yongji Signed-off-by: Ni Xun Signed-off-by: Zhang Yu Message-Id: <20190320112646.3712-7-xieyongji@baidu.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-user-blk.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/hw') diff --git a/include/hw/virtio/vhost-user-blk.h b/include/hw/virtio/vhost-user-blk.h index 68634be..51457fb 100644 --- a/include/hw/virtio/vhost-user-blk.h +++ b/include/hw/virtio/vhost-user-blk.h @@ -38,6 +38,9 @@ typedef struct VHostUserBlk { struct vhost_dev dev; struct vhost_inflight *inflight; VhostUserState vhost_user; + struct vhost_virtqueue *vqs; + guint watch; + bool connected; } VHostUserBlk; #endif -- cgit v1.1 From 48cefd94c748cf8d5bb3ffda53bdc8e503882a3f Mon Sep 17 00:00:00 2001 From: Wei Yang Date: Fri, 19 Apr 2019 08:30:51 +0800 Subject: hw/arm/virt-acpi-build: pass AcpiMcfgInfo to build_mcfg() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To build MCFG, two information is necessary: * bus number * base address Abstract these two information to AcpiMcfgInfo so that build_mcfg and build_mcfg_q35 will have the same declaration. Signed-off-by: Wei Yang Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20190419003053.8260-5-richardw.yang@linux.intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/pci.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/hw/acpi/pci.h (limited to 'include/hw') diff --git a/include/hw/acpi/pci.h b/include/hw/acpi/pci.h new file mode 100644 index 0000000..124af7d --- /dev/null +++ b/include/hw/acpi/pci.h @@ -0,0 +1,33 @@ +/* + * Support for generating PCI related ACPI tables and passing them to Guests + * + * Copyright (C) 2006 Fabrice Bellard + * Copyright (C) 2008-2010 Kevin O'Connor + * Copyright (C) 2013-2019 Red Hat Inc + * Copyright (C) 2019 Intel Corporation + * + * Author: Wei Yang + * Author: Michael S. Tsirkin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ +#ifndef HW_ACPI_PCI_H +#define HW_ACPI_PCI_H + +typedef struct AcpiMcfgInfo { + uint64_t base; + uint32_t size; +} AcpiMcfgInfo; + +#endif -- cgit v1.1 From b0e5196a52248d7e4eef709481c1c530c1bca6df Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 24 Apr 2019 14:19:58 +1000 Subject: pci: Simplify pci_bus_is_root() pci_bus_is_root() currently relies on a method in the PCIBusClass. But it's always known if a PCI bus is a root bus when we create it, so using a dynamic method is overkill. This replaces it with an IS_ROOT bit in a new flags field, which is set on root buses and otherwise clear. As a bonus this removes the special is_root logic from pci_expander_bridge, since it already creates its bus as a root bus. Signed-off-by: David Gibson Reviewed-by: Marcel Apfelbaum Reviewed-by: Peter Xu Reviewed-by: Greg Kurz Message-Id: <20190424041959.4087-3-david@gibson.dropbear.id.au> --- include/hw/pci/pci.h | 1 - include/hw/pci/pci_bus.h | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'include/hw') diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index fdd4c43..edf44de 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -395,7 +395,6 @@ typedef PCIINTxRoute (*pci_route_irq_fn)(void *opaque, int pin); #define TYPE_PCIE_BUS "PCIE" bool pci_bus_is_express(PCIBus *bus); -bool pci_bus_is_root(PCIBus *bus); bool pci_bus_allows_extended_config_space(PCIBus *bus); void pci_root_bus_new_inplace(PCIBus *bus, size_t bus_size, DeviceState *parent, diff --git a/include/hw/pci/pci_bus.h b/include/hw/pci/pci_bus.h index f6df834..aea98d5 100644 --- a/include/hw/pci/pci_bus.h +++ b/include/hw/pci/pci_bus.h @@ -15,14 +15,19 @@ typedef struct PCIBusClass { BusClass parent_class; /*< public >*/ - bool (*is_root)(PCIBus *bus); int (*bus_num)(PCIBus *bus); uint16_t (*numa_node)(PCIBus *bus); bool (*allows_extended_config_space)(PCIBus *bus); } PCIBusClass; +enum PCIBusFlags { + /* This bus is the root of a PCI domain */ + PCI_BUS_IS_ROOT = 0x0001, +}; + struct PCIBus { BusState qbus; + enum PCIBusFlags flags; PCIIOMMUFunc iommu_fn; void *iommu_opaque; uint8_t devfn_min; @@ -47,4 +52,9 @@ struct PCIBus { Notifier machine_done; }; +static inline bool pci_bus_is_root(PCIBus *bus) +{ + return !!(bus->flags & PCI_BUS_IS_ROOT); +} + #endif /* QEMU_PCI_BUS_H */ -- cgit v1.1