[libvirt] [PATCH v3 0/4] Fix up some issues from x and y resolution patches
by Jonathon Jongsma
This is the third version of this patch series after a review from Cole. The
main changes to this version of the patch series are:
- several patches have been pushed upstream (and therefore dropped from this
series
- The iteration over child nodes was moved up to the caller due to a
suggestion from Cole (much better, thanks)
- Because the parse functions are now only called when the appropriate XML
element is present, the parse functions no longer need to return
"successful" NULL for the case where the element is not specified in the
XML. Therefore we do not need to change the function signatures and we can
simply treat a NULL return value as an error.
- the resolution validation is moved to virDomainVideoDefValidate().
Jonathon Jongsma (4):
conf: iterate video model children in parent function
conf: report errors when parsing video resolution
conf: report errors when parsing video acceleration
conf: validate video resolution
src/conf/domain_conf.c | 75 ++++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 35 deletions(-)
--
2.21.0
5 years, 1 month
[libvirt] [PATCH 0/7] net/qemu: move vlan/bandwidth validation out of network driver
by Laine Stump
As usual, the first 6 patches are just torquing stuff around to make
the last patch simple (except that patch 1 makes interface validation
errors more useful). 2-5 are just converting a bunch of accessor
functions to tak/return const pointers, since that's what's available
in the places where I wanted to use them.
This does actually fix a documented bug:
https://bugzilla.redhat.com/1741121
(that one is about vlan tag validation. There may also be one about
bandwidth, but I didn't see it right away, so I gave up, as is my
custom).
Laine Stump (7):
qemu: add mac address to error messages in
qemuDomainValidateActualNetDef
conf: make virDomainNetGetActualVlan arg/return val const
conf: make virDomainNetGetActualBandwidth arg/return value const
conf: return a const from virDomainNetGetActualVirtPortProfile
conf: change args/return values of remaining virDomainNetGetActual*()
to const
conf: add hypervisor agnostic, domain start-time, validation function
for NetDef
net/qemu: move vlan/bandwidth validation out of network driver
src/conf/domain_conf.c | 78 ++++++++++++++++++++++++----
src/conf/domain_conf.h | 21 ++++----
src/conf/netdev_bandwidth_conf.c | 2 +-
src/conf/netdev_bandwidth_conf.h | 2 +-
src/conf/netdev_vport_profile_conf.c | 2 +-
src/conf/netdev_vport_profile_conf.h | 2 +-
src/libvirt_private.syms | 1 +
src/libxl/libxl_conf.c | 6 +--
src/libxl/libxl_domain.c | 4 ++
src/libxl/libxl_driver.c | 4 ++
src/libxl/xen_common.c | 4 +-
src/lxc/lxc_driver.c | 8 ++-
src/lxc/lxc_process.c | 16 +++---
src/network/bridge_driver.c | 37 -------------
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_domain.c | 35 ++++++++-----
src/qemu/qemu_hotplug.c | 6 +--
src/qemu/qemu_migration_cookie.c | 2 +-
src/qemu/qemu_process.c | 2 +-
src/util/virhostdev.c | 8 +--
src/util/virnetdev.c | 4 +-
src/util/virnetdev.h | 2 +-
src/util/virnetdevbandwidth.c | 6 +--
src/util/virnetdevbandwidth.h | 4 +-
src/util/virnetdevmacvlan.c | 20 +++----
src/util/virnetdevmacvlan.h | 10 ++--
src/util/virnetdevmidonet.c | 4 +-
src/util/virnetdevmidonet.h | 4 +-
src/util/virnetdevopenvswitch.c | 8 +--
src/util/virnetdevopenvswitch.h | 6 +--
src/util/virnetdevtap.c | 12 ++---
src/util/virnetdevtap.h | 12 ++---
src/util/virnetdevvportprofile.c | 12 ++---
src/util/virnetdevvportprofile.h | 12 ++---
tests/bhyvexml2argvmock.c | 4 +-
35 files changed, 206 insertions(+), 156 deletions(-)
--
2.21.0
5 years, 1 month
[libvirt] [PATCH 0/2] [Bug 1760233] Better support for non-systemd distributions
by Miguel Ángel Arruga Vivas
Hi everybody,
The following patches try to enhance the support for non-systemd
configurations.
The first patch just removes the references to the cgroups created by
systemd, only leaving the reference to /machine cgroup, created by
libvirtd for hosted virtual machines.
The second one ensures the creation of that group when using
cgroups-v2, as the error message provided in bug report[1] is raised
by checking too early the existence of the file cgroup.controllers,
before the actual creation of the control group. I tried to solve it
at the highest abstraction level, by chaining properly the object
construction.
Happy hacking!
Miguel
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1760233
Miguel Ángel Arruga Vivas (2):
doc: cgroups: Remove unwanted references to systemd
vircgroup: Ensure /machine group is associated with its parent
docs/cgroups.html.in | 13 +++----------
src/util/vircgroup.c | 8 +++++---
2 files changed, 8 insertions(+), 13 deletions(-)
--
2.23.0
5 years, 1 month
[libvirt] [PATCH] Allow a zfs pool or dataset as source for zfs storage backend
by Gregor Kopka
Enables hosting a pool on an existing zfs pool without affecting
other datasets there.
Specify dataset instead of pool as source to use.
Parent of dataset must exist for pool-build to succeed.
Beware that pool-delete destroys the source dataset and all children.
Solves: https://www.redhat.com/archives/libvirt-users/2017-April/msg00041.html
Signed-off-by: Gregor Kopka <gregor(a)kopka.net>
---
src/storage/storage_backend_zfs.c | 40 ++++++++++++++++++++++---------
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
index c3057fede6..950c5234e0 100644
--- a/src/storage/storage_backend_zfs.c
+++ b/src/storage/storage_backend_zfs.c
@@ -115,10 +115,10 @@ virStorageBackendZFSParseVol(virStoragePoolObjPtr pool,
if (count != 3)
goto cleanup;
- if (!(name_tokens = virStringSplit(tokens[0], "/", 2)))
+ if (!(name_tokens = virStringSplitCount(tokens[0], "/", 0, &count)))
goto cleanup;
- vol_name = name_tokens[1];
+ vol_name = name_tokens[count-1];
if (vol == NULL)
volume = virStorageVolDefFindByName(pool, vol_name);
@@ -225,6 +225,7 @@ virStorageBackendZFSRefreshPool(virStoragePoolObjPtr pool G_GNUC_UNUSED)
g_autoptr(virCommand) cmd = NULL;
VIR_AUTOSTRINGLIST lines = NULL;
VIR_AUTOSTRINGLIST tokens = NULL;
+ VIR_AUTOSTRINGLIST name_tokens = NULL;
/**
* $ zpool get -Hp health,size,free,allocated test
@@ -236,10 +237,13 @@ virStorageBackendZFSRefreshPool(virStoragePoolObjPtr pool G_GNUC_UNUSED)
*
* Here we just provide a list of properties we want to see
*/
+ if (!(name_tokens = virStringSplit(def->source.name, "/", 0)))
+ goto cleanup;
+
cmd = virCommandNewArgList(ZPOOL,
"get", "-Hp",
"health,size,free,allocated",
- def->source.name,
+ name_tokens[0],
NULL);
virCommandSetOutputBuffer(cmd, &zpool_props);
if (virCommandRun(cmd, NULL) < 0)
@@ -384,20 +388,27 @@ virStorageBackendZFSBuildPool(virStoragePoolObjPtr pool,
size_t i;
g_autoptr(virCommand) cmd = NULL;
int ret = -1;
+ char *tmp;
virCheckFlags(0, -1);
+ tmp = strstr(def->source.name, "/");
+ if (tmp) {
+ cmd = virCommandNewArgList(ZFS, "create", "-o", "mountpoint=none",
+ def->source.name, NULL);
+ } else {
+ if (def->source.ndevice == 0) {
- if (def->source.ndevice == 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("missing source devices"));
- return -1;
- }
+ return -1;
+ }
- cmd = virCommandNewArgList(ZPOOL, "create",
+ cmd = virCommandNewArgList(ZPOOL, "create",
def->source.name, NULL);
- for (i = 0; i < def->source.ndevice; i++)
- virCommandAddArg(cmd, def->source.devices[i].path);
+ for (i = 0; i < def->source.ndevice; i++)
+ virCommandAddArg(cmd, def->source.devices[i].path);
+ }
virObjectUnlock(pool);
ret = virCommandRun(cmd, NULL);
@@ -412,11 +423,18 @@ virStorageBackendZFSDeletePool(virStoragePoolObjPtr pool,
{
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
g_autoptr(virCommand) cmd = NULL;
+ char *tmp;
virCheckFlags(0, -1);
- cmd = virCommandNewArgList(ZPOOL, "destroy",
+ tmp = strstr(def->source.name, "/");
+ if (tmp) {
+ cmd = virCommandNewArgList(ZFS, "destroy", "-r",
+ def->source.name, NULL);
+ } else {
+ cmd = virCommandNewArgList(ZPOOL, "destroy",
def->source.name, NULL);
+ }
return virCommandRun(cmd, NULL);
}
--
2.22.0
5 years, 1 month
[libvirt] [PATCH] news: mention 'ramfb' mdev attribute
by Jonathon Jongsma
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
docs/news.xml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index c362bf3a15..046314ef78 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -53,6 +53,19 @@
which were introduced in QEMU 4.2.0.
</description>
</change>
+ <change>
+ <summary>
+ qemu: support boot display for GPU mediated devices
+ </summary>
+ <description>
+ Until now, GPU mediated devices generally did not show any output
+ until the guest OS had initialized the vgpu. By specifying the
+ <code>ramfb</code> attribute, qemu can be configured to use ramfb as
+ a boot display for the device. This allows for display of firmware
+ messages, boot loader menu, and other output before the guest OS has
+ initialized the vgpu.
+ </description>
+ </change>
</section>
<section title="Improvements">
</section>
--
2.21.0
5 years, 1 month
[libvirt] [PATCH] spec: Remove build-time list of edk2 firmwares
by Jim Fehlig
Fedora now advertises supported firmwares via descriptor files.
Since the upstream spec file assumes recent Fedora, remove the
build-time list of firmwares, which can produce a warning after
commit 75597f022a.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
libvirt.spec.in | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 2374668722..a6219da604 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1131,34 +1131,6 @@ exit 1
%define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux"
-%if 0%{?fedora}
- # Nightly edk2.git-ovmf-x64
- LOADERS="/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd"
- # Nightly edk2.git-ovmf-ia32
- LOADERS="$LOADERS:/usr/share/edk2.git/ovmf-ia32/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-ia32/OVMF_VARS-pure-efi.fd"
- # Nightly edk2.git-aarch64
- LOADERS="$LOADERS:/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw"
- # Nightly edk2.git-arm
- LOADERS="$LOADERS:/usr/share/edk2.git/arm/QEMU_EFI-pflash.raw:/usr/share/edk2.git/arm/vars-template-pflash.raw"
-
- # Fedora edk2-ovmf, x86_64
- LOADERS="$LOADERS:/usr/share/edk2/ovmf/OVMF_CODE.fd:/usr/share/edk2/ovmf/OVMF_VARS.fd"
- # Fedora edk2-ovmf, x86_64, with Secure Boot
- LOADERS="$LOADERS:/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd:/usr/share/edk2/ovmf/OVMF_VARS.secboot.fd"
- # Fedora edk2-ovmf-ia32
- LOADERS="$LOADERS:/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd:/usr/share/edk2/ovmf-ia32/OVMF_VARS.fd"
- # Fedora edk2-ovmf-ia32, with Secure Boot. (NB: Unlike x86_64, for
- # 'ia32', there is no secboot-variant "VARS" file (NVRAM template).
- # So the NVRAM template for 'ovmf-ia32/OVMF_CODE.secboot.fd' is the
- # same as the one for the non-secboot variant.)
- LOADERS="$LOADERS:/usr/share/edk2/ovmf-ia32/OVMF_CODE.secboot.fd:/usr/share/edk2/ovmf-ia32/OVMF_VARS.fd"
- # Fedora edk2-aarch64
- LOADERS="$LOADERS:/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2/aarch64/vars-template-pflash.raw"
- # Fedora edk2-arm
- LOADERS="$LOADERS:/usr/share/edk2/arm/QEMU_EFI-pflash.raw:/usr/share/edk2/arm/vars-template-pflash.raw"
- %define arg_loader_nvram --with-loader-nvram="$LOADERS"
-%endif
-
# place macros above and build commands below this comment
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/%{name}.spec)
@@ -1231,7 +1203,6 @@ cd %{_vpath_builddir}
--with-qemu-user=%{qemu_user} \
--with-qemu-group=%{qemu_group} \
--with-tls-priority=%{tls_priority} \
- %{?arg_loader_nvram} \
%{?enable_werror} \
--enable-expensive-tests \
--with-init-script=systemd \
--
2.23.0
5 years, 1 month
[libvirt] [PATCHv2] conf: remove NULL check from virDomainQemuMonitorEventNew
by Ján Tomko
The qemu_domain_monitor_event_msg struct in qemu_protocol.x
defines event as a nonnull_string and qemuMonitorJSONIOProcessEvent
also errors out on a non-NULL event.
Drop the check completely.
This essentially reverts commit d343e8203d248635f5e7a0d86dd077f74d49e3af
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/conf/domain_event.c | 12 ------------
src/conf/domain_event.h | 2 +-
2 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index 900d8f745e..33fbf10406 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
@@ -1934,24 +1934,12 @@ virDomainQemuMonitorEventNew(int id,
0, id, name, uuid, uuidstr)))
return NULL;
- /* event is mandatory, details are optional */
- if (!event) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("unexpected event=NULL name=%s uuid=%s details=%s"),
- name, uuidstr, NULLSTR(details));
- goto error;
- }
-
ev->event = g_strdup(event);
ev->seconds = seconds;
ev->micros = micros;
ev->details = g_strdup(details);
return (virObjectEventPtr)ev;
-
- error:
- virObjectUnref(ev);
- return NULL;
}
diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h
index 0a4bce3d04..d1cfb81d62 100644
--- a/src/conf/domain_event.h
+++ b/src/conf/domain_event.h
@@ -321,4 +321,4 @@ virDomainQemuMonitorEventNew(int id,
long long seconds,
unsigned int micros,
const char *details)
- ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
--
2.19.2
5 years, 1 month
[libvirt] [PATCH 0/5] esx: implement virConnectListAllStoragePools
by Pino Toscano
Make the virConnectListAllStoragePools API work for esx storage pools by
implementing the internal connectListAllStoragePools storage API.
Pino Toscano (5):
esx: split datastoreToStoragePoolPtr helper
esx: split datastorePoolType helper
esx: split targetToStoragePool helper
esx: implement connectListAllStoragePools
docs: document virConnectListAllStoragePools in esx
docs/news.xml | 9 ++
src/esx/esx_storage_backend_iscsi.c | 104 +++++++++++++--
src/esx/esx_storage_backend_vmfs.c | 192 +++++++++++++++++++++++-----
src/esx/esx_storage_driver.c | 68 ++++++++++
4 files changed, 332 insertions(+), 41 deletions(-)
--
2.21.0
5 years, 1 month
[libvirt] [PATCH] tests: Mock access to /dev/kvm
by Michal Privoznik
Some of our tests try to validate domain XMLs they are working
with (not intentionally, simply because they call top level
domain XML parse function). Anyway, this implies that we build
domain capabilities also - see
virQEMUDriverGetDomainCapabilities(). And since some domain XMLs
are type of 'kvm' the control gets through
virQEMUCapsFillDomainCaps() and virHostCPUGetKVMMaxVCPUs() to
opening /dev/kvm which may be missing on the machine we're
running 'make check'.
Previously, we did not see this issue, because it was masked. If
building domain capabilities failed for whatever reason, we
ignored the failure. Only v5.9.0-207-gc69e6edea3 uncovered the
problem (it changed reval from 0 to -1 if
virQEMUDriverGetDomainCapabilities() fails). Since the referenced
commit is correct, we need to mock access to /dev/kvm in our
tests.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under broken build rule.
tests/qemuhotplugtest.c | 1 +
tests/qemumemlocktest.c | 4 +++-
tests/qemusecuritytest.c | 3 ++-
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmltest.c | 1 +
tests/securityselinuxlabeltest.c | 4 +++-
6 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index a914a8a8b5..7d70113b6e 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -878,5 +878,6 @@ mymain(void)
VIR_TEST_MAIN_PRELOAD(mymain,
VIR_TEST_MOCK("virpci"),
+ VIR_TEST_MOCK("domaincaps"),
VIR_TEST_MOCK("virprocess"),
VIR_TEST_MOCK("qemuhotplug"));
diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c
index 52cd9f9f26..ef3bfa0345 100644
--- a/tests/qemumemlocktest.c
+++ b/tests/qemumemlocktest.c
@@ -151,7 +151,9 @@ mymain(void)
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
-VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("virpci"))
+VIR_TEST_MAIN_PRELOAD(mymain,
+ VIR_TEST_MOCK("virpci"),
+ VIR_TEST_MOCK("domaincaps"))
#else
diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c
index 685ac4dca2..8c0a48bb65 100644
--- a/tests/qemusecuritytest.c
+++ b/tests/qemusecuritytest.c
@@ -217,4 +217,5 @@ mymain(void)
return ret;
}
-VIR_TEST_MAIN(mymain)
+VIR_TEST_MAIN_PRELOAD(mymain,
+ VIR_TEST_MOCK("domaincaps"))
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 9bb186ed95..3d42cabdb8 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -3033,6 +3033,7 @@ mymain(void)
VIR_TEST_MAIN_PRELOAD(mymain,
VIR_TEST_MOCK("qemuxml2argv"),
+ VIR_TEST_MOCK("domaincaps"),
VIR_TEST_MOCK("virrandom"),
VIR_TEST_MOCK("qemucpu"),
VIR_TEST_MOCK("virpci"))
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 757e0a33e1..1dfa834f6b 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1355,6 +1355,7 @@ mymain(void)
VIR_TEST_MAIN_PRELOAD(mymain,
VIR_TEST_MOCK("virpci"),
VIR_TEST_MOCK("virrandom"),
+ VIR_TEST_MOCK("domaincaps"),
VIR_TEST_MOCK("virdeterministichash"))
#else
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index 741c39d4d1..cbc7018e27 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -371,4 +371,6 @@ mymain(void)
return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
-VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/libsecurityselinuxhelper.so")
+VIR_TEST_MAIN_PRELOAD(mymain,
+ VIR_TEST_MOCK("domaincaps"),
+ abs_builddir "/.libs/libsecurityselinuxhelper.so")
--
2.23.0
5 years, 1 month
[libvirt] [PATCH] virsh: Fix typo in the man page
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as trivial.
tools/virsh.pod | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index c261d403d8..2dce4493cb 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1827,7 +1827,7 @@ agent commands block forever waiting for a response. B<value> must be a
positive value (wait for given amount of seconds) or one of the following
values:
- -2 - block forever waiting for a resuly,
+ -2 - block forever waiting for a result,
-1 - reset timeout to the default value,
0 - do not wait at all,
--
2.24.0
5 years, 1 month