[libvirt] [PATCH] report invalid x86 cpu map error
by zhenwei pi
Let libvirtd handle invalid x86 cpu map error, and report the real reason.
This issue can be reproduced :
1, rm -rf /share/libvirt/cpu_map
2, start libvirtd
3, virsh create INSTANCE.xml
Libvirtd reports error :
error: invalid argument: Failed to parse group 'tss'
In face, libvirtd gets invalid cpu map.
With this patch, libvirtd reports error :
error: unsupported configuration: invalid x86 cpu map
Signed-off-by: zhenwei pi <pizhenwei(a)bytedance.com>
---
src/cpu/cpu_x86.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index d3a88da21d..91419d91d4 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -2902,8 +2902,11 @@ virCPUx86ValidateFeatures(virCPUDefPtr cpu)
virCPUx86MapPtr map;
size_t i;
- if (!(map = virCPUx86GetMap()))
+ if (!(map = virCPUx86GetMap())) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("invalid x86 cpu map"));
return -1;
+ }
for (i = 0; i < cpu->nfeatures; i++) {
if (!x86FeatureFind(map, cpu->features[i].name)) {
--
2.11.0
5 years, 10 months
[libvirt] [jenkins-ci PATCH] guests: Install dbus-daemon for libvirt-dbus
by Andrea Bolognani
Apparently it's not part of the base system in current
Fedora Rawhide, leading to failures in the test suite. Drag
it in explicitly to ensure tests pass.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/vars/mappings.yml | 5 +++++
guests/vars/projects/libvirt-dbus.yml | 1 +
2 files changed, 6 insertions(+)
diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index b160c50..238ae88 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -79,6 +79,11 @@ mappings:
pkg: cyrus-sasl
rpm: cyrus-sasl-devel
+ dbus-daemon:
+ default: dbus
+ Fedora: dbus-daemon
+ Fedora28: dbus
+
device-mapper:
deb: libdevmapper-dev
rpm: device-mapper-devel
diff --git a/guests/vars/projects/libvirt-dbus.yml b/guests/vars/projects/libvirt-dbus.yml
index 22052de..ce902cb 100644
--- a/guests/vars/projects/libvirt-dbus.yml
+++ b/guests/vars/projects/libvirt-dbus.yml
@@ -1,5 +1,6 @@
---
packages:
+ - dbus-daemon
- flake8
- glib2
- python3
--
2.20.1
5 years, 10 months
[libvirt] [PATCH] virnetdevip: Avoid cast align warning
by Ján Tomko
Commit 7282f455a got rid of the VIR_WARNINGS_NO_CAST_ALIGN macro
when refactoring the code and broke the build with clang.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as a build breaker fix.
src/util/virnetdevip.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index b6df422cd1..f39467f1d6 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -599,7 +599,9 @@ virNetDevIPCheckIPv6ForwardingCallback(struct nlmsghdr *resp,
data->hasRARoutes = true;
len -= NLMSG_ALIGN(nh->rtnh_len);
+ VIR_WARNINGS_NO_CAST_ALIGN
nh = RTNH_NEXT(nh);
+ VIR_WARNINGS_RESET
}
}
--
2.16.4
5 years, 10 months
[libvirt] [PATCH] news: Update for 5.0.0 release
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
docs/news.xml | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 90b7e8891e..324b267656 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -45,6 +45,16 @@
trunking configuration.
</description>
</change>
+ <change>
+ <summary>
+ qemu: Report whether KVM nesting is available
+ </summary>
+ <description>
+ Running nested KVM guests requires specific configuration steps to
+ be performed on the host; libvirt will now report in the host
+ capabilities whether KVM nesting support is available.
+ </description>
+ </change>
</section>
<section title="Removed features">
<change>
@@ -99,6 +109,17 @@
sibling Hyperthread.
</description>
</change>
+ <change>
+ <summary>
+ libxl: Handle external domain destroy
+ </summary>
+ <description>
+ Historically, if a domain was destroyed using <code>xl</code>
+ rather than through libvirt APIs, libvirt would not be aware of
+ the fact and keep considering it as running. This is no longer the
+ case.
+ </description>
+ </change>
<change>
<summary>
Start selecting the first available DRI device for OpenGL operations
@@ -123,6 +144,23 @@
</change>
</section>
<section title="Bug fixes">
+ <change>
+ <summary>
+ lxc: Don't forbid interfaces with type=direct
+ </summary>
+ <description>
+ Such interfaces are supported by lxc and should be allowed.
+ </description>
+ </change>
+ <change>
+ <summary>
+ qemu: Fully clean up RNG devices on detach
+ </summary>
+ <description>
+ Some RNG device types, such as those using EGD, might need extra
+ clean up on the host in addition to removing the guest-side device.
+ </description>
+ </change>
</section>
</release>
<release version="v4.10.0" date="2018-12-03">
--
2.20.1
5 years, 10 months
[libvirt] [PATCH for 5.0.0] qemu: Temporary disable owner remembering
by Michal Privoznik
Turns out, that there are few bugs that are not that trivial to
fix (e.g. around block jobs). Instead of rushing in not
thoroughly tested fixes disable the feature temporarily for the
release.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/news.xml | 13 -------------
src/qemu/libvirtd_qemu.aug | 1 -
src/qemu/qemu.conf | 5 -----
src/qemu/qemu_conf.c | 4 ----
src/qemu/test_libvirtd_qemu.aug.in | 1 -
5 files changed, 24 deletions(-)
diff --git a/docs/news.xml b/docs/news.xml
index 90b7e8891e..c7a4dde463 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -66,19 +66,6 @@
qemu: Add support for ARMv6l guests
</summary>
</change>
- <change>
- <summary>
- Remember original owners and SELinux labels of files
- </summary>
- <description>
- When a domain is starting up libvirt changes DAC and
- SELinux labels so that domain can access it. However,
- it never remembered the original labels and therefore
- the file was returned back to <code>root:root</code>.
- With this release, the original labels are remembered
- and restored properly.
- </description>
- </change>
<change>
<summary>
Support more NVDIMM configuration options
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index 8a5b39e568..ddc4bbfd1d 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -71,7 +71,6 @@ module Libvirtd_qemu =
| str_entry "user"
| str_entry "group"
| bool_entry "dynamic_ownership"
- | bool_entry "remember_owner"
| str_array_entry "cgroup_controllers"
| str_array_entry "cgroup_device_acl"
| int_entry "seccomp_sandbox"
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index 29093f6329..28e51b2c59 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -450,11 +450,6 @@
# Set to 0 to disable file ownership changes.
#dynamic_ownership = 1
-# Whether libvirt should remember and restore the original
-# ownership over files it is relabeling. Defaults to 1, set
-# to 0 to disable the feature.
-#remember_owner = 1
-
# What cgroup controllers to make use of with QEMU guests
#
# - 'cpu' - use for scheduler tunables
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 20952e9607..b03e38b831 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -145,7 +145,6 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
cfg->group = (gid_t)-1;
}
cfg->dynamicOwnership = privileged;
- cfg->rememberOwner = privileged;
cfg->cgroupControllers = -1; /* -1 == auto-detect */
@@ -729,9 +728,6 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
if (virConfGetValueBool(conf, "dynamic_ownership", &cfg->dynamicOwnership) < 0)
goto cleanup;
- if (virConfGetValueBool(conf, "remember_owner", &cfg->rememberOwner) < 0)
- goto cleanup;
-
if (virConfGetValueStringList(conf, "cgroup_controllers", false,
&controllers) < 0)
goto cleanup;
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index 92a8ae1192..f1e8806ad2 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -43,7 +43,6 @@ module Test_libvirtd_qemu =
{ "user" = "root" }
{ "group" = "root" }
{ "dynamic_ownership" = "1" }
-{ "remember_owner" = "1" }
{ "cgroup_controllers"
{ "1" = "cpu" }
{ "2" = "devices" }
--
2.19.2
5 years, 10 months
[libvirt] [PULL 03/44] hw/misc/ivshmem: Remove deprecated "ivshmem" legacy device
by Michael S. Tsirkin
From: Thomas Huth <thuth(a)redhat.com>
It's been marked as deprecated in QEMU v2.6.0 already, so really nobody
should use the legacy "ivshmem" device anymore (but use ivshmem-plain or
ivshmem-doorbell instead). Time to remove the deprecated device now.
Belatedly also update a mention of the deprecated "ivshmem" in the file
docs/specs/ivshmem-spec.txt to "ivshmem-doorbell". Missed in commit
5400c02b90b ("ivshmem: Split ivshmem-plain, ivshmem-doorbell off ivshmem").
Signed-off-by: Thomas Huth <thuth(a)redhat.com>
Reviewed-by: Markus Armbruster <armbru(a)redhat.com>
Reviewed-by: Michael S. Tsirkin <mst(a)redhat.com>
Signed-off-by: Michael S. Tsirkin <mst(a)redhat.com>
---
docs/specs/ivshmem-spec.txt | 8 +-
hw/i386/pc_piix.c | 1 -
hw/misc/ivshmem.c | 210 +-----------------------------------
tests/ivshmem-test.c | 67 ++++--------
qemu-deprecated.texi | 5 -
scripts/device-crash-test | 1 -
6 files changed, 34 insertions(+), 258 deletions(-)
diff --git a/docs/specs/ivshmem-spec.txt b/docs/specs/ivshmem-spec.txt
index a1f5499796..042f7eae22 100644
--- a/docs/specs/ivshmem-spec.txt
+++ b/docs/specs/ivshmem-spec.txt
@@ -17,12 +17,16 @@ get interrupted by its peers.
There are two basic configurations:
-- Just shared memory: -device ivshmem-plain,memdev=HMB,...
+- Just shared memory:
+
+ -device ivshmem-plain,memdev=HMB,...
This uses host memory backend HMB. It should have option "share"
set.
-- Shared memory plus interrupts: -device ivshmem,chardev=CHR,vectors=N,...
+- Shared memory plus interrupts:
+
+ -device ivshmem-doorbell,chardev=CHR,vectors=N,...
An ivshmem server must already be running on the host. The device
connects to the server's UNIX domain socket via character device
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 5088e2f492..63c84e3827 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -715,7 +715,6 @@ static void pc_i440fx_1_2_machine_options(MachineClass *m)
PC_CPU_MODEL_IDS("1.2.0")
{ "nec-usb-xhci", "msi", "off" },
{ "nec-usb-xhci", "msix", "off" },
- { "ivshmem", "use64", "0" },
{ "qxl", "revision", "3" },
{ "qxl-vga", "revision", "3" },
{ "VGA", "mmio", "off" },
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 8213659602..c7b6bbc974 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -112,13 +112,6 @@ typedef struct IVShmemState {
/* migration stuff */
OnOffAuto master;
Error *migration_blocker;
-
- /* legacy cruft */
- char *role;
- char *shmobj;
- char *sizearg;
- size_t legacy_size;
- uint32_t not_legacy_32bit;
} IVShmemState;
/* registers for the Inter-VM shared memory device */
@@ -529,17 +522,6 @@ static void process_msg_shmem(IVShmemState *s, int fd, Error **errp)
size = buf.st_size;
- /* Legacy cruft */
- if (s->legacy_size != SIZE_MAX) {
- if (size < s->legacy_size) {
- error_setg(errp, "server sent only %zd bytes of shared memory",
- (size_t)buf.st_size);
- close(fd);
- return;
- }
- size = s->legacy_size;
- }
-
/* mmap the region and map into the BAR2 */
memory_region_init_ram_from_fd(&s->server_bar2, OBJECT(s),
"ivshmem.bar2", size, true, fd, &local_err);
@@ -882,8 +864,6 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
IVShmemState *s = IVSHMEM_COMMON(dev);
Error *err = NULL;
uint8_t *pci_conf;
- uint8_t attr = PCI_BASE_ADDRESS_SPACE_MEMORY |
- PCI_BASE_ADDRESS_MEM_PREFETCH;
Error *local_err = NULL;
/* IRQFD requires MSI */
@@ -903,10 +883,6 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY,
&s->ivshmem_mmio);
- if (s->not_legacy_32bit) {
- attr |= PCI_BASE_ADDRESS_MEM_TYPE_64;
- }
-
if (s->hostmem != NULL) {
IVSHMEM_DPRINTF("using hostmem\n");
@@ -964,7 +940,11 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)
}
vmstate_register_ram(s->ivshmem_bar2, DEVICE(s));
- pci_register_bar(PCI_DEVICE(s), 2, attr, s->ivshmem_bar2);
+ pci_register_bar(PCI_DEVICE(s), 2,
+ PCI_BASE_ADDRESS_SPACE_MEMORY |
+ PCI_BASE_ADDRESS_MEM_PREFETCH |
+ PCI_BASE_ADDRESS_MEM_TYPE_64,
+ s->ivshmem_bar2);
}
static void ivshmem_exit(PCIDevice *dev)
@@ -1084,13 +1064,6 @@ static Property ivshmem_plain_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
-static void ivshmem_plain_init(Object *obj)
-{
- IVShmemState *s = IVSHMEM_PLAIN(obj);
-
- s->not_legacy_32bit = 1;
-}
-
static void ivshmem_plain_realize(PCIDevice *dev, Error **errp)
{
IVShmemState *s = IVSHMEM_COMMON(dev);
@@ -1122,7 +1095,6 @@ static const TypeInfo ivshmem_plain_info = {
.name = TYPE_IVSHMEM_PLAIN,
.parent = TYPE_IVSHMEM_COMMON,
.instance_size = sizeof(IVShmemState),
- .instance_init = ivshmem_plain_init,
.class_init = ivshmem_plain_class_init,
};
@@ -1155,8 +1127,6 @@ static void ivshmem_doorbell_init(Object *obj)
IVShmemState *s = IVSHMEM_DOORBELL(obj);
s->features |= (1 << IVSHMEM_MSI);
- s->legacy_size = SIZE_MAX; /* whatever the server sends */
- s->not_legacy_32bit = 1;
}
static void ivshmem_doorbell_realize(PCIDevice *dev, Error **errp)
@@ -1189,181 +1159,11 @@ static const TypeInfo ivshmem_doorbell_info = {
.class_init = ivshmem_doorbell_class_init,
};
-static int ivshmem_load_old(QEMUFile *f, void *opaque, int version_id)
-{
- IVShmemState *s = opaque;
- PCIDevice *pdev = PCI_DEVICE(s);
- int ret;
-
- IVSHMEM_DPRINTF("ivshmem_load_old\n");
-
- if (version_id != 0) {
- return -EINVAL;
- }
-
- ret = ivshmem_pre_load(s);
- if (ret) {
- return ret;
- }
-
- ret = pci_device_load(pdev, f);
- if (ret) {
- return ret;
- }
-
- if (ivshmem_has_feature(s, IVSHMEM_MSI)) {
- msix_load(pdev, f);
- ivshmem_msix_vector_use(s);
- } else {
- s->intrstatus = qemu_get_be32(f);
- s->intrmask = qemu_get_be32(f);
- }
-
- return 0;
-}
-
-static bool test_msix(void *opaque, int version_id)
-{
- IVShmemState *s = opaque;
-
- return ivshmem_has_feature(s, IVSHMEM_MSI);
-}
-
-static bool test_no_msix(void *opaque, int version_id)
-{
- return !test_msix(opaque, version_id);
-}
-
-static const VMStateDescription ivshmem_vmsd = {
- .name = "ivshmem",
- .version_id = 1,
- .minimum_version_id = 1,
- .pre_load = ivshmem_pre_load,
- .post_load = ivshmem_post_load,
- .fields = (VMStateField[]) {
- VMSTATE_PCI_DEVICE(parent_obj, IVShmemState),
-
- VMSTATE_MSIX_TEST(parent_obj, IVShmemState, test_msix),
- VMSTATE_UINT32_TEST(intrstatus, IVShmemState, test_no_msix),
- VMSTATE_UINT32_TEST(intrmask, IVShmemState, test_no_msix),
-
- VMSTATE_END_OF_LIST()
- },
- .load_state_old = ivshmem_load_old,
- .minimum_version_id_old = 0
-};
-
-static Property ivshmem_properties[] = {
- DEFINE_PROP_CHR("chardev", IVShmemState, server_chr),
- DEFINE_PROP_STRING("size", IVShmemState, sizearg),
- DEFINE_PROP_UINT32("vectors", IVShmemState, vectors, 1),
- DEFINE_PROP_BIT("ioeventfd", IVShmemState, features, IVSHMEM_IOEVENTFD,
- false),
- DEFINE_PROP_BIT("msi", IVShmemState, features, IVSHMEM_MSI, true),
- DEFINE_PROP_STRING("shm", IVShmemState, shmobj),
- DEFINE_PROP_STRING("role", IVShmemState, role),
- DEFINE_PROP_UINT32("use64", IVShmemState, not_legacy_32bit, 1),
- DEFINE_PROP_END_OF_LIST(),
-};
-
-static void desugar_shm(IVShmemState *s)
-{
- Object *obj;
- char *path;
-
- obj = object_new("memory-backend-file");
- path = g_strdup_printf("/dev/shm/%s", s->shmobj);
- object_property_set_str(obj, path, "mem-path", &error_abort);
- g_free(path);
- object_property_set_int(obj, s->legacy_size, "size", &error_abort);
- object_property_set_bool(obj, true, "share", &error_abort);
- object_property_add_child(OBJECT(s), "internal-shm-backend", obj,
- &error_abort);
- object_unref(obj);
- user_creatable_complete(USER_CREATABLE(obj), &error_abort);
- s->hostmem = MEMORY_BACKEND(obj);
-}
-
-static void ivshmem_realize(PCIDevice *dev, Error **errp)
-{
- IVShmemState *s = IVSHMEM_COMMON(dev);
-
- if (!qtest_enabled()) {
- warn_report("ivshmem is deprecated, please use ivshmem-plain"
- " or ivshmem-doorbell instead");
- }
-
- if (qemu_chr_fe_backend_connected(&s->server_chr) + !!s->shmobj != 1) {
- error_setg(errp, "You must specify either 'shm' or 'chardev'");
- return;
- }
-
- if (s->sizearg == NULL) {
- s->legacy_size = 4 * MiB; /* 4 MB default */
- } else {
- int ret;
- uint64_t size;
-
- ret = qemu_strtosz_MiB(s->sizearg, NULL, &size);
- if (ret < 0 || (size_t)size != size || !is_power_of_2(size)) {
- error_setg(errp, "Invalid size %s", s->sizearg);
- return;
- }
- s->legacy_size = size;
- }
-
- /* check that role is reasonable */
- if (s->role) {
- if (strncmp(s->role, "peer", 5) == 0) {
- s->master = ON_OFF_AUTO_OFF;
- } else if (strncmp(s->role, "master", 7) == 0) {
- s->master = ON_OFF_AUTO_ON;
- } else {
- error_setg(errp, "'role' must be 'peer' or 'master'");
- return;
- }
- } else {
- s->master = ON_OFF_AUTO_AUTO;
- }
-
- if (s->shmobj) {
- desugar_shm(s);
- }
-
- /*
- * Note: we don't use INTx with IVSHMEM_MSI at all, so this is a
- * bald-faced lie then. But it's a backwards compatible lie.
- */
- pci_config_set_interrupt_pin(dev->config, 1);
-
- ivshmem_common_realize(dev, errp);
-}
-
-static void ivshmem_class_init(ObjectClass *klass, void *data)
-{
- DeviceClass *dc = DEVICE_CLASS(klass);
- PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
-
- k->realize = ivshmem_realize;
- k->revision = 0;
- dc->desc = "Inter-VM shared memory (legacy)";
- dc->props = ivshmem_properties;
- dc->vmsd = &ivshmem_vmsd;
-}
-
-static const TypeInfo ivshmem_info = {
- .name = TYPE_IVSHMEM,
- .parent = TYPE_IVSHMEM_COMMON,
- .instance_size = sizeof(IVShmemState),
- .class_init = ivshmem_class_init,
-};
-
static void ivshmem_register_types(void)
{
type_register_static(&ivshmem_common_info);
type_register_static(&ivshmem_plain_info);
type_register_static(&ivshmem_doorbell_info);
- type_register_static(&ivshmem_info);
}
type_init(ivshmem_register_types)
diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c
index fe5eb304b1..4911b69317 100644
--- a/tests/ivshmem-test.c
+++ b/tests/ivshmem-test.c
@@ -291,20 +291,20 @@ static void *server_thread(void *data)
return NULL;
}
-static void setup_vm_with_server(IVState *s, int nvectors, bool msi)
+static void setup_vm_with_server(IVState *s, int nvectors)
{
- char *cmd = g_strdup_printf("-chardev socket,id=chr0,path=%s,nowait "
- "-device ivshmem%s,chardev=chr0,vectors=%d",
- tmpserver,
- msi ? "-doorbell" : ",size=1M,msi=off",
- nvectors);
+ char *cmd;
- setup_vm_cmd(s, cmd, msi);
+ cmd = g_strdup_printf("-chardev socket,id=chr0,path=%s,nowait "
+ "-device ivshmem-doorbell,chardev=chr0,vectors=%d",
+ tmpserver, nvectors);
+
+ setup_vm_cmd(s, cmd, true);
g_free(cmd);
}
-static void test_ivshmem_server(bool msi)
+static void test_ivshmem_server(void)
{
IVState state1, state2, *s1, *s2;
ServerThread thread;
@@ -327,9 +327,9 @@ static void test_ivshmem_server(bool msi)
thread.thread = g_thread_new("ivshmem-server", server_thread, &thread);
g_assert(thread.thread != NULL);
- setup_vm_with_server(&state1, nvectors, msi);
+ setup_vm_with_server(&state1, nvectors);
s1 = &state1;
- setup_vm_with_server(&state2, nvectors, msi);
+ setup_vm_with_server(&state2, nvectors);
s2 = &state2;
/* check got different VM ids */
@@ -340,38 +340,28 @@ static void test_ivshmem_server(bool msi)
g_assert_cmpint(vm1, !=, vm2);
/* check number of MSI-X vectors */
- if (msi) {
- ret = qpci_msix_table_size(s1->dev);
- g_assert_cmpuint(ret, ==, nvectors);
- }
+ ret = qpci_msix_table_size(s1->dev);
+ g_assert_cmpuint(ret, ==, nvectors);
/* TODO test behavior before MSI-X is enabled */
/* ping vm2 -> vm1 on vector 0 */
- if (msi) {
- ret = qpci_msix_pending(s1->dev, 0);
- g_assert_cmpuint(ret, ==, 0);
- } else {
- g_assert_cmpuint(in_reg(s1, INTRSTATUS), ==, 0);
- }
+ ret = qpci_msix_pending(s1->dev, 0);
+ g_assert_cmpuint(ret, ==, 0);
out_reg(s2, DOORBELL, vm1 << 16);
do {
g_usleep(10000);
- ret = msi ? qpci_msix_pending(s1->dev, 0) : in_reg(s1, INTRSTATUS);
+ ret = qpci_msix_pending(s1->dev, 0);
} while (ret == 0 && g_get_monotonic_time() < end_time);
g_assert_cmpuint(ret, !=, 0);
/* ping vm1 -> vm2 on vector 1 */
- if (msi) {
- ret = qpci_msix_pending(s2->dev, 1);
- g_assert_cmpuint(ret, ==, 0);
- } else {
- g_assert_cmpuint(in_reg(s2, INTRSTATUS), ==, 0);
- }
+ ret = qpci_msix_pending(s2->dev, 1);
+ g_assert_cmpuint(ret, ==, 0);
out_reg(s1, DOORBELL, vm2 << 16 | 1);
do {
g_usleep(10000);
- ret = msi ? qpci_msix_pending(s2->dev, 1) : in_reg(s2, INTRSTATUS);
+ ret = qpci_msix_pending(s2->dev, 1);
} while (ret == 0 && g_get_monotonic_time() < end_time);
g_assert_cmpuint(ret, !=, 0);
@@ -389,27 +379,17 @@ static void test_ivshmem_server(bool msi)
close(thread.pipe[0]);
}
-static void test_ivshmem_server_msi(void)
-{
- test_ivshmem_server(true);
-}
-
-static void test_ivshmem_server_irq(void)
-{
- test_ivshmem_server(false);
-}
-
#define PCI_SLOT_HP 0x06
static void test_ivshmem_hotplug(void)
{
const char *arch = qtest_get_arch();
- qtest_start("");
+ qtest_start("-object memory-backend-ram,size=1M,id=mb1");
- qtest_qmp_device_add("ivshmem",
- "iv1", "{'addr': %s, 'shm': %s, 'size': '1M'}",
- stringify(PCI_SLOT_HP), tmpshm);
+ qtest_qmp_device_add("ivshmem-plain", "iv1",
+ "{'addr': %s, 'memdev': 'mb1'}",
+ stringify(PCI_SLOT_HP));
if (strcmp(arch, "ppc64") != 0) {
qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP);
}
@@ -509,8 +489,7 @@ int main(int argc, char **argv)
if (g_test_slow()) {
qtest_add_func("/ivshmem/pair", test_ivshmem_pair);
if (strcmp(arch, "ppc64") != 0) {
- qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi);
- qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq);
+ qtest_add_func("/ivshmem/server", test_ivshmem_server);
}
}
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 81de5fc019..219206a836 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -126,11 +126,6 @@ documentation of ``query-hotpluggable-cpus'' for additional details.
@section System emulator devices
-@subsection ivshmem (since 2.6.0)
-
-The ``ivshmem'' device type is replaced by either the ``ivshmem-plain''
-or ``ivshmem-doorbell`` device types.
-
@subsection bluetooth (since 3.1)
The bluetooth subsystem is unmaintained since many years and likely bitrotten
diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index e93a7c0c84..a835772ac5 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -83,7 +83,6 @@ ERROR_WHITELIST = [
{'device':'isa-ipmi-bt', 'expected':True}, # IPMI device requires a bmc attribute to be set
{'device':'isa-ipmi-kcs', 'expected':True}, # IPMI device requires a bmc attribute to be set
{'device':'isa-parallel', 'expected':True}, # Can't create serial device, empty char device
- {'device':'ivshmem', 'expected':True}, # You must specify either 'shm' or 'chardev'
{'device':'ivshmem-doorbell', 'expected':True}, # You must specify a 'chardev'
{'device':'ivshmem-plain', 'expected':True}, # You must specify a 'memdev'
{'device':'loader', 'expected':True}, # please include valid arguments
--
MST
5 years, 10 months
[libvirt] [PATCH] news: Move entry for libvirt picking DRI devices
by Andrea Bolognani
The entry, introduced by commit 3934beb8579c, ended up
inside a comment instead of the XML document proper, and
as such didn't show up in the generated files.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
docs/news.xml | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/news.xml b/docs/news.xml
index 8c608cdc36..90b7e8891e 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -25,19 +25,6 @@
<section title="New features">
</section>
<section title="Improvements">
- <change>
- <summary>
- Start selecting the first available DRI device for OpenGL operations
- </summary>
- <description>
- If OpenGL support is needed (either with SPICE gl enabled or with
- egl-headless), libvirt is now able to pick the first available DRI
- device for the job. At the same time, this improvement is also a
- bugfix as it prevents permission-related issues with regards to our
- mount namespaces and the default DRI render node's permissions which
- would normally prevent QEMU from accessing such a device.
- </description>
- </change>
</section>
<section title="Bug fixes">
</section>
@@ -112,6 +99,19 @@
sibling Hyperthread.
</description>
</change>
+ <change>
+ <summary>
+ Start selecting the first available DRI device for OpenGL operations
+ </summary>
+ <description>
+ If OpenGL support is needed (either with SPICE gl enabled or with
+ egl-headless), libvirt is now able to pick the first available DRI
+ device for the job. At the same time, this improvement is also a
+ bugfix as it prevents permission-related issues with regards to our
+ mount namespaces and the default DRI render node's permissions which
+ would normally prevent QEMU from accessing such a device.
+ </description>
+ </change>
<change>
<summary>
qemu: Add support for postcopy-requests migration statistics
--
2.20.1
5 years, 10 months
[libvirt] [PATCH] util: make forgotten changes suggested during review of commit d40b820c
by Laine Stump
I had intended to make these changes to commit d40b820c before
pushing, but forgot about it during the day between the initial review
and ACK.
Neither change is significant - just returning immediately when
virNetDevGetName() faills (instead of logging a debug message first)
and eliminating a comment that adds to confusion rather than
eliminating it. Still, the changes should be made to be more consistent with nearly identical code just a few lines up (added in commit 7282f455)
Signed-off-by: Laine Stump <laine(a)laine.org>
---
src/util/virnetdevip.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index 8c960ceeac..b6df422cd1 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -584,18 +584,18 @@ virNetDevIPCheckIPv6ForwardingCallback(struct nlmsghdr *resp,
ifname = virNetDevGetName(nh->rtnh_ifindex);
- if (ifname)
- accept_ra = virNetDevIPGetAcceptRA(ifname);
+ if (!ifname)
+ return -1;
+
+ accept_ra = virNetDevIPGetAcceptRA(ifname);
VIR_DEBUG("Checking multipath route nexthop device %s (%d), accept_ra: %d",
ifname, nh->rtnh_ifindex, accept_ra);
- if (!ifname ||
- (accept_ra != 2 && virNetDevIPCheckIPv6ForwardingAddIF(data, &ifname) < 0)) {
+ if (accept_ra != 2 && virNetDevIPCheckIPv6ForwardingAddIF(data, &ifname) < 0)
return -1;
- }
- VIR_FREE(ifname); /* in case it wasn't added to the array */
+ VIR_FREE(ifname);
data->hasRARoutes = true;
len -= NLMSG_ALIGN(nh->rtnh_len);
--
2.20.1
5 years, 10 months
[libvirt] Entering freeze for libvirt-5.0.0
by Daniel Veillard
As planned I tagged the RC1 in git and pushed signed tarball and rpms to
the usual place:
ftp://libvirt.org/libvirt/
I didn't see the 5 patches from Laine in git at that point but those seems
to be bug + portability fixes anyway so it should still be possible to have
them in say before rc2.
Seems to be working fine in my limited testing, and CI seems to be mostly
green excepot a few edge cases https://ci.centos.org/view/libvirt/ so that's
looking good to me, but as usual it's good to exercice the RCs in various
condition to make sure we didn't introdue regressions on some platforms.
I plan on RC2 release during the week-end and then if everything goes well
push 5.0.0 out on Tuesday for Jan 15 deadline,
thanks in advance for giving it some testing !
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, 10 months
[libvirt] [PATCH v5 00/36] BaselineHypervisorCPU using QEMU QMP exchanges
by Chris Venteicher
Some architectures (S390) depend on QEMU to compute baseline CPU model and
expand a models feature set.
Interacting with QEMU requires starting the QEMU process and completing one or
more query-cpu-model-baseline QMP exchanges with QEMU in addition to a
query-cpu-model-expansion QMP exchange to expand all features in the model.
See "s390x CPU models: exposing features" patch set on Qemu-devel for discussion
of QEMU aspects.
This is part of resolution of: https://bugzilla.redhat.com/show_bug.cgi?id=1511999
-----
This patch set fixes all process code issues identified here:
https://www.redhat.com/archives/libvir-list/2018-November/msg00349.html
in patches 1-22 of the series.
The remaining patches implement the BaselineHypervisorCPU changes using
the non-domain qemu process code.
The process changes (patches 1-22)...
- Make the process code generic (not capabilities specific) for use by
BaselineHypervisorCPU
- Many of the process patches are simple code moves with implementation
changes in other distinct patches
- A thread safe library function creates a unique directory under libDir for each QEMU
process (for QMP messaging) to decouple processes in terms of sockets and
file system footprint.
The BaselineHypervisorCPU changes (patches 22-36)...
- Fix all issues raised in patch sets 1-4.
Thanks,
Chris
Chris Venteicher (36):
qemu_process: Move process code from qemu_capabilities to qemu_process
qemu_process: Use qemuProcessQmp prefix
qemu_process: Limit qemuProcessQmpNew to const input strings
qemu_process: Refer to proc not cmd in process code
qemu_process: Use consistent name for stop process function
qemu_capabilities: Stop QEMU process before freeing
qemu_process: Use qemuProcessQmp struct for a single process
qemu_process: All ProcessQMP errors are fatal
qemu_process: Persist stderr in qemuProcessQmp struct
qemu_process: Introduce qemuProcessQmpStart
qemu_process: Collect monitor code in single function
qemu_process: Store libDir in qemuProcessQmp struct
qemu_process: Setup paths within qemuProcessQmpInit
qemu_process: Stop retaining Monitor config in qemuProcessQmp
qemu_process: Don't open monitor if process failed
qemu_process: Cleanup qemuProcessQmp alloc function
qemu_process: Cleanup qemuProcessQmpStop function
qemu_process: Catch process free before process stop
qemu_monitor: Make monitor callbacks optional
qemu_process: Enter QMP command mode when starting QEMU Process
qemu_process: Use unique directories for QMP processes
qemu_process: Stop locking QMP process monitor immediately
qemu_monitor: Introduce qemuMonitorCPUModelInfoNew
qemu_monitor: Introduce qemuMonitorCPUModelInfo / JSON conversion
qemu_capabilities: Introduce virQEMuCapsMigratablePropsDiff
qemu_monitor: qemuMonitorGetCPUModelExpansion inputs and outputs
CPUModelInfo
qemu_capabilities: Introduce CPUModelInfo to virCPUDef function
qemu_capabilities: Introduce virCPUDef to CPUModelInfo function
qemu_monitor: Support query-cpu-model-baseline QMP command
qemu_driver: Consolidate code to baseline using libvirt
qemu_driver: Decouple code for baseline using libvirt
qemu_driver: Identify using libvirt as a distinct way to compute
baseline
qemu_driver: Support baseline calculation using QEMU
qemu_driver: Support feature expansion via QEMU when baselining cpu
qemu_driver: Remove unsupported props in expanded hypervisor baseline
output
qemu_monitor: Default props to migratable when expanding cpu model
src/qemu/qemu_capabilities.c | 617 ++++++++----------
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_driver.c | 216 +++++-
src/qemu/qemu_monitor.c | 184 +++++-
src/qemu/qemu_monitor.h | 29 +-
src/qemu/qemu_monitor_json.c | 226 +++++--
src/qemu/qemu_monitor_json.h | 12 +-
src/qemu/qemu_process.c | 356 ++++++++++
src/qemu/qemu_process.h | 32 +
tests/cputest.c | 11 +-
.../caps_2.10.0.s390x.xml | 60 +-
.../caps_2.11.0.s390x.xml | 58 +-
.../caps_2.12.0.s390x.xml | 56 +-
.../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 32 +-
.../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 34 +-
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 64 +-
tests/qemucapabilitiestest.c | 7 +
17 files changed, 1396 insertions(+), 602 deletions(-)
--
2.17.1
5 years, 10 months