[libvirt] [PATCH 0/2] Fix 'New libvirt-tck failure with libvirt 5.2.0'
by Daniel Henrique Barboza
Hi,
Jim Fehlig reported a failure in a libvirt-tck test after the
patch:
commit f1d6585300001c7b23b8796a0faa4411c3531996
Author: Daniel Henrique Barboza <danielhb413(a)gmail.com>
Date: Fri Mar 15 18:06:45 2019 -0300
domain_conf: check device address before
This patch is blocking the use of 'virsh attach-device' for changing
and ejecting CDROM/Floppy drives. More info and some discussion
can be found at [1].
This small patch set makes changes in the device address
verification to allow this usage back. First patch is just an
extra helper to make the code a bit easier to read. Patch 2
amends commit f1d658530.
[1] https://www.redhat.com/archives/libvir-list/2019-April/msg00733.html
Daniel Henrique Barboza (2):
domain_conf: adding virDomainDiskIsCdromOrFloppy helper
domain_conf: allow CDROM/Floppy media change with attach-device
src/conf/domain_conf.c | 9 +++++++++
src/conf/domain_conf.h | 2 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_command.c | 3 +--
src/qemu/qemu_driver.c | 3 +--
src/qemu/qemu_hotplug.c | 6 ++----
6 files changed, 16 insertions(+), 8 deletions(-)
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] libvirtd.conf: remove extra # after log_outputs line
by Pavel Hrdina
The only place where we have extra empty comment line.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
This annoys me every time I like to change log_outputs. Let's fix it
finally.
Pushed under trivial rule.
src/remote/libvirtd.conf | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/remote/libvirtd.conf b/src/remote/libvirtd.conf
index 92562ab7ae..ac07df6930 100644
--- a/src/remote/libvirtd.conf
+++ b/src/remote/libvirtd.conf
@@ -410,7 +410,6 @@
# Multiple outputs can be defined, they just need to be separated by spaces.
# e.g. to log all warnings and errors to syslog under the libvirtd ident:
#log_outputs="3:syslog:libvirtd"
-#
##################################################################
--
2.20.1
5 years, 8 months
[libvirt] New libvirt-tck failure with libvirt 5.2.0
by Jim Fehlig
I noticed libvirt-tck test domain/207-disk-media-change.t started failing after
updating to libvirt 5.2.0. A bisection fingered commit f1d65853
commit f1d6585300001c7b23b8796a0faa4411c3531996
Author: Daniel Henrique Barboza <danielhb413(a)gmail.com>
Date: Fri Mar 15 18:06:45 2019 -0300
domain_conf: check device address before attach
This commit prevents a media change on CDROM devices.
Regards,
Jim
5 years, 8 months
[libvirt] [PATCH v2 0/3] introducing QEMU_CAPS_QUERY_CURRENT_MACHINE and QEMU_CAPS_PM_WAKEUP_SUPPORT
by Daniel Henrique Barboza
v2:
Fixed review problems found by Peter Krempa, most notably:
- changed the cap name
- made the code generic to be easier to add other caps
from the query-current-machine API
- changed unit tests accordingly
Previous version can be found at:
https://www.redhat.com/archives/libvir-list/2019-April/msg00104.html
Daniel Henrique Barboza (3):
adding QEMU_CAPS_QUERY_CURRENT_MACHINE and QEMU_CAPS_PM_WAKEUP_SUPPORT
qemu_process: setting QEMU_CAPS_QUERY_CURRENT_MACHINE caps
qemuDomainPMSuspendForDuration: check for QEMU_CAPS_PM_WAKEUP_SUPPORT
src/qemu/qemu_capabilities.c | 5 ++
src/qemu/qemu_capabilities.h | 4 ++
src/qemu/qemu_driver.c | 21 ++++++++
src/qemu/qemu_monitor.c | 17 ++++++
src/qemu/qemu_monitor.h | 11 ++++
src/qemu/qemu_monitor_json.c | 53 +++++++++++++++++++
src/qemu/qemu_monitor_json.h | 5 ++
src/qemu/qemu_process.c | 36 +++++++++++++
.../caps_4.0.0.riscv32.xml | 1 +
.../caps_4.0.0.riscv64.xml | 1 +
.../caps_4.0.0.x86_64.xml | 1 +
11 files changed, 155 insertions(+)
--
2.20.1
5 years, 8 months
[libvirt] [jenkins-ci PATCH] guests: Remove YAJL symlink kludge
by Andrea Bolognani
It's no longer needed as of libvirt commit 105756660f94.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/playbooks/update/tasks/kludges.yml | 2 --
1 file changed, 2 deletions(-)
diff --git a/guests/playbooks/update/tasks/kludges.yml b/guests/playbooks/update/tasks/kludges.yml
index c955a30..9d4f232 100644
--- a/guests/playbooks/update/tasks/kludges.yml
+++ b/guests/playbooks/update/tasks/kludges.yml
@@ -10,10 +10,8 @@
with_items:
- include/readline
- include/sasl
- - include/yajl
- lib/libreadline.so
- lib/libsasl2.so
- - lib/libyajl.so
when:
- os_name == 'FreeBSD'
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] virsh: Add virshDomainShutdownModeCompleter
by Michal Privoznik
This completer is used to offer shutdown/reboot modes.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/virsh-completer.c | 56 +++++++++++++++++++++++++++++++++++++++++
tools/virsh-completer.h | 4 +++
tools/virsh-domain.c | 2 ++
3 files changed, 62 insertions(+)
diff --git a/tools/virsh-completer.c b/tools/virsh-completer.c
index aac4579d1f..918e409890 100644
--- a/tools/virsh-completer.c
+++ b/tools/virsh-completer.c
@@ -936,3 +936,59 @@ virshDomainDeviceAliasCompleter(vshControl *ctl,
VIR_STEAL_PTR(ret, tmp);
return ret;
}
+
+
+char **
+virshDomainShutdownModeCompleter(vshControl *ctl,
+ const vshCmd *cmd,
+ unsigned int flags)
+{
+ const char *modes[] = {"acpi", "agent", "initctl", "signal", "paravirt"};
+ size_t i;
+ char **ret = NULL;
+ size_t ntmp = 0;
+ VIR_AUTOSTRINGLIST tmp = NULL;
+ const char *modeConst = NULL;
+ VIR_AUTOFREE(char *) mode = NULL;
+ VIR_AUTOSTRINGLIST modesSpecified = NULL;
+
+ virCheckFlags(0, NULL);
+
+ if (vshCommandOptStringQuiet(ctl, cmd, "mode", &modeConst) < 0)
+ return NULL;
+
+ if (STREQ_NULLABLE(modeConst, " "))
+ modeConst = NULL;
+
+ if (modeConst) {
+ char *modeTmp = NULL;
+
+ if (VIR_STRDUP(mode, modeConst) < 0)
+ return NULL;
+
+ if ((modeTmp = strrchr(mode, ',')))
+ *modeTmp = '\0';
+ else
+ VIR_FREE(mode);
+ }
+
+ if (mode && !(modesSpecified = virStringSplit(mode, ",", 0)))
+ return NULL;
+
+ if (VIR_ALLOC_N(tmp, ARRAY_CARDINALITY(modes) + 1) < 0)
+ return NULL;
+
+ for (i = 0; i < ARRAY_CARDINALITY(modes); i++) {
+ if (virStringListHasString((const char **)modesSpecified, modes[i]))
+ continue;
+
+ if ((mode && virAsprintf(&tmp[ntmp], "%s,%s", mode, modes[i]) < 0) ||
+ (!mode && VIR_STRDUP(tmp[ntmp], modes[i]) < 0))
+ return NULL;
+
+ ntmp++;
+ }
+
+ VIR_STEAL_PTR(ret, tmp);
+ return ret;
+}
diff --git a/tools/virsh-completer.h b/tools/virsh-completer.h
index 2e2e1edafb..ed37a26cc9 100644
--- a/tools/virsh-completer.h
+++ b/tools/virsh-completer.h
@@ -110,4 +110,8 @@ char ** virshDomainDeviceAliasCompleter(vshControl *ctl,
char ** virshCellnoCompleter(vshControl *ctl,
const vshCmd *cmd,
unsigned int flags);
+
+char ** virshDomainShutdownModeCompleter(vshControl *ctl,
+ const vshCmd *cmd,
+ unsigned int flags);
#endif /* LIBVIRT_VIRSH_COMPLETER_H */
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index e8d5404acf..a8a0b2f20d 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -5829,6 +5829,7 @@ static const vshCmdOptDef opts_shutdown[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "mode",
.type = VSH_OT_STRING,
+ .completer = virshDomainShutdownModeCompleter,
.help = N_("shutdown mode: acpi|agent|initctl|signal|paravirt")
},
{.name = NULL}
@@ -5913,6 +5914,7 @@ static const vshCmdOptDef opts_reboot[] = {
VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE),
{.name = "mode",
.type = VSH_OT_STRING,
+ .completer = virshDomainShutdownModeCompleter,
.help = N_("shutdown mode: acpi|agent|initctl|signal|paravirt")
},
{.name = NULL}
--
2.21.0
5 years, 8 months
[libvirt] [PATCH] security: apparmor: make vhost-net access a static rule
by Christian Ehrhardt
So far we were detecting at guest start if any devices needed vhost net
and only if that was true added a rule for /dev/vhost-net.
It turns out that it is an absolutely valid case to start a guest
without any vhost-net networking but later on wanting to hotplug such a
device which then would be denied by apparmor.
Unfortunately there also is no security labeling callback involved other
than the one to /dev/net/tun. But on the other hand vhost-net is no more
new and considered rather safe. Therefore drop the old detection and
just add it as a static rule.
Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1815910
Signed-off-by: Christian Ehrhardt <christian.ehrhardt(a)canonical.com>
---
src/security/apparmor/libvirt-qemu | 1 +
src/security/virt-aa-helper.c | 17 +----------------
2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/src/security/apparmor/libvirt-qemu b/src/security/apparmor/libvirt-qemu
index eaa5167525..a71f34c175 100644
--- a/src/security/apparmor/libvirt-qemu
+++ b/src/security/apparmor/libvirt-qemu
@@ -21,6 +21,7 @@
signal (receive) peer=/usr/sbin/libvirtd,
/dev/net/tun rw,
+ /dev/vhost-net rw,
/dev/kvm rw,
/dev/ptmx rw,
/dev/kqemu rw,
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 8e22e9978a..ebc4feac77 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -937,7 +937,7 @@ get_files(vahControl * ctl)
size_t i;
char *uuid;
char uuidstr[VIR_UUID_STRING_BUFLEN];
- bool needsVfio = false, needsvhost = false;
+ bool needsVfio = false;
/* verify uuid is same as what we were given on the command line */
virUUIDFormat(ctl->def->uuid, uuidstr);
@@ -1248,21 +1248,6 @@ get_files(vahControl * ctl)
}
}
- if (ctl->def->virtType == VIR_DOMAIN_VIRT_KVM) {
- for (i = 0; i < ctl->def->nnets; i++) {
- virDomainNetDefPtr net = ctl->def->nets[i];
- if (net && net->model) {
- if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_QEMU)
- continue;
- if (!virDomainNetIsVirtioModel(net))
- continue;
- }
- needsvhost = true;
- }
- }
- if (needsvhost)
- virBufferAddLit(&buf, " \"/dev/vhost-net\" rw,\n");
-
if (needsVfio) {
virBufferAddLit(&buf, " \"/dev/vfio/vfio\" rw,\n");
virBufferAddLit(&buf, " \"/dev/vfio/[0-9]*\" rw,\n");
--
2.17.1
5 years, 8 months
[libvirt] [PATCH] qemuHotplugDiskSourceDataFree: also free backends
by Ján Tomko
Also free the backends array, not just its members.
Fixes: d3f9dda2c9fd9fa7d2f7f1f1dd70ed7d83938101
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 34249bd030..540befba68 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -512,6 +512,7 @@ qemuHotplugDiskSourceDataFree(qemuHotplugDiskSourceDataPtr data)
for (i = 0; i < data->nbackends; i++)
qemuBlockStorageSourceAttachDataFree(data->backends[i]);
+ VIR_FREE(data->backends);
VIR_FREE(data);
}
--
2.19.2
5 years, 8 months
[libvirt] [PATCH 00/11] A selection of refactors and improvements from the blockdev-add saga
by Peter Krempa
Few patches require
https://www.redhat.com/archives/libvir-list/2019-April/msg00324.html
to be applied.
This is a collection of cleanups and improvements from my blockdev
branch which make sense even without the rest of the blockdev patches.
Peter Krempa (11):
qemu: block: Introduce and use AUTOPTR func for
qemuBlockStorageSourceAttachDataPtr
qemu: block: Use VIR_AUTOPTR for virJSONValue
util: uri: Introduce VIR_AUTOPTR freeing function
qemu: block: Use VIR_AUTOPTR for virURIPtr
qemu: block: Use VIR_AUTOPTR for virHashTablePtr
qemu: block: Use VIR_AUTOFREE for char *
qemu: block: Add and use AUTOPTR func for
qemuBlockNodeNameBackingChainData
qemu: block: Remove unneeded cleanup jumps
internal: Introduce VIR_RETURN_PTR
qemu: block: Use VIR_RETURN_PTR
util: json: Use VIR_APPEND_ELEMENT in virJSONValueObjectAppend
src/internal.h | 15 ++
src/qemu/qemu_block.c | 388 +++++++++++++-------------------------
src/qemu/qemu_block.h | 3 +
src/qemu/qemu_command.c | 14 +-
src/qemu/qemu_hotplug.c | 9 +-
src/qemu/qemu_migration.c | 3 +-
src/util/virjson.c | 19 +-
src/util/viruri.h | 2 +
8 files changed, 172 insertions(+), 281 deletions(-)
--
2.20.1
5 years, 8 months
[libvirt] [PATCH] tests: Fix MinGW build for domaincapstest
by Andrea Bolognani
Commit 5b9819eedc71 started using the virFileWrapper APIs in
the test program, and correctly called them only in the section
of code guarded by WITH_QEMU; however, a single call to the
virFileWrapperClearPrefixes() function ended up in the
hypervisor-agnostic section, causing a build failure on MinGW.
Move the call to the QEMU-only section; while at it, also drop
the virFileWrapperRemovePrefix() calls, which are entirely
redundant since we'd drop all prefixes immediately afterwards
anyway.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Another approach would be to simply drop the call to
virFileWrapperClearPrefixes(), but there really is no point
in removing prefixes one by one when we can just clear all of
them in one fell swoop.
tests/domaincapstest.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 3ee95a4b58..a9922e1edb 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -451,9 +451,7 @@ mymain(void)
"x86_64", VIR_DOMAIN_VIRT_KVM);
virObjectUnref(cfg);
- virFileWrapperRemovePrefix(SYSCONFDIR "/qemu/firmware");
- virFileWrapperRemovePrefix(PREFIX "/share/qemu/firmware");
- virFileWrapperRemovePrefix("/home/user/.config/qemu/firmware");
+ virFileWrapperClearPrefixes();
#endif /* WITH_QEMU */
@@ -476,8 +474,6 @@ mymain(void)
DO_TEST_BHYVE("fbuf", "/usr/sbin/bhyve", &bhyve_caps, VIR_DOMAIN_VIRT_BHYVE);
#endif /* WITH_BHYVE */
- virFileWrapperClearPrefixes();
-
return ret;
}
--
2.20.1
5 years, 8 months