[libvirt] [PATCH 0/9] qemu: remove more capabilities
by Ján Tomko
While reviewing a bootindex-related patch, I found out that we can
also drop all the per-device BOOTINDEX capabilities and more.
Ján Tomko (9):
qemu: always assume QEMU_CAPS_PCI_CONFIGFD
qemu: always assume QEMU_CAPS_PCI_BOOTINDEX
qemu: drop unused QEMU_CAPS_DEVICE_USB_NET
qemu: always assume QEMU_CAPS_USB_REDIR_BOOTINDEX
qemu: always assume QEMU_CAPS_USB_HOST_BOOTINDEX
qemu: always assume QEMU_CAPS_VFIO_PCI_BOOTINDEX
qemu: always assume QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX
qemu: remove leftover property probing
FIXUP: renumber replies and microcode version
Also available on:
git://repo.or.cz/libvirt/jtomko.git caps
src/qemu/qemu_capabilities.c | 28 --
src/qemu/qemu_capabilities.h | 14 +-
src/qemu/qemu_command.c | 48 +--
src/qemu/qemu_hotplug.c | 3 +-
.../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 262 +++--------------
tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 266 +++--------------
tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 266 +++--------------
tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 270 +++--------------
tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 9 +-
.../caps_2.10.0.aarch64.replies | 240 +++------------
tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 6 +-
.../qemucapabilitiesdata/caps_2.10.0.ppc64.replies | 240 +++------------
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 6 +-
.../qemucapabilitiesdata/caps_2.10.0.s390x.replies | 175 +++--------
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 4 +-
.../caps_2.10.0.x86_64.replies | 326 ++++-----------------
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 179 +++--------
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 4 +-
.../caps_2.11.0.x86_64.replies | 272 ++++-------------
tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 7 +-
.../caps_2.12.0.aarch64.replies | 252 ++++------------
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 6 +-
.../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 252 ++++------------
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 6 +-
.../qemucapabilitiesdata/caps_2.12.0.s390x.replies | 191 ++++--------
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 4 +-
.../caps_2.12.0.x86_64.replies | 288 +++++-------------
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 7 +-
.../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 292 ++++--------------
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 296 ++++---------------
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 9 +-
.../caps_2.6.0.aarch64.replies | 236 +++------------
tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml | 6 +-
.../qemucapabilitiesdata/caps_2.6.0.ppc64.replies | 236 +++------------
tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 6 +-
.../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 296 ++++---------------
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_2.7.0.s390x.replies | 167 +++--------
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 4 +-
.../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 305 ++++---------------
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_2.8.0.s390x.replies | 175 +++--------
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 4 +-
.../qemucapabilitiesdata/caps_2.8.0.x86_64.replies | 305 ++++---------------
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_2.9.0.ppc64.replies | 179 +++--------
tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 5 +-
.../qemucapabilitiesdata/caps_2.9.0.s390x.replies | 175 +++--------
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 4 +-
.../qemucapabilitiesdata/caps_2.9.0.x86_64.replies | 326 ++++-----------------
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 9 +-
.../qemucapabilitiesdata/caps_3.0.0.ppc64.replies | 252 ++++------------
tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 6 +-
.../caps_3.0.0.riscv32.replies | 167 +++--------
tests/qemucapabilitiesdata/caps_3.0.0.riscv32.xml | 1 -
.../caps_3.0.0.riscv64.replies | 167 +++--------
tests/qemucapabilitiesdata/caps_3.0.0.riscv64.xml | 1 -
.../qemucapabilitiesdata/caps_3.0.0.x86_64.replies | 288 +++++-------------
tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 7 +-
tests/qemuxml2argvtest.c | 9 +-
65 files changed, 1599 insertions(+), 6037 deletions(-)
--
2.16.4
6 years, 1 month
[libvirt] [PATCH] conf: fix args naming of virDomainChrSourceDefCopy
by Ján Tomko
Since its introduction in commit 2e37bf42 the naming of the arguments
between the prototype and the definition does not match.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as trivial.
src/conf/domain_conf.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 3ff6eea117..e30a4b2fe7 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2889,8 +2889,8 @@ void virDomainNetDefFree(virDomainNetDefPtr def);
void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def);
void virDomainChrDefFree(virDomainChrDefPtr def);
void virDomainChrSourceDefFree(virDomainChrSourceDefPtr def);
-int virDomainChrSourceDefCopy(virDomainChrSourceDefPtr src,
- virDomainChrSourceDefPtr dest);
+int virDomainChrSourceDefCopy(virDomainChrSourceDefPtr dest,
+ virDomainChrSourceDefPtr src);
void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def);
void virDomainSoundDefFree(virDomainSoundDefPtr def);
void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def);
--
2.16.4
6 years, 1 month
[libvirt] [PATCH] conf: fix bogus error when <boot order='1'/> is in an <interface type='hostdev'>
by Laine Stump
virDomainDefCollectBootOrder() is called for every item on the list
for each type of device. Since an <interface type='hostdev'> is on
both the list of hostdev devices and the list of network devices, it
will be counted twice, and the code that checks for multiple devices
with the same boot order will give a false positive.
To remedy this, we make sure to return early for hostdev devices that
have a parent.type != NONE.
This was introduced in commit 5b75a4, which was first in libvirt-4.4.0.
Resolves: https://bugzilla.redhat.com/1601318
Signed-off-by: Laine Stump <laine(a)laine.org>
---
src/conf/domain_conf.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 77cc73744f..71a2fb0426 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5062,6 +5062,14 @@ virDomainDefCollectBootOrder(virDomainDefPtr def ATTRIBUTE_UNUSED,
if (info->bootIndex == 0)
return 0;
+ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV &&
+ dev->data.hostdev->parent.type != VIR_DOMAIN_DEVICE_NONE) {
+ /* This hostdev is a child of a higher level device
+ * (e.g. interface), and thus already being counted on the
+ * list for the other device type.
+ */
+ return 0;
+ }
if (virAsprintf(&order, "%u", info->bootIndex) < 0)
goto cleanup;
--
2.14.4
6 years, 1 month
[libvirt] [PATCH] qemuDomainNamespaceTeardownHostdev: Drop useless check
by Michal Privoznik
There is no need to check if @npaths is not zero. Let's
qemuDomainNamespaceUnlinkPaths() handle that.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 05e90c3615..d43b6978ad 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -12606,8 +12606,7 @@ qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm,
&npaths, &paths, NULL) < 0)
goto cleanup;
- if (npaths != 0 &&
- qemuDomainNamespaceUnlinkPaths(vm, (const char **)paths, npaths) < 0)
+ if (qemuDomainNamespaceUnlinkPaths(vm, (const char **)paths, npaths) < 0)
goto cleanup;
ret = 0;
--
2.16.4
6 years, 1 month
[libvirt] [PATCH] nwfilter:fix deadlock when nwfilter reload
by Wang Yechao
user run "firewalld-cmd --reload"
nwfilterStateReload called in main thread
step 1. virRWLockWrite(&updateLock)
step 2. virNWFilterLoadAllConfigs
step 3. virRWLockUnlock(&updateLock);
lauch a vm: qemuDomainCreateXML runs in other thread
step 1. virRWLockRead(&updateLock);
step 2. qemuProcessStart
step 3. qemuProcessWaitForMonitor
step 4. ...
step 5 virRWLockUnlock(&updateLock);
if nwfilterStateReload called in the middle of step 1 and step 5 of
qemuDomainCreateXML, it can't get the updateLock and then block the event_loop,
so event_loop can't handle the qemu-monitor messages, cause deadlock
move nwfilterStateReload into thread to fix this problem.
Signed-off-by: Wang Yechao <wang.yechao255(a)zte.com.cn>
Reviewed-by: Wang Yi <wang.yi59(a)zte.com.cn>
---
src/nwfilter/nwfilter_driver.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
mode change 100644 => 100755 src/nwfilter/nwfilter_driver.c
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
old mode 100644
new mode 100755
index ac3a964..2c099e2
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -81,17 +81,28 @@ static void nwfilterDriverUnlock(void)
#if HAVE_FIREWALLD
+static void nwfilterThread(void *opaque ATTRIBUTE_UNUSED)
+{
+ nwfilterStateReload();
+}
+
static DBusHandlerResult
nwfilterFirewalldDBusFilter(DBusConnection *connection ATTRIBUTE_UNUSED,
DBusMessage *message,
void *user_data ATTRIBUTE_UNUSED)
{
+ virThread thread;
+
if (dbus_message_is_signal(message, DBUS_INTERFACE_DBUS,
"NameOwnerChanged") ||
dbus_message_is_signal(message, "org.fedoraproject.FirewallD1",
"Reloaded")) {
VIR_DEBUG("Reload in nwfilter_driver because of firewalld.");
- nwfilterStateReload();
+
+ /* create thread handle the nwfilter reload, don't block the event_loop.*/
+ if (virThreadCreate(&thread, false, nwfilterThread, NULL) < 0) {
+ VIR_ERROR("create nwfilterThread failed.");
+ }
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
--
1.8.3.1
6 years, 1 month
[libvirt] [PATCHv2 0/4] Add virNetlinkNewLink for simplifying virNetDev*Create
by Shi Lei
Patch v1 here:
https://www.redhat.com/archives/libvir-list/2018-August/msg01413.html
Shi Lei (4):
1/4: Introduce virNetlinkNewLink
(Since v1)
- Remove callback and just use special-case to handle macvlan
in virNetlinkNewLink
- Add struct virNetlinkNewLinkData to pack some arguments of
virNetlinkNewLink
2/4: Add wrapper macros around nla_nest*/nla_put* to make code more readable
(New patch)
- Add wrapper macros according to the code written by Erik
- Apply these macros to virNetlinkNewLink and virNetDevSetVfConfig
and virNetDevVPortProfileOpSetLink
3/4: Using virNetlinkNewLink to simplify virNetDev*Create
(Since v1)
- Remove the callback for macvlan in virnetdevmacvlan.c
4/4: Remove virNetDevPutExtraHeader and replace with nlmsg_append
(New patch)
src/libvirt_private.syms | 1 +
src/util/virnetdev.c | 98 ++++++++---------------
src/util/virnetdevbridge.c | 78 ++++---------------
src/util/virnetdevmacvlan.c | 109 ++++----------------------
src/util/virnetdevvportprofile.c | 117 +++++++++-------------------
src/util/virnetlink.c | 130 +++++++++++++++++++++++++------
src/util/virnetlink.h | 65 ++++++++++++++++
7 files changed, 270 insertions(+), 328 deletions(-)
--
2.17.1
6 years, 1 month
[libvirt] [PATCH] nwfilter:fix deadlock when nwfilter reload
by Wang Yechao
user run "firewalld-cmd --reload"
nwfilterStateReload called in main thread
step 1. virRWLockWrite(&updateLock)
step 2. virNWFilterLoadAllConfigs
step 3. virRWLockUnlock(&updateLock);
lauch a vm: qemuDomainCreateXML runs in other thread
step 1. virRWLockRead(&updateLock);
step 2. qemuProcessStart
step 3. qemuProcessWaitForMonitor
step 4. ...
step 5 virRWLockUnlock(&updateLock);
if nwfilterStateReload called in the middle of step 1 and step 5 of
qemuDomainCreateXML, it can't get the updateLock and then block the event_loop,
so event_loop can't handle the qemu-monitor messages, cause deadlock
move nwfilterStateReload into thread to fix this problem.
Signed-off-by: Wang Yechao <wang.yechao255(a)zte.com.cn>
Reviewed-by: Wang Yi <wang.yi59(a)zte.com.cn>
---
src/nwfilter/nwfilter_driver.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
mode change 100644 => 100755 src/nwfilter/nwfilter_driver.c
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
old mode 100644
new mode 100755
index ac3a964..2c099e2
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -81,17 +81,28 @@ static void nwfilterDriverUnlock(void)
#if HAVE_FIREWALLD
+static void nwfilterThread(void *opaque ATTRIBUTE_UNUSED)
+{
+ nwfilterStateReload();
+}
+
static DBusHandlerResult
nwfilterFirewalldDBusFilter(DBusConnection *connection ATTRIBUTE_UNUSED,
DBusMessage *message,
void *user_data ATTRIBUTE_UNUSED)
{
+ virThread thread;
+
if (dbus_message_is_signal(message, DBUS_INTERFACE_DBUS,
"NameOwnerChanged") ||
dbus_message_is_signal(message, "org.fedoraproject.FirewallD1",
"Reloaded")) {
VIR_DEBUG("Reload in nwfilter_driver because of firewalld.");
- nwfilterStateReload();
+
+ /* create thread handle the nwfilter reload, don't block the event_loop.*/
+ if (virThreadCreate(&thread, false, nwfilterThread, NULL) < 0) {
+ VIR_ERROR("create nwfilterThread failed.");
+ }
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
--
1.8.3.1
6 years, 1 month
[libvirt] [PATCH] qemu: Fix indentation in virDomainDefFormatInternal
by Jiri Denemark
Broken by v3.10.0-68-gaed3d038a6.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/conf/domain_conf.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 86199623cc..6aa5ff51b4 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -27582,10 +27582,10 @@ virDomainDefFormatInternal(virDomainDefPtr def,
* but no leading indentation before the starting element.
* Thankfully, libxml maps what looks like globals into
* thread-local uses, so we are thread-safe. */
- xmlIndentTreeOutput = 1;
- xmlbuf = xmlBufferCreate();
- if (xmlNodeDump(xmlbuf, def->metadata->doc, def->metadata,
- virBufferGetIndent(buf, false) / 2, 1) < 0) {
+ xmlIndentTreeOutput = 1;
+ xmlbuf = xmlBufferCreate();
+ if (xmlNodeDump(xmlbuf, def->metadata->doc, def->metadata,
+ virBufferGetIndent(buf, false) / 2, 1) < 0) {
xmlBufferFree(xmlbuf);
xmlIndentTreeOutput = oldIndentTreeOutput;
goto error;
--
2.18.0
6 years, 1 month
[libvirt] [PATCH v5 0/4] Add .domainGetHostname() support for QEMU driver.
by Julio Faracco
This serie adds a new function into QEMU Guest Agent handler to use the
QEMU command 'guest-get-host-name' to retrieve the domain hostname. This
approach requires QEMU-GA running inside the guest, but it is the fastest
and easiest way to get this info.
This serie has some suggestion made by John Ferlan for v3. Specially,
some improvements to error handling.
v5:
Contains news suggested by Han Han on v2.
Contains improvements suggested by John on v3.
Removes some tabs reported on v4.
Julio Faracco (4):
qemu: implementing qemuAgentGetHostname() function.
qemu: adding domainGetHostname support for QEMU
docs: Add QEMU-GA get hostname feature into news.xml
qemu: unlink the error report from VIR_STRDUP.
docs/news.xml | 10 +++++++
src/qemu/qemu_agent.c | 66 ++++++++++++++++++++++++++++++++++++++----
src/qemu/qemu_agent.h | 4 +++
src/qemu/qemu_driver.c | 42 +++++++++++++++++++++++++++
4 files changed, 116 insertions(+), 6 deletions(-)
--
2.17.1
6 years, 1 month
[libvirt] [PATCH v2 0/7] qemu: Unify generation of command line for virtio devices
by Andrea Bolognani
Or, how to turn a single patch into a seven patches series
using the astounding power of review comments!
Andrea Bolognani (7):
tests: Add missing virtio-input capabilities
qemu: Check type range for virtio-input devices
qemu: Remove duplicated option formatting for virtio devices
qemu: Always format iothread for virtio-blk
qemu: Check for virtio-input capabilites at validate time
qemu: Refactor virtio-input capabilities checks
qemu: Unify generation of command line for virtio devices
src/qemu/qemu_command.c | 227 +++++++++++++++++-----------------------
src/qemu/qemu_domain.c | 58 +++++++++-
tests/qemuxml2xmltest.c | 24 ++++-
3 files changed, 173 insertions(+), 136 deletions(-)
--
2.17.1
6 years, 1 month