[libvirt] [PATCHv10 0/2] Add Cascadelake-SP CPU model
by Wang Huaqiang
Cascadelake-SP is looked as the second generation Intel XEON processor
scalable family while Skylake-SP is the first generation. Both
Skylake-SP and Cascadelake-SP has the same family (6h) and model (55h),
but with difference stepping number.
In the process of identifying candidate CPU, the stepping number is not
irrelevant any more. The CPU refresh from Skylake-SP to Cascadelake-SP
is this kind of example.
These two patches firstly introduce the stepping number as another factor
to identify future Intel CPU, then introduce the Cascadelake-SP cpu model.
Wang Huaqiang (2):
cpu: Add x86 stepping number as another factor to find candidate CPU
cpu_map: Add Cascadelake Server CPU model
src/cpu/cpu_x86.c | 60 +++++++++++++++++++-----
src/cpu_map/Makefile.inc.am | 1 +
src/cpu_map/index.xml | 1 +
src/cpu_map/x86_Cascadelake-Server.xml | 83 ++++++++++++++++++++++++++++++++++
4 files changed, 133 insertions(+), 12 deletions(-)
create mode 100644 src/cpu_map/x86_Cascadelake-Server.xml
--
2.7.4
5 years, 12 months
[libvirt] [PATCH for-4.0 v2] virtio: Provide version-specific variants of virtio PCI devices
by Eduardo Habkost
Many of the current virtio-*-pci device types actually represent
3 different types of devices:
* virtio 1.0 non-transitional devices
* virtio 1.0 transitional devices
* virtio 0.9 ("legacy device" in virtio 1.0 terminology)
That would be just an annoyance if it didn't break our device/bus
compatibility QMP interfaces. With this multi-purpose device
type, there's no way to tell management software that
transitional devices and legacy devices require a Conventional
PCI bus.
The multi-purpose device types would also prevent us from telling
management software what's the PCI vendor/device ID for them,
because their PCI IDs change at runtime depending on the bus
where they were plugged.
This patch adds separate device types for each of those virtio
device flavors:
- virtio-*-pci: the existing multi-purpose device types
- Configurable using `disable-legacy` and `disable-modern`
properties
- Legacy driver support is automatically enabled/disabled
depending on the bus where it is plugged
- Supports Conventional PCI and PCI Express buses
(but Conventional PCI is incompatible with
disable-legacy=off)
- Changes PCI vendor/device IDs at runtime
- virtio-*-pci-transitional: virtio-1.0 device supporting legacy drivers
- Supports Conventional PCI buses only, because
it has a PIO BAR
- virtio-*-pci-non-transitional: modern-only
- Supports both Conventional PCI and PCI Express buses
All the types above will inherit from an abstract
"virtio-*-pci-base" type, so existing code that doesn't care
about the virtio version can use "virtio-*-pci-base" on type
casts.
Note that devices that are always non-transitional won't have the
-non-transitional variants added, because it would be redundant.
A simple test script (tests/acceptance/virtio_version.py) is
included, to check if the new device types are equivalent to
using the `disable-legacy` and `disable-modern` options.
Signed-off-by: Eduardo Habkost <ehabkost(a)redhat.com>
---
Reference to previous discussion that originated this idea:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg558389.html
Changes v1 -> v2:
* Removed *-0.9 devices. Nobody will want to use them, if
transitional devices work with legacy drivers
(Gerd Hoffmann, Michael S. Tsirkin)
* Drop virtio version from name: rename -1.0-transitional to
-transitional (Michael S. Tsirkin)
* Renamed -1.0 to -non-transitional
* Don't add any extra variants to modern-only device types
(they don't need it)
* Fix typo on TYPE_VIRTIO_INPUT_HOST_PCI (crash reported by
Cornelia Huck)
* No need to change cast macros for modern-only devices
* Rename virtio_register_types() to virtio_pci_types_register()
Note about points discussed in the v1 thread:
Andrea suggested making separate transitional Conventional PCi
and transitional PCI Express device types[1]. I didn't do that
because I don't see which problems this solves. We have many
other device types that are hybrid (support both PCI Express and
Conventional PCI) and this was never a problem for us[2].
[1] http://mid.mail-archive.com/6f8d59b8ee2d92d73d2957b520bd8bac989fc796.came...
[2] http://mid.mail-archive.com/20181017155637.GC31060@habkost.net
---
hw/virtio/virtio-pci.h | 80 +++++++++--
hw/display/virtio-gpu-pci.c | 8 +-
hw/display/virtio-vga.c | 8 +-
hw/virtio/virtio-crypto-pci.c | 8 +-
hw/virtio/virtio-pci.c | 215 ++++++++++++++++++++---------
tests/acceptance/virtio_version.py | 177 ++++++++++++++++++++++++
6 files changed, 406 insertions(+), 90 deletions(-)
create mode 100644 tests/acceptance/virtio_version.py
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index 813082b0d7..1d2a11504f 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -216,7 +216,8 @@ static inline void virtio_pci_disable_modern(VirtIOPCIProxy *proxy)
/*
* virtio-scsi-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_SCSI_PCI "virtio-scsi-pci"
+#define TYPE_VIRTIO_SCSI_PCI_PREFIX "virtio-scsi-pci"
+#define TYPE_VIRTIO_SCSI_PCI (TYPE_VIRTIO_SCSI_PCI_PREFIX "-base")
#define VIRTIO_SCSI_PCI(obj) \
OBJECT_CHECK(VirtIOSCSIPCI, (obj), TYPE_VIRTIO_SCSI_PCI)
@@ -229,7 +230,8 @@ struct VirtIOSCSIPCI {
/*
* vhost-scsi-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VHOST_SCSI_PCI "vhost-scsi-pci"
+#define TYPE_VHOST_SCSI_PCI_PREFIX "vhost-scsi-pci"
+#define TYPE_VHOST_SCSI_PCI (TYPE_VHOST_SCSI_PCI_PREFIX "-base")
#define VHOST_SCSI_PCI(obj) \
OBJECT_CHECK(VHostSCSIPCI, (obj), TYPE_VHOST_SCSI_PCI)
@@ -239,7 +241,8 @@ struct VHostSCSIPCI {
};
#endif
-#define TYPE_VHOST_USER_SCSI_PCI "vhost-user-scsi-pci"
+#define TYPE_VHOST_USER_SCSI_PCI_PREFIX "vhost-user-scsi-pci"
+#define TYPE_VHOST_USER_SCSI_PCI (TYPE_VHOST_USER_SCSI_PCI_PREFIX "-base")
#define VHOST_USER_SCSI_PCI(obj) \
OBJECT_CHECK(VHostUserSCSIPCI, (obj), TYPE_VHOST_USER_SCSI_PCI)
@@ -252,7 +255,8 @@ struct VHostUserSCSIPCI {
/*
* vhost-user-blk-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VHOST_USER_BLK_PCI "vhost-user-blk-pci"
+#define TYPE_VHOST_USER_BLK_PCI_PREFIX "vhost-user-blk-pci"
+#define TYPE_VHOST_USER_BLK_PCI (TYPE_VHOST_USER_BLK_PCI_PREFIX "-base")
#define VHOST_USER_BLK_PCI(obj) \
OBJECT_CHECK(VHostUserBlkPCI, (obj), TYPE_VHOST_USER_BLK_PCI)
@@ -265,7 +269,8 @@ struct VHostUserBlkPCI {
/*
* virtio-blk-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_BLK_PCI "virtio-blk-pci"
+#define TYPE_VIRTIO_BLK_PCI_PREFIX "virtio-blk-pci"
+#define TYPE_VIRTIO_BLK_PCI (TYPE_VIRTIO_BLK_PCI_PREFIX "-base")
#define VIRTIO_BLK_PCI(obj) \
OBJECT_CHECK(VirtIOBlkPCI, (obj), TYPE_VIRTIO_BLK_PCI)
@@ -277,7 +282,8 @@ struct VirtIOBlkPCI {
/*
* virtio-balloon-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_BALLOON_PCI "virtio-balloon-pci"
+#define TYPE_VIRTIO_BALLOON_PCI_PREFIX "virtio-balloon-pci"
+#define TYPE_VIRTIO_BALLOON_PCI (TYPE_VIRTIO_BALLOON_PCI_PREFIX "-base")
#define VIRTIO_BALLOON_PCI(obj) \
OBJECT_CHECK(VirtIOBalloonPCI, (obj), TYPE_VIRTIO_BALLOON_PCI)
@@ -289,7 +295,8 @@ struct VirtIOBalloonPCI {
/*
* virtio-serial-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_SERIAL_PCI "virtio-serial-pci"
+#define TYPE_VIRTIO_SERIAL_PCI_PREFIX "virtio-serial-pci"
+#define TYPE_VIRTIO_SERIAL_PCI (TYPE_VIRTIO_SERIAL_PCI_PREFIX "-base")
#define VIRTIO_SERIAL_PCI(obj) \
OBJECT_CHECK(VirtIOSerialPCI, (obj), TYPE_VIRTIO_SERIAL_PCI)
@@ -301,7 +308,8 @@ struct VirtIOSerialPCI {
/*
* virtio-net-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_NET_PCI "virtio-net-pci"
+#define TYPE_VIRTIO_NET_PCI_PREFIX "virtio-net-pci"
+#define TYPE_VIRTIO_NET_PCI (TYPE_VIRTIO_NET_PCI_PREFIX "-base")
#define VIRTIO_NET_PCI(obj) \
OBJECT_CHECK(VirtIONetPCI, (obj), TYPE_VIRTIO_NET_PCI)
@@ -316,7 +324,8 @@ struct VirtIONetPCI {
#ifdef CONFIG_VIRTFS
-#define TYPE_VIRTIO_9P_PCI "virtio-9p-pci"
+#define TYPE_VIRTIO_9P_PCI_PREFIX "virtio-9p-pci"
+#define TYPE_VIRTIO_9P_PCI (TYPE_VIRTIO_9P_PCI_PREFIX "-base")
#define VIRTIO_9P_PCI(obj) \
OBJECT_CHECK(V9fsPCIState, (obj), TYPE_VIRTIO_9P_PCI)
@@ -330,7 +339,8 @@ typedef struct V9fsPCIState {
/*
* virtio-rng-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VIRTIO_RNG_PCI "virtio-rng-pci"
+#define TYPE_VIRTIO_RNG_PCI_PREFIX "virtio-rng-pci"
+#define TYPE_VIRTIO_RNG_PCI (TYPE_VIRTIO_RNG_PCI_PREFIX "-base")
#define VIRTIO_RNG_PCI(obj) \
OBJECT_CHECK(VirtIORngPCI, (obj), TYPE_VIRTIO_RNG_PCI)
@@ -365,7 +375,8 @@ struct VirtIOInputHIDPCI {
#ifdef CONFIG_LINUX
-#define TYPE_VIRTIO_INPUT_HOST_PCI "virtio-input-host-pci"
+#define TYPE_VIRTIO_INPUT_HOST_PCI_PREFIX "virtio-input-host-pci"
+#define TYPE_VIRTIO_INPUT_HOST_PCI (TYPE_VIRTIO_INPUT_HOST_PCI_PREFIX "-base")
#define VIRTIO_INPUT_HOST_PCI(obj) \
OBJECT_CHECK(VirtIOInputHostPCI, (obj), TYPE_VIRTIO_INPUT_HOST_PCI)
@@ -392,7 +403,8 @@ struct VirtIOGPUPCI {
/*
* vhost-vsock-pci: This extends VirtioPCIProxy.
*/
-#define TYPE_VHOST_VSOCK_PCI "vhost-vsock-pci"
+#define TYPE_VHOST_VSOCK_PCI_PREFIX "vhost-vsock-pci"
+#define TYPE_VHOST_VSOCK_PCI (TYPE_VHOST_VSOCK_PCI_PREFIX "-base")
#define VHOST_VSOCK_PCI(obj) \
OBJECT_CHECK(VHostVSockPCI, (obj), TYPE_VHOST_VSOCK_PCI)
@@ -417,4 +429,48 @@ struct VirtIOCryptoPCI {
/* Virtio ABI version, if we increment this, we break the guest driver. */
#define VIRTIO_PCI_ABI_VERSION 0
+/**
+ * VirtioPCIDeviceTypeInfo:
+ *
+ * Template for virtio PCI device types. See virtio_pci_types_register()
+ * for details.
+ */
+typedef struct VirtioPCIDeviceTypeInfo {
+ /* Prefix for the class names */
+ const char *name_prefix;
+ /* Parent type. If NULL, TYPE_VIRTIO_PCI is used */
+ const char *parent;
+ /* If modern_only is true, only <name_prefix> type will be registered */
+ bool modern_only;
+
+ /* Same as TypeInfo fields: */
+ size_t instance_size;
+ void (*instance_init)(Object *obj);
+ void (*class_init)(ObjectClass *klass, void *data);
+} VirtioPCIDeviceTypeInfo;
+
+/*
+ * Register virtio-pci types. Each virtio-pci device type will be available
+ * in 3 flavors:
+ * - <prefix>-transitional: modern device supporting legacy drivers
+ * - Supports Conventional PCI buses only
+ * - <prefix>-non-transitional: modern-only
+ * - Supports Conventional PCI and PCI Express buses
+ * - <prefix>: virtio version configurable, legacy driver support
+ * automatically selected when device is plugged
+ * _ This was the only flavor supported until QEMU 3.1
+ * - Supports Conventional PCI and PCI Express buses
+ *
+ * All the types above will inherit from "<prefix>-base", so generic
+ * code can use "<prefix>-base" on type casts.
+ *
+ * We need a separate "<prefix>-base" type instead of making all types inherit
+ * from <prefix> for two reasons:
+ * 1) <prefix> will implement INTERFACE_PCIE_DEVICE, but
+ * <prefix>-transitional won't.
+ * 2) <prefix> will have the "disable-legacy" and "disable-modern" properties,
+ * <prefix>-transitional and <prefix>-non-transitional won't.
+ */
+void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t);
+
#endif
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index cece4aa495..ca47063b70 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -69,9 +69,9 @@ static void virtio_gpu_initfn(Object *obj)
TYPE_VIRTIO_GPU);
}
-static const TypeInfo virtio_gpu_pci_info = {
- .name = TYPE_VIRTIO_GPU_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_gpu_pci_info = {
+ .name_prefix = TYPE_VIRTIO_GPU_PCI,
+ .modern_only = true,
.instance_size = sizeof(VirtIOGPUPCI),
.instance_init = virtio_gpu_initfn,
.class_init = virtio_gpu_pci_class_init,
@@ -79,6 +79,6 @@ static const TypeInfo virtio_gpu_pci_info = {
static void virtio_gpu_pci_register_types(void)
{
- type_register_static(&virtio_gpu_pci_info);
+ virtio_pci_types_register(&virtio_gpu_pci_info);
}
type_init(virtio_gpu_pci_register_types)
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index ab2e369b28..aaa42a8c31 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -207,9 +207,9 @@ static void virtio_vga_inst_initfn(Object *obj)
TYPE_VIRTIO_GPU);
}
-static TypeInfo virtio_vga_info = {
- .name = TYPE_VIRTIO_VGA,
- .parent = TYPE_VIRTIO_PCI,
+static VirtioPCIDeviceTypeInfo virtio_vga_info = {
+ .name_prefix = TYPE_VIRTIO_VGA,
+ .modern_only = true,
.instance_size = sizeof(struct VirtIOVGA),
.instance_init = virtio_vga_inst_initfn,
.class_init = virtio_vga_class_init,
@@ -217,7 +217,7 @@ static TypeInfo virtio_vga_info = {
static void virtio_vga_register_types(void)
{
- type_register_static(&virtio_vga_info);
+ virtio_pci_types_register(&virtio_vga_info);
}
type_init(virtio_vga_register_types)
diff --git a/hw/virtio/virtio-crypto-pci.c b/hw/virtio/virtio-crypto-pci.c
index bf64996e48..c41dc11f0d 100644
--- a/hw/virtio/virtio-crypto-pci.c
+++ b/hw/virtio/virtio-crypto-pci.c
@@ -64,9 +64,9 @@ static void virtio_crypto_initfn(Object *obj)
TYPE_VIRTIO_CRYPTO);
}
-static const TypeInfo virtio_crypto_pci_info = {
- .name = TYPE_VIRTIO_CRYPTO_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_crypto_pci_info = {
+ .name_prefix = TYPE_VIRTIO_CRYPTO_PCI,
+ .modern_only = true,
.instance_size = sizeof(VirtIOCryptoPCI),
.instance_init = virtio_crypto_initfn,
.class_init = virtio_crypto_pci_class_init,
@@ -74,6 +74,6 @@ static const TypeInfo virtio_crypto_pci_info = {
static void virtio_crypto_pci_register_types(void)
{
- type_register_static(&virtio_crypto_pci_info);
+ virtio_pci_types_register(&virtio_crypto_pci_info);
}
type_init(virtio_crypto_pci_register_types)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index a954799267..0fa248d68c 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1119,9 +1119,8 @@ static void virtio_9p_pci_instance_init(Object *obj)
TYPE_VIRTIO_9P);
}
-static const TypeInfo virtio_9p_pci_info = {
- .name = TYPE_VIRTIO_9P_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_9p_pci_info = {
+ .name_prefix = TYPE_VIRTIO_9P_PCI_PREFIX,
.instance_size = sizeof(V9fsPCIState),
.instance_init = virtio_9p_pci_instance_init,
.class_init = virtio_9p_pci_class_init,
@@ -1877,9 +1876,6 @@ static void virtio_pci_reset(DeviceState *qdev)
static Property virtio_pci_properties[] = {
DEFINE_PROP_BIT("virtio-pci-bus-master-bug-migration", VirtIOPCIProxy, flags,
VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT, false),
- DEFINE_PROP_ON_OFF_AUTO("disable-legacy", VirtIOPCIProxy, disable_legacy,
- ON_OFF_AUTO_AUTO),
- DEFINE_PROP_BOOL("disable-modern", VirtIOPCIProxy, disable_modern, false),
DEFINE_PROP_BIT("migrate-extra", VirtIOPCIProxy, flags,
VIRTIO_PCI_FLAG_MIGRATE_EXTRA_BIT, true),
DEFINE_PROP_BIT("modern-pio-notify", VirtIOPCIProxy, flags,
@@ -1939,13 +1935,104 @@ static const TypeInfo virtio_pci_info = {
.class_init = virtio_pci_class_init,
.class_size = sizeof(VirtioPCIClass),
.abstract = true,
- .interfaces = (InterfaceInfo[]) {
- { INTERFACE_PCIE_DEVICE },
- { INTERFACE_CONVENTIONAL_PCI_DEVICE },
- { }
- },
};
+static Property virtio_pci_generic_properties[] = {
+ DEFINE_PROP_ON_OFF_AUTO("disable-legacy", VirtIOPCIProxy, disable_legacy,
+ ON_OFF_AUTO_AUTO),
+ DEFINE_PROP_BOOL("disable-modern", VirtIOPCIProxy, disable_modern, false),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void virtio_pci_generic_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+
+ dc->props = virtio_pci_generic_properties;
+}
+
+static void virtio_pci_transitional_instance_init(Object *obj)
+{
+ VirtIOPCIProxy *proxy = VIRTIO_PCI(obj);
+
+ proxy->disable_legacy = ON_OFF_AUTO_OFF;
+ proxy->disable_modern = false;
+}
+
+static void virtio_pci_1_0_instance_init(Object *obj)
+{
+ VirtIOPCIProxy *proxy = VIRTIO_PCI(obj);
+
+ proxy->disable_legacy = ON_OFF_AUTO_ON;
+ proxy->disable_modern = false;
+}
+
+
+void virtio_pci_types_register(const VirtioPCIDeviceTypeInfo *t)
+{
+ char *base_name = g_strdup_printf("%s-base", t->name_prefix);
+ const TypeInfo base_type_info = {
+ .name = base_name,
+ .parent = t->parent ? t->parent : TYPE_VIRTIO_PCI,
+ .instance_size = t->instance_size,
+ .instance_init = t->instance_init,
+ .class_init = t->class_init,
+ .abstract = true,
+ };
+
+ const TypeInfo generic_type_info = {
+ .name = t->name_prefix,
+ .parent = base_name,
+ .class_init = virtio_pci_generic_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { INTERFACE_PCIE_DEVICE },
+ { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+ { }
+ },
+ };
+
+ type_register(&base_type_info);
+ type_register(&generic_type_info);
+
+ if (!t->modern_only) {
+ char *non_transitional_name =
+ g_strdup_printf("%s-non-transitional", t->name_prefix);
+ char *transitional_name =
+ g_strdup_printf("%s-transitional", t->name_prefix);
+ const TypeInfo non_transitional_type_info = {
+ .name = non_transitional_name,
+ .parent = base_name,
+ .instance_init = virtio_pci_1_0_instance_init,
+ .interfaces = (InterfaceInfo[]) {
+ { INTERFACE_PCIE_DEVICE },
+ { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+ { }
+ },
+ };
+ const TypeInfo transitional_type_info = {
+ .name = transitional_name,
+ .parent = base_name,
+ .instance_init = virtio_pci_transitional_instance_init,
+ .interfaces = (InterfaceInfo[]) {
+ /*
+ * Transitional virtio devices work only as Conventional PCI
+ * devices because they require PIO ports.
+ */
+ { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+ { }
+ },
+ };
+
+ type_register(&non_transitional_type_info);
+ type_register(&transitional_type_info);
+
+ g_free(non_transitional_name);
+ g_free(transitional_name);
+ }
+
+ g_free(base_name);
+}
+
/* virtio-blk-pci */
static Property virtio_blk_pci_properties[] = {
@@ -1995,9 +2082,8 @@ static void virtio_blk_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo virtio_blk_pci_info = {
- .name = TYPE_VIRTIO_BLK_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_blk_pci_info = {
+ .name_prefix = TYPE_VIRTIO_BLK_PCI_PREFIX,
.instance_size = sizeof(VirtIOBlkPCI),
.instance_init = virtio_blk_pci_instance_init,
.class_init = virtio_blk_pci_class_init,
@@ -2051,9 +2137,8 @@ static void vhost_user_blk_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo vhost_user_blk_pci_info = {
- .name = TYPE_VHOST_USER_BLK_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo vhost_user_blk_pci_info = {
+ .name_prefix = TYPE_VHOST_USER_BLK_PCI_PREFIX,
.instance_size = sizeof(VHostUserBlkPCI),
.instance_init = vhost_user_blk_pci_instance_init,
.class_init = vhost_user_blk_pci_class_init,
@@ -2119,9 +2204,8 @@ static void virtio_scsi_pci_instance_init(Object *obj)
TYPE_VIRTIO_SCSI);
}
-static const TypeInfo virtio_scsi_pci_info = {
- .name = TYPE_VIRTIO_SCSI_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_scsi_pci_info = {
+ .name_prefix = TYPE_VIRTIO_SCSI_PCI_PREFIX,
.instance_size = sizeof(VirtIOSCSIPCI),
.instance_init = virtio_scsi_pci_instance_init,
.class_init = virtio_scsi_pci_class_init,
@@ -2174,9 +2258,8 @@ static void vhost_scsi_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo vhost_scsi_pci_info = {
- .name = TYPE_VHOST_SCSI_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo vhost_scsi_pci_info = {
+ .name_prefix = TYPE_VHOST_SCSI_PCI_PREFIX,
.instance_size = sizeof(VHostSCSIPCI),
.instance_init = vhost_scsi_pci_instance_init,
.class_init = vhost_scsi_pci_class_init,
@@ -2229,9 +2312,8 @@ static void vhost_user_scsi_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo vhost_user_scsi_pci_info = {
- .name = TYPE_VHOST_USER_SCSI_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo vhost_user_scsi_pci_info = {
+ .name_prefix = TYPE_VHOST_USER_SCSI_PCI_PREFIX,
.instance_size = sizeof(VHostUserSCSIPCI),
.instance_init = vhost_user_scsi_pci_instance_init,
.class_init = vhost_user_scsi_pci_class_init,
@@ -2277,9 +2359,8 @@ static void vhost_vsock_pci_instance_init(Object *obj)
TYPE_VHOST_VSOCK);
}
-static const TypeInfo vhost_vsock_pci_info = {
- .name = TYPE_VHOST_VSOCK_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo vhost_vsock_pci_info = {
+ .name_prefix = TYPE_VHOST_VSOCK_PCI_PREFIX,
.instance_size = sizeof(VHostVSockPCI),
.instance_init = vhost_vsock_pci_instance_init,
.class_init = vhost_vsock_pci_class_init,
@@ -2334,9 +2415,8 @@ static void virtio_balloon_pci_instance_init(Object *obj)
"guest-stats-polling-interval", &error_abort);
}
-static const TypeInfo virtio_balloon_pci_info = {
- .name = TYPE_VIRTIO_BALLOON_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_balloon_pci_info = {
+ .name_prefix = TYPE_VIRTIO_BALLOON_PCI_PREFIX,
.instance_size = sizeof(VirtIOBalloonPCI),
.instance_init = virtio_balloon_pci_instance_init,
.class_init = virtio_balloon_pci_class_init,
@@ -2407,9 +2487,8 @@ static void virtio_serial_pci_instance_init(Object *obj)
TYPE_VIRTIO_SERIAL);
}
-static const TypeInfo virtio_serial_pci_info = {
- .name = TYPE_VIRTIO_SERIAL_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_serial_pci_info = {
+ .name_prefix = TYPE_VIRTIO_SERIAL_PCI_PREFIX,
.instance_size = sizeof(VirtIOSerialPCI),
.instance_init = virtio_serial_pci_instance_init,
.class_init = virtio_serial_pci_class_init,
@@ -2462,9 +2541,8 @@ static void virtio_net_pci_instance_init(Object *obj)
"bootindex", &error_abort);
}
-static const TypeInfo virtio_net_pci_info = {
- .name = TYPE_VIRTIO_NET_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_net_pci_info = {
+ .name_prefix = TYPE_VIRTIO_NET_PCI_PREFIX,
.instance_size = sizeof(VirtIONetPCI),
.instance_init = virtio_net_pci_instance_init,
.class_init = virtio_net_pci_class_init,
@@ -2513,9 +2591,8 @@ static void virtio_rng_initfn(Object *obj)
TYPE_VIRTIO_RNG);
}
-static const TypeInfo virtio_rng_pci_info = {
- .name = TYPE_VIRTIO_RNG_PCI,
- .parent = TYPE_VIRTIO_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_rng_pci_info = {
+ .name_prefix = TYPE_VIRTIO_RNG_PCI_PREFIX,
.instance_size = sizeof(VirtIORngPCI),
.instance_init = virtio_rng_initfn,
.class_init = virtio_rng_pci_class_init,
@@ -2605,25 +2682,28 @@ static const TypeInfo virtio_input_hid_pci_info = {
.abstract = true,
};
-static const TypeInfo virtio_keyboard_pci_info = {
- .name = TYPE_VIRTIO_KEYBOARD_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_keyboard_pci_info = {
+ .name_prefix = TYPE_VIRTIO_KEYBOARD_PCI,
.parent = TYPE_VIRTIO_INPUT_HID_PCI,
+ .modern_only = true,
.class_init = virtio_input_hid_kbd_pci_class_init,
.instance_size = sizeof(VirtIOInputHIDPCI),
.instance_init = virtio_keyboard_initfn,
};
-static const TypeInfo virtio_mouse_pci_info = {
- .name = TYPE_VIRTIO_MOUSE_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_mouse_pci_info = {
+ .name_prefix = TYPE_VIRTIO_MOUSE_PCI,
.parent = TYPE_VIRTIO_INPUT_HID_PCI,
+ .modern_only = true,
.class_init = virtio_input_hid_mouse_pci_class_init,
.instance_size = sizeof(VirtIOInputHIDPCI),
.instance_init = virtio_mouse_initfn,
};
-static const TypeInfo virtio_tablet_pci_info = {
- .name = TYPE_VIRTIO_TABLET_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_tablet_pci_info = {
+ .name_prefix = TYPE_VIRTIO_TABLET_PCI,
.parent = TYPE_VIRTIO_INPUT_HID_PCI,
+ .modern_only = true,
.instance_size = sizeof(VirtIOInputHIDPCI),
.instance_init = virtio_tablet_initfn,
};
@@ -2637,8 +2717,8 @@ static void virtio_host_initfn(Object *obj)
TYPE_VIRTIO_INPUT_HOST);
}
-static const TypeInfo virtio_host_pci_info = {
- .name = TYPE_VIRTIO_INPUT_HOST_PCI,
+static const VirtioPCIDeviceTypeInfo virtio_host_pci_info = {
+ .name_prefix = TYPE_VIRTIO_INPUT_HOST_PCI_PREFIX,
.parent = TYPE_VIRTIO_INPUT_PCI,
.instance_size = sizeof(VirtIOInputHostPCI),
.instance_init = virtio_host_initfn,
@@ -2692,36 +2772,39 @@ static const TypeInfo virtio_pci_bus_info = {
static void virtio_pci_register_types(void)
{
- type_register_static(&virtio_rng_pci_info);
+ /* Base types: */
+ type_register_static(&virtio_pci_bus_info);
+ type_register_static(&virtio_pci_info);
type_register_static(&virtio_input_pci_info);
type_register_static(&virtio_input_hid_pci_info);
- type_register_static(&virtio_keyboard_pci_info);
- type_register_static(&virtio_mouse_pci_info);
- type_register_static(&virtio_tablet_pci_info);
+
+ /* Implementations: */
+ virtio_pci_types_register(&virtio_rng_pci_info);
+ virtio_pci_types_register(&virtio_keyboard_pci_info);
+ virtio_pci_types_register(&virtio_mouse_pci_info);
+ virtio_pci_types_register(&virtio_tablet_pci_info);
#ifdef CONFIG_LINUX
- type_register_static(&virtio_host_pci_info);
+ virtio_pci_types_register(&virtio_host_pci_info);
#endif
- type_register_static(&virtio_pci_bus_info);
- type_register_static(&virtio_pci_info);
#ifdef CONFIG_VIRTFS
- type_register_static(&virtio_9p_pci_info);
+ virtio_pci_types_register(&virtio_9p_pci_info);
#endif
- type_register_static(&virtio_blk_pci_info);
+ virtio_pci_types_register(&virtio_blk_pci_info);
#if defined(CONFIG_VHOST_USER) && defined(CONFIG_LINUX)
- type_register_static(&vhost_user_blk_pci_info);
+ virtio_pci_types_register(&vhost_user_blk_pci_info);
#endif
- type_register_static(&virtio_scsi_pci_info);
- type_register_static(&virtio_balloon_pci_info);
- type_register_static(&virtio_serial_pci_info);
- type_register_static(&virtio_net_pci_info);
+ virtio_pci_types_register(&virtio_scsi_pci_info);
+ virtio_pci_types_register(&virtio_balloon_pci_info);
+ virtio_pci_types_register(&virtio_serial_pci_info);
+ virtio_pci_types_register(&virtio_net_pci_info);
#ifdef CONFIG_VHOST_SCSI
- type_register_static(&vhost_scsi_pci_info);
+ virtio_pci_types_register(&vhost_scsi_pci_info);
#endif
#if defined(CONFIG_VHOST_USER) && defined(CONFIG_LINUX)
- type_register_static(&vhost_user_scsi_pci_info);
+ virtio_pci_types_register(&vhost_user_scsi_pci_info);
#endif
#ifdef CONFIG_VHOST_VSOCK
- type_register_static(&vhost_vsock_pci_info);
+ virtio_pci_types_register(&vhost_vsock_pci_info);
#endif
}
diff --git a/tests/acceptance/virtio_version.py b/tests/acceptance/virtio_version.py
new file mode 100644
index 0000000000..a8d0b20b75
--- /dev/null
+++ b/tests/acceptance/virtio_version.py
@@ -0,0 +1,177 @@
+"""
+Check compatibility of virtio device types
+"""
+# Copyright (c) 2018 Red Hat, Inc.
+#
+# Author:
+# Eduardo Habkost <ehabkost(a)redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later. See the COPYING file in the top-level directory.
+import sys
+import os
+
+sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "scripts"))
+from qemu import QEMUMachine
+from avocado_qemu import Test
+
+# Virtio Device IDs:
+VIRTIO_NET = 1
+VIRTIO_BLOCK = 2
+VIRTIO_CONSOLE = 3
+VIRTIO_RNG = 4
+VIRTIO_BALLOON = 5
+VIRTIO_RPMSG = 7
+VIRTIO_SCSI = 8
+VIRTIO_9P = 9
+VIRTIO_RPROC_SERIAL = 11
+VIRTIO_CAIF = 12
+VIRTIO_GPU = 16
+VIRTIO_INPUT = 18
+VIRTIO_VSOCK = 19
+VIRTIO_CRYPTO = 20
+
+PCI_VENDOR_ID_REDHAT_QUMRANET = 0x1af4
+
+# Device IDs for legacy/transitional devices:
+PCI_LEGACY_DEVICE_IDS = {
+ VIRTIO_NET: 0x1000,
+ VIRTIO_BLOCK: 0x1001,
+ VIRTIO_BALLOON: 0x1002,
+ VIRTIO_CONSOLE: 0x1003,
+ VIRTIO_SCSI: 0x1004,
+ VIRTIO_RNG: 0x1005,
+ VIRTIO_9P: 0x1009,
+ VIRTIO_VSOCK: 0x1012,
+}
+
+def pci_modern_device_id(virtio_devid):
+ return virtio_devid + 0x1040
+
+def devtype_implements(vm, devtype, implements):
+ return devtype in [d['name'] for d in vm.command('qom-list-types', implements=implements)]
+
+def get_interfaces(vm, devtype, interfaces=['pci-express-device', 'conventional-pci-device']):
+ return [i for i in interfaces if devtype_implements(vm, devtype, i)]
+
+class VirtioVersionCheck(Test):
+ """
+ Check if virtio-version-specific device types result in the
+ same device tree created by `disable-modern` and
+ `disable-legacy`.
+
+ :avocado: enable
+ :avocado: tags=x86_64
+ """
+
+ # just in case there are failures, show larger diff:
+ maxDiff = 4096
+
+ def run_device(self, devtype, opts=None, machine='pc'):
+ """
+ Run QEMU with `-device DEVTYPE`, return device info from `query-pci`
+ """
+ with QEMUMachine(self.qemu_bin) as vm:
+ vm.set_machine(machine)
+ if opts:
+ devtype += ',' + opts
+ vm.add_args('-device', '%s,id=devfortest' % (devtype))
+ vm.add_args('-S')
+ vm.launch()
+
+ pcibuses = vm.command('query-pci')
+ alldevs = [dev for bus in pcibuses for dev in bus['devices']]
+ import pprint
+ pprint.pprint(alldevs)
+ devfortest = [dev for dev in alldevs
+ if dev['qdev_id'] == 'devfortest']
+ return devfortest[0], get_interfaces(vm, devtype)
+
+
+ def assert_devids(self, dev, devid, non_transitional=False):
+ self.assertEqual(dev['id']['vendor'], PCI_VENDOR_ID_REDHAT_QUMRANET)
+ self.assertEqual(dev['id']['device'], devid)
+ if non_transitional:
+ self.assertTrue(0x1040 <= dev['id']['device'] <= 0x107f)
+ self.assertGreaterEqual(dev['id']['subsystem'], 0x40)
+
+ def check_all_variants(self, qemu_devtype, virtio_devid):
+ """Check if a virtio device type and its variants behave as expected"""
+ # Force modern mode:
+ dev_modern,_ = self.run_device(qemu_devtype,
+ 'disable-modern=off,disable-legacy=on')
+ self.assert_devids(dev_modern, pci_modern_device_id(virtio_devid),
+ non_transitional=True)
+
+ # <prefix>-non-transitional device types should be 100% equivalent to
+ # <prefix>,disable-modern=off,disable-legacy=on
+ dev_1_0,nt_ifaces = self.run_device('%s-non-transitional' % (qemu_devtype))
+ self.assertEqual(dev_modern, dev_1_0)
+
+ # Force transitional mode:
+ dev_trans,_ = self.run_device(qemu_devtype,
+ 'disable-modern=off,disable-legacy=off')
+ self.assert_devids(dev_trans, PCI_LEGACY_DEVICE_IDS[virtio_devid])
+
+ # Force legacy mode:
+ dev_legacy,_ = self.run_device(qemu_devtype,
+ 'disable-modern=on,disable-legacy=off')
+ self.assert_devids(dev_legacy, PCI_LEGACY_DEVICE_IDS[virtio_devid])
+
+ # No options: default to transitional on PC machine-type:
+ no_opts_pc,generic_ifaces = self.run_device(qemu_devtype)
+ self.assertEqual(dev_trans, no_opts_pc)
+
+ #TODO: check if plugging on a PCI Express bus will make the
+ # device non-transitional
+ #no_opts_q35 = self.run_device(qemu_devtype, machine='q35')
+ #self.assertEqual(dev_modern, no_opts_q35)
+
+ # <prefix>-transitional device types should be 100% equivalent to
+ # <prefix>,disable-modern=off,disable-legacy=off
+ dev_trans,trans_ifaces = self.run_device('%s-transitional' % (qemu_devtype))
+ self.assertEqual(dev_trans, dev_trans)
+
+ # ensure the interface information is correct:
+ self.assertIn('conventional-pci-device', generic_ifaces)
+ self.assertIn('pci-express-device', generic_ifaces)
+
+ self.assertIn('conventional-pci-device', nt_ifaces)
+ self.assertIn('pci-express-device', nt_ifaces)
+
+ self.assertIn('conventional-pci-device', trans_ifaces)
+ self.assertNotIn('pci-express-device', trans_ifaces)
+
+
+ def test_conventional_devs(self):
+ self.check_all_variants('virtio-net-pci', VIRTIO_NET)
+ # virtio-blk requires 'driver' parameter
+ #self.check_all_variants('virtio-blk-pci', VIRTIO_BLOCK)
+ self.check_all_variants('virtio-serial-pci', VIRTIO_CONSOLE)
+ self.check_all_variants('virtio-rng-pci', VIRTIO_RNG)
+ self.check_all_variants('virtio-balloon-pci', VIRTIO_BALLOON)
+ self.check_all_variants('virtio-scsi-pci', VIRTIO_SCSI)
+ # virtio-9p requires 'fsdev' parameter
+ #self.check_all_variants('virtio-9p-pci', VIRTIO_9P)
+
+ def check_modern_only(self, qemu_devtype, virtio_devid):
+ """Check if a modern-only virtio device type behaves as expected"""
+ # Force modern mode:
+ dev_modern,_ = self.run_device(qemu_devtype,
+ 'disable-modern=off,disable-legacy=on')
+ self.assert_devids(dev_modern, pci_modern_device_id(virtio_devid),
+ non_transitional=True)
+
+ # No options: should be modern anyway
+ dev_no_opts,ifaces = self.run_device(qemu_devtype)
+ self.assertEqual(dev_modern, dev_no_opts)
+
+ self.assertIn('conventional-pci-device', ifaces)
+ self.assertIn('pci-express-device', ifaces)
+
+ def test_modern_only_devs(self):
+ self.check_modern_only('virtio-vga', VIRTIO_GPU)
+ self.check_modern_only('virtio-gpu-pci', VIRTIO_GPU)
+ self.check_modern_only('virtio-mouse-pci', VIRTIO_INPUT)
+ self.check_modern_only('virtio-tablet-pci', VIRTIO_INPUT)
+ self.check_modern_only('virtio-keyboard-pci', VIRTIO_INPUT)
--
2.18.0.rc1.1.g3f1ff2140
5 years, 12 months
[libvirt] [PATCH v5 0/6] libxl: PVHv2 support
by Marek Marczykowski-Górecki
This is a respin of my old PVHv1 patch[1], converted to PVHv2. The actual code
use "PVH" name.
It introduce new guest ostype VIR_DOMAIN_OSTYPE_XENPVH, and also PVH machine,
machine="xenpvh" attribute is used.
Since PVHv2 relies on features in newer Xen versions, I needed to convert also
some older code. For example b_info->u.hvm.nested_hvm was deprecated in favor
of b_info->nested_hvm. While the code do handle both old and new versions
(obviously refusing PVHv2 if Xen is too old), this isn't the case for tests.
How it should be handled, if at all?
To test this with all supported Xen versions (4.6, 4.7, 4.8, 4.9, 4.10, 4.11,
unstable), I've extended travis configuration for that[2]. It isn't exactly
trivial to build Xen 4.6-4.8 on recent system, mostly thanks to -Werror and new
warnings, but also other toolchain changes. Because of this, the configuration
is rather hacky. But it may be a good idea to include multiple pre-built Xen
versions in the base docker image and choose one using ./configure options (maybe
together with some symlink or environment variable like PKG_CONFIG_PATH).
[1] https://www.redhat.com/archives/libvir-list/2016-August/msg00376.html
[2] https://github.com/marmarek/libvirt/tree/travis-xen-pvh
Changes in v2:
- drop "docs: don't refer to deprecated 'linux' ostype in example" patch -
migrating further away from "linux" os type is offtopic to this series and
apparently is a controversial thing
- drop "docs: update domain schema for machine attribute" patch -
already applied
- apply review comments from Jim
- rebase on master
Changes in v3:
- rebase on master, drop already applied patches
- use #ifdef LIBXL_DOMAIN_TYPE_PVH to detect PVH support, fix compilation
failure on older Xen
- exclude PVH from VIR_DOMAIN_OSTYPE_XEN <-> VIR_DOMAIN_OSTYPE_LINUX conversion
- fix reported capabilities for PVH
Changes in v4:
- change PVH support detection method
Changes in v5:
- use VIR_DOMAIN_OSTYPE_XENPVH
- add news entry
Marek Marczykowski-Górecki (6):
libxl: reorder libxlMakeDomBuildInfo for upcoming PVH support
libxl: add support for PVH
tests: add basic Xen PVH test
xenconfig: add support for parsing type= xl config entry
xenconfig: add support for type="pvh"
news: add libxl PVH
docs/formatcaps.html.in | 9 ++-
docs/news.xml | 8 ++-
docs/schemas/domaincommon.rng | 2 +-
m4/virt-driver-libxl.m4 | 3 +-
src/conf/domain_conf.c | 10 ++-
src/conf/domain_conf.h | 1 +-
src/libxl/libxl_capabilities.c | 38 +++++++++--
src/libxl/libxl_conf.c | 78 ++++++++++++++++------
src/libxl/libxl_driver.c | 6 +-
src/xenconfig/xen_common.c | 25 +++++--
src/xenconfig/xen_xl.c | 5 +-
tests/libxlxml2domconfigdata/basic-pvh.json | 49 ++++++++++++++-
tests/libxlxml2domconfigdata/basic-pvh.xml | 28 ++++++++-
tests/libxlxml2domconfigtest.c | 3 +-
tests/testutilsxen.c | 20 +++++-
tests/xlconfigdata/test-fullvirt-type.cfg | 21 ++++++-
tests/xlconfigdata/test-fullvirt-type.xml | 27 ++++++++-
tests/xlconfigdata/test-paravirt-type.cfg | 13 ++++-
tests/xlconfigdata/test-paravirt-type.xml | 25 +++++++-
tests/xlconfigdata/test-pvh-type.cfg | 13 ++++-
tests/xlconfigdata/test-pvh-type.xml | 25 +++++++-
tests/xlconfigtest.c | 3 +-
22 files changed, 375 insertions(+), 37 deletions(-)
create mode 100644 tests/libxlxml2domconfigdata/basic-pvh.json
create mode 100644 tests/libxlxml2domconfigdata/basic-pvh.xml
create mode 100644 tests/xlconfigdata/test-fullvirt-type.cfg
create mode 100644 tests/xlconfigdata/test-fullvirt-type.xml
create mode 100644 tests/xlconfigdata/test-paravirt-type.cfg
create mode 100644 tests/xlconfigdata/test-paravirt-type.xml
create mode 100644 tests/xlconfigdata/test-pvh-type.cfg
create mode 100644 tests/xlconfigdata/test-pvh-type.xml
base-commit: 794af564f4c96044b935ab898acc8e61a58b6bb5
--
git-series 0.9.1
5 years, 12 months
[libvirt] Next releases plans
by Daniel Veillard
It's already the end of the month, if we want to get a release out say
next Monday, I suggest to enter freeze sometime tomorrow (Tuesday), then
plan for RC2 around Thursday, and then the release can happen over the
week-end of next Monday. I hope this work if needed we can push everything
by 1 day if there is too much in the pipe.
Please note that as usual the best for end of year is to plan the following
release 5.0.0 around mid January and then 5.1.0 at the end of Feb to account
for slowdown around end of year and the short month of February.
Hopefully that works for everybody !
Daniel
--
Daniel Veillard | Red Hat Developers Tools http://developer.redhat.com/
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
5 years, 12 months
Re: [libvirt] [PATCH] qemu: handle multicast overflow on macvtap for NIC_RX_FILTER_CHANGED
by Michal Privoznik
On 11/26/18 5:10 PM, Michal Privoznik wrote:
> On 11/21/18 4:04 PM, Jason Baron wrote:
>> Guest network devices can set 'overflow' when there are a number of multicast
>> ips configured. For virtio_net, the limit is only 64. In this case, the list
>> of mac addresses is empty and the 'overflow' condition is set. Thus, the guest
>> will currently receive no multicast traffic in this state.
>>
>> When 'overflow' is set in the guest, let's turn this into ALLMULTI on the host.
>>
>> Signed-off-by: Jason Baron <jbaron(a)akamai.com>
>> ---
>> src/qemu/qemu_driver.c | 26 +++++++++++++++++++-------
>> 1 file changed, 19 insertions(+), 7 deletions(-)
>>
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 7fb9102..ea36db8 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -4443,11 +4443,11 @@ static void
>> syncNicRxFilterMultiMode(char *ifname, virNetDevRxFilterPtr guestFilter,
>> virNetDevRxFilterPtr hostFilter)
>> {
>> - if (hostFilter->multicast.mode != guestFilter->multicast.mode) {
>> + if (hostFilter->multicast.mode != guestFilter->multicast.mode ||
>> + guestFilter->multicast.overflow) {
>> switch (guestFilter->multicast.mode) {
>> case VIR_NETDEV_RX_FILTER_MODE_ALL:
>> if (virNetDevSetRcvAllMulti(ifname, true)) {
>> -
>> VIR_WARN("Couldn't set allmulticast flag to 'on' for "
>> "device %s while responding to "
>> "NIC_RX_FILTER_CHANGED", ifname);
>> @@ -4455,17 +4455,29 @@ syncNicRxFilterMultiMode(char *ifname, virNetDevRxFilterPtr guestFilter,
>> break;
>>
>> case VIR_NETDEV_RX_FILTER_MODE_NORMAL:
>> - if (virNetDevSetRcvMulti(ifname, true)) {
>> + if (guestFilter->multicast.overflow &&
>> + (hostFilter->multicast.mode == VIR_NETDEV_RX_FILTER_MODE_ALL)) {
>> + break;
>> + }
>>
>> + if (virNetDevSetRcvMulti(ifname, true)) {
Ah, please do proper error check: if (func() < 0) { ... }.
>> VIR_WARN("Couldn't set multicast flag to 'on' for "
>> "device %s while responding to "
>> "NIC_RX_FILTER_CHANGED", ifname);
>> }
>>
>> - if (virNetDevSetRcvAllMulti(ifname, false)) {
>> - VIR_WARN("Couldn't set allmulticast flag to 'off' for "
>> - "device %s while responding to "
>> - "NIC_RX_FILTER_CHANGED", ifname);
>> + if (guestFilter->multicast.overflow == true) {
>> + if (virNetDevSetRcvAllMulti(ifname, true)) {
>> + VIR_WARN("Couldn't set allmulticast flag to 'on' for "
>> + "device %s while responding to "
>> + "NIC_RX_FILTER_CHANGED", ifname);
>> + }
>> + } else {
>> + if (virNetDevSetRcvAllMulti(ifname, false)) {
>> + VIR_WARN("Couldn't set allmulticast flag to 'off' for "
>> + "device %s while responding to "
>> + "NIC_RX_FILTER_CHANGED", ifname);
I wonder if we can do something like:
if (virNetDevSetRcvAllMulti(ifname,
guestFilter->multicast.overflow) < 0) {
VIR_WARN("Couldn't set allmulticast flag to '%s' for "
"device %s while responding to "
"NIC_RX_FILTER_CHANGED",
virTristateSwitchTypeToString(virTristateSwitchFromBool(guestFilter->multicast.overflow)),
ifname);
}
Otherwise looking good.
Michal
5 years, 12 months
[libvirt] OBFrom 2ca6bb41cd7d86a89ac565ca71ba1f2baffd0c68 Mon Sep 17 00:00:00 2001
by Marc Hartmayer
The test driver state (@testDriver) uses it's own reference counting
and locking implementation. Instead of doing that, convert @testDriver
into a virObjectLockable and use the provided functionalities.
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
---
This patch was originally posted with the patch series "[libvirt]
[PATCH libvirt v2 0/9] Fix virConnectRegisterCloseCallback and get rid
of global variables"
(mid:20180412124104.10547-1-mhartmay@linux.vnet.ibm.com).
I dropped the r-b from John because so much time has passed.
---
src/test/test_driver.c | 198 ++++++++++++++++++-----------------------
1 file changed, 87 insertions(+), 111 deletions(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 31d0da744ce5..b76f0b718ecd 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -92,7 +92,7 @@ typedef struct _testAuth testAuth;
typedef struct _testAuth *testAuthPtr;
struct _testDriver {
- virMutex lock;
+ virObjectLockable parent;
virNodeInfo nodeInfo;
virInterfaceObjListPtr ifaces;
@@ -124,9 +124,19 @@ typedef struct _testDriver testDriver;
typedef testDriver *testDriverPtr;
static testDriverPtr defaultPrivconn;
-static int defaultConnections;
static virMutex defaultLock = VIR_MUTEX_INITIALIZER;
+static virClassPtr testDriverClass;
+static void testDriverDispose(void *obj);
+static int testDriverOnceInit(void)
+{
+ if (!(VIR_CLASS_NEW(testDriver, virClassForObjectLockable())))
+ return -1;
+
+ return 0;
+}
+VIR_ONCE_GLOBAL_INIT(testDriver)
+
#define TEST_MODEL "i686"
#define TEST_EMULATOR "/usr/bin/test-hv"
@@ -142,10 +152,9 @@ static const virNodeInfo defaultNodeInfo = {
};
static void
-testDriverFree(testDriverPtr driver)
+testDriverDispose(void *obj)
{
- if (!driver)
- return;
+ testDriverPtr driver = obj;
virObjectUnref(driver->caps);
virObjectUnref(driver->xmlopt);
@@ -155,21 +164,6 @@ testDriverFree(testDriverPtr driver)
virObjectUnref(driver->ifaces);
virObjectUnref(driver->pools);
virObjectUnref(driver->eventState);
- virMutexUnlock(&driver->lock);
- virMutexDestroy(&driver->lock);
-
- VIR_FREE(driver);
-}
-
-
-static void testDriverLock(testDriverPtr driver)
-{
- virMutexLock(&driver->lock);
-}
-
-static void testDriverUnlock(testDriverPtr driver)
-{
- virMutexUnlock(&driver->lock);
}
#define TEST_NAMESPACE_HREF "http://libvirt.org/schemas/domain/test/1.0"
@@ -401,14 +395,11 @@ testDriverNew(void)
};
testDriverPtr ret;
- if (VIR_ALLOC(ret) < 0)
+ if (testDriverInitialize() < 0)
return NULL;
- if (virMutexInit(&ret->lock) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot initialize mutex"));
- goto error;
- }
+ if (!(ret = virObjectLockableNew(testDriverClass)))
+ return NULL;
if (!(ret->xmlopt = virDomainXMLOptionNew(NULL, NULL, &ns, NULL, NULL)) ||
!(ret->eventState = virObjectEventStateNew()) ||
@@ -424,7 +415,7 @@ testDriverNew(void)
return ret;
error:
- testDriverFree(ret);
+ virObjectUnref(ret);
return NULL;
}
@@ -1256,7 +1247,7 @@ testOpenFromFile(virConnectPtr conn, const char *file)
if (!(privconn = testDriverNew()))
return VIR_DRV_OPEN_ERROR;
- testDriverLock(privconn);
+ virObjectLock(privconn);
conn->privateData = privconn;
if (!(privconn->caps = testBuildCapabilities(conn)))
@@ -1273,14 +1264,14 @@ testOpenFromFile(virConnectPtr conn, const char *file)
xmlXPathFreeContext(ctxt);
xmlFreeDoc(doc);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return VIR_DRV_OPEN_SUCCESS;
error:
xmlXPathFreeContext(ctxt);
xmlFreeDoc(doc);
- testDriverFree(privconn);
+ virObjectUnref(privconn);
conn->privateData = NULL;
return VIR_DRV_OPEN_ERROR;
}
@@ -1298,8 +1289,8 @@ testOpenDefault(virConnectPtr conn)
size_t i;
virMutexLock(&defaultLock);
- if (defaultConnections++) {
- conn->privateData = defaultPrivconn;
+ if (defaultPrivconn) {
+ conn->privateData = virObjectRef(defaultPrivconn);
virMutexUnlock(&defaultLock);
return VIR_DRV_OPEN_SUCCESS;
}
@@ -1348,9 +1339,8 @@ testOpenDefault(virConnectPtr conn)
return ret;
error:
- testDriverFree(privconn);
+ virObjectUnref(privconn);
conn->privateData = NULL;
- defaultConnections--;
goto cleanup;
}
@@ -1363,9 +1353,9 @@ testConnectAuthenticate(virConnectPtr conn,
ssize_t i;
char *username = NULL, *password = NULL;
- testDriverLock(privconn);
+ virObjectLock(privconn);
if (privconn->numAuths == 0) {
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return 0;
}
@@ -1400,7 +1390,7 @@ testConnectAuthenticate(virConnectPtr conn,
ret = 0;
cleanup:
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
VIR_FREE(username);
VIR_FREE(password);
return ret;
@@ -1410,24 +1400,11 @@ testConnectAuthenticate(virConnectPtr conn,
static void
testDriverCloseInternal(testDriverPtr driver)
{
- bool dflt = false;
-
- if (driver == defaultPrivconn) {
- dflt = true;
- virMutexLock(&defaultLock);
- if (--defaultConnections) {
- virMutexUnlock(&defaultLock);
- return;
- }
- }
-
- testDriverLock(driver);
- testDriverFree(driver);
-
- if (dflt) {
+ virMutexLock(&defaultLock);
+ bool disposed = !virObjectUnref(driver);
+ if (disposed && driver == defaultPrivconn)
defaultPrivconn = NULL;
- virMutexUnlock(&defaultLock);
- }
+ virMutexUnlock(&defaultLock);
}
@@ -1546,9 +1523,9 @@ static int testNodeGetInfo(virConnectPtr conn,
virNodeInfoPtr info)
{
testDriverPtr privconn = conn->privateData;
- testDriverLock(privconn);
+ virObjectLock(privconn);
memcpy(info, &privconn->nodeInfo, sizeof(virNodeInfo));
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return 0;
}
@@ -1556,9 +1533,9 @@ static char *testConnectGetCapabilities(virConnectPtr conn)
{
testDriverPtr privconn = conn->privateData;
char *xml;
- testDriverLock(privconn);
+ virObjectLock(privconn);
xml = virCapabilitiesFormatXML(privconn->caps);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return xml;
}
@@ -1593,9 +1570,9 @@ static int testConnectNumOfDomains(virConnectPtr conn)
testDriverPtr privconn = conn->privateData;
int count;
- testDriverLock(privconn);
+ virObjectLock(privconn);
count = virDomainObjListNumOfDomains(privconn->domains, true, NULL, NULL);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return count;
}
@@ -1648,7 +1625,7 @@ testDomainCreateXML(virConnectPtr conn, const char *xml,
if (flags & VIR_DOMAIN_START_VALIDATE)
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
- testDriverLock(privconn);
+ virObjectLock(privconn);
if ((def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;
@@ -1680,7 +1657,7 @@ testDomainCreateXML(virConnectPtr conn, const char *xml,
virDomainObjEndAPI(&dom);
virObjectEventStateQueue(privconn->eventState, event);
virDomainDefFree(def);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ret;
}
@@ -2842,7 +2819,7 @@ static int testNodeGetCellsFreeMemory(virConnectPtr conn,
size_t i;
int ret = -1;
- testDriverLock(privconn);
+ virObjectLock(privconn);
if (startCell >= privconn->numCells) {
virReportError(VIR_ERR_INVALID_ARG,
"%s", _("Range exceeds available cells"));
@@ -2857,7 +2834,7 @@ static int testNodeGetCellsFreeMemory(virConnectPtr conn,
ret = i;
cleanup:
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ret;
}
@@ -2915,12 +2892,12 @@ testNodeGetFreeMemory(virConnectPtr conn)
unsigned int freeMem = 0;
size_t i;
- testDriverLock(privconn);
+ virObjectLock(privconn);
for (i = 0; i < privconn->numCells; i++)
freeMem += privconn->cells[i].freeMem;
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return freeMem;
}
@@ -2957,7 +2934,7 @@ static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
virCheckFlags(0, -1);
- testDriverLock(privconn);
+ virObjectLock(privconn);
if (!(privdom = testDomObjFromDomain(domain)))
goto cleanup;
@@ -2981,7 +2958,7 @@ static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
cleanup:
virDomainObjEndAPI(&privdom);
virObjectEventStateQueue(privconn->eventState, event);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ret;
}
@@ -3746,9 +3723,9 @@ testInterfaceObjFindByName(testDriverPtr privconn,
{
virInterfaceObjPtr obj;
- testDriverLock(privconn);
+ virObjectLock(privconn);
obj = virInterfaceObjListFindByName(privconn->ifaces, name);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
if (!obj)
virReportError(VIR_ERR_NO_INTERFACE,
@@ -3765,9 +3742,9 @@ testConnectNumOfInterfaces(virConnectPtr conn)
testDriverPtr privconn = conn->privateData;
int ninterfaces;
- testDriverLock(privconn);
+ virObjectLock(privconn);
ninterfaces = virInterfaceObjListNumOfInterfaces(privconn->ifaces, true);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ninterfaces;
}
@@ -3780,10 +3757,10 @@ testConnectListInterfaces(virConnectPtr conn,
testDriverPtr privconn = conn->privateData;
int nnames;
- testDriverLock(privconn);
+ virObjectLock(privconn);
nnames = virInterfaceObjListGetNames(privconn->ifaces, true,
names, maxnames);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return nnames;
}
@@ -3795,9 +3772,9 @@ testConnectNumOfDefinedInterfaces(virConnectPtr conn)
testDriverPtr privconn = conn->privateData;
int ninterfaces;
- testDriverLock(privconn);
+ virObjectLock(privconn);
ninterfaces = virInterfaceObjListNumOfInterfaces(privconn->ifaces, false);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ninterfaces;
}
@@ -3810,10 +3787,10 @@ testConnectListDefinedInterfaces(virConnectPtr conn,
testDriverPtr privconn = conn->privateData;
int nnames;
- testDriverLock(privconn);
+ virObjectLock(privconn);
nnames = virInterfaceObjListGetNames(privconn->ifaces, false,
names, maxnames);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return nnames;
}
@@ -3862,10 +3839,10 @@ testInterfaceLookupByMACString(virConnectPtr conn,
char *ifacenames[] = { NULL, NULL };
virInterfacePtr ret = NULL;
- testDriverLock(privconn);
+ virObjectLock(privconn);
ifacect = virInterfaceObjListFindByMACString(privconn->ifaces, mac,
ifacenames, 2);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
if (ifacect == 0) {
virReportError(VIR_ERR_NO_INTERFACE,
@@ -3913,7 +3890,7 @@ testInterfaceChangeBegin(virConnectPtr conn,
virCheckFlags(0, -1);
- testDriverLock(privconn);
+ virObjectLock(privconn);
if (privconn->transaction_running) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("there is another transaction running."));
@@ -3927,7 +3904,7 @@ testInterfaceChangeBegin(virConnectPtr conn,
ret = 0;
cleanup:
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ret;
}
@@ -3941,7 +3918,7 @@ testInterfaceChangeCommit(virConnectPtr conn,
virCheckFlags(0, -1);
- testDriverLock(privconn);
+ virObjectLock(privconn);
if (!privconn->transaction_running) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
@@ -3956,7 +3933,7 @@ testInterfaceChangeCommit(virConnectPtr conn,
ret = 0;
cleanup:
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ret;
}
@@ -3971,7 +3948,7 @@ testInterfaceChangeRollback(virConnectPtr conn,
virCheckFlags(0, -1);
- testDriverLock(privconn);
+ virObjectLock(privconn);
if (!privconn->transaction_running) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
@@ -3989,7 +3966,7 @@ testInterfaceChangeRollback(virConnectPtr conn,
ret = 0;
cleanup:
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ret;
}
@@ -4029,7 +4006,7 @@ testInterfaceDefineXML(virConnectPtr conn,
virCheckFlags(0, NULL);
- testDriverLock(privconn);
+ virObjectLock(privconn);
if ((def = virInterfaceDefParseString(xmlStr)) == NULL)
goto cleanup;
@@ -4043,7 +4020,7 @@ testInterfaceDefineXML(virConnectPtr conn,
cleanup:
virInterfaceDefFree(def);
virInterfaceObjEndAPI(&obj);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ret;
}
@@ -4147,9 +4124,9 @@ testStoragePoolObjFindByName(testDriverPtr privconn,
{
virStoragePoolObjPtr obj;
- testDriverLock(privconn);
+ virObjectLock(privconn);
obj = virStoragePoolObjFindByName(privconn->pools, name);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
if (!obj)
virReportError(VIR_ERR_NO_STORAGE_POOL,
@@ -4207,9 +4184,9 @@ testStoragePoolObjFindByUUID(testDriverPtr privconn,
virStoragePoolObjPtr obj;
char uuidstr[VIR_UUID_STRING_BUFLEN];
- testDriverLock(privconn);
+ virObjectLock(privconn);
obj = virStoragePoolObjFindByUUID(privconn->pools, uuid);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
if (!obj) {
virUUIDFormat(uuid, uuidstr);
@@ -4275,10 +4252,10 @@ testConnectNumOfStoragePools(virConnectPtr conn)
testDriverPtr privconn = conn->privateData;
int numActive = 0;
- testDriverLock(privconn);
+ virObjectLock(privconn);
numActive = virStoragePoolObjNumOfStoragePools(privconn->pools, conn,
true, NULL);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return numActive;
}
@@ -4292,10 +4269,10 @@ testConnectListStoragePools(virConnectPtr conn,
testDriverPtr privconn = conn->privateData;
int n = 0;
- testDriverLock(privconn);
+ virObjectLock(privconn);
n = virStoragePoolObjGetNames(privconn->pools, conn, true, NULL,
names, maxnames);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return n;
}
@@ -4307,10 +4284,10 @@ testConnectNumOfDefinedStoragePools(virConnectPtr conn)
testDriverPtr privconn = conn->privateData;
int numInactive = 0;
- testDriverLock(privconn);
+ virObjectLock(privconn);
numInactive = virStoragePoolObjNumOfStoragePools(privconn->pools, conn,
false, NULL);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return numInactive;
}
@@ -4324,10 +4301,10 @@ testConnectListDefinedStoragePools(virConnectPtr conn,
testDriverPtr privconn = conn->privateData;
int n = 0;
- testDriverLock(privconn);
+ virObjectLock(privconn);
n = virStoragePoolObjGetNames(privconn->pools, conn, false, NULL,
names, maxnames);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return n;
}
@@ -4343,10 +4320,10 @@ testConnectListAllStoragePools(virConnectPtr conn,
virCheckFlags(VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL, -1);
- testDriverLock(privconn);
+ virObjectLock(privconn);
ret = virStoragePoolObjListExport(conn, privconn->pools, pools,
NULL, flags);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return ret;
}
@@ -4508,7 +4485,7 @@ testStoragePoolCreateXML(virConnectPtr conn,
virCheckFlags(0, NULL);
- testDriverLock(privconn);
+ virObjectLock(privconn);
if (!(newDef = virStoragePoolDefParseString(xml)))
goto cleanup;
@@ -4556,7 +4533,7 @@ testStoragePoolCreateXML(virConnectPtr conn,
virStoragePoolDefFree(newDef);
virObjectEventStateQueue(privconn->eventState, event);
virStoragePoolObjEndAPI(&obj);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return pool;
}
@@ -4575,7 +4552,7 @@ testStoragePoolDefineXML(virConnectPtr conn,
virCheckFlags(0, NULL);
- testDriverLock(privconn);
+ virObjectLock(privconn);
if (!(newDef = virStoragePoolDefParseString(xml)))
goto cleanup;
@@ -4605,7 +4582,7 @@ testStoragePoolDefineXML(virConnectPtr conn,
virStoragePoolDefFree(newDef);
virObjectEventStateQueue(privconn->eventState, event);
virStoragePoolObjEndAPI(&obj);
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
return pool;
}
@@ -5006,7 +4983,7 @@ testStorageVolLookupByKey(virConnectPtr conn,
.key = key, .voldef = NULL };
virStorageVolPtr vol = NULL;
- testDriverLock(privconn);
+ virObjectLock(privconn);
if ((obj = virStoragePoolObjListSearch(privconn->pools,
testStorageVolLookupByKeyCallback,
&data)) && data.voldef) {
@@ -5016,7 +4993,7 @@ testStorageVolLookupByKey(virConnectPtr conn,
NULL, NULL);
virStoragePoolObjEndAPI(&obj);
}
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
if (!vol)
virReportError(VIR_ERR_NO_STORAGE_VOL,
@@ -5050,7 +5027,7 @@ testStorageVolLookupByPath(virConnectPtr conn,
.path = path, .voldef = NULL };
virStorageVolPtr vol = NULL;
- testDriverLock(privconn);
+ virObjectLock(privconn);
if ((obj = virStoragePoolObjListSearch(privconn->pools,
testStorageVolLookupByPathCallback,
&data)) && data.voldef) {
@@ -5060,7 +5037,7 @@ testStorageVolLookupByPath(virConnectPtr conn,
NULL, NULL);
virStoragePoolObjEndAPI(&obj);
}
- testDriverUnlock(privconn);
+ virObjectUnlock(privconn);
if (!vol)
virReportError(VIR_ERR_NO_STORAGE_VOL,
@@ -6819,7 +6796,6 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
}
-
static virHypervisorDriver testHypervisorDriver = {
.name = "Test",
.connectOpen = testConnectOpen, /* 0.1.1 */
--
2.17.0
5 years, 12 months
[libvirt] Information sent in libvirt during the sasl usage and tls
by Anastasiya Ruzhanskaya
Hello everyone!
I am trying without any success to decipher traffic from client to server
in virt-manager in wireshark, but I don't know the sessioon key there, so
seems no chance to do this.
This is why I want to ask, is any info related to the certificate sent
through the connection? Or if I use kerberos protocol for authentication,
will the user id be sent in every message from client to server? Or only
during authentication?
5 years, 12 months
[libvirt] [PATCH libvirt-python] Add daemon to list of shutdown reasons
by Philipp Hahn
Add the support to work with libvirt commit 66a85cb13.
Signed-off-by: Philipp Hahn <hahn(a)univention.de>
---
examples/event-test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/event-test.py b/examples/event-test.py
index 709277b..81ebfc1 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -489,7 +489,7 @@ DOM_EVENTS = Description(
("Started", ("Booted", "Migrated", "Restored", "Snapshot", "Wakeup")),
("Suspended", ("Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot", "API error", "Postcopy", "Postcopy failed")),
("Resumed", ("Unpaused", "Migrated", "Snapshot", "Postcopy")),
- ("Stopped", ("Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot")),
+ ("Stopped", ("Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot", "Daemon")),
("Shutdown", ("Finished", "On guest request", "On host request")),
("PMSuspended", ("Memory", "Disk")),
("Crashed", ("Panicked",)),
--
2.11.0
5 years, 12 months
[libvirt] Why "integratorcp" as the default machine type for ARM / AArch64?
by Kashyap Chamarthy
Hi
I see in the following change, Dan added the default machine types for
all architectures:
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=26cfb1a3
("qemu: ensure default machine types don't change if QEMU changes")
What caught my eye was the default machine type chosen ("integratorcp")
for ARM / AAarch64:
+ [VIR_ARCH_ARMV7L] = "integratorcp",
+ [VIR_ARCH_ARMV7B] = "integratorcp",
+
+ [VIR_ARCH_AARCH64] = "integratorcp",
I thought the default for AArch64 / ARM would be 'virt'---as I learnt
that upstream QEMU explicitly designed the 'virt' board for ARM /
AArch64-based machine machines (because it supports PCI, 'virtio', has
decent RAM limits, etc.)
So, shouldn't the default for the above be changed from "integratorcp"
to "virt"?
PS: I thought "integratorcp" board was picked as it was probably the
first entry when you run `qemu-system-aarch64 -machine help`, but
that wasn't the case on my Fedora-28 machine---it was the 12th
entry.
--
/kashyap
5 years, 12 months