[libvirt] [PATCH 0/5] Fix a couple of force snapshot revert issues
by John Ferlan
Well, at least I hope so. There's a couple of related bz's in
the last two patches with gobs more details, but the long and
short of it is that when using the force flag, the domain is
Stop'd and re-Start'd without applying any snapshot. For both
issues I've seen, the "error: internal error: unexpected async
job 6" occurs on the Start and thus the CPU's aren't started.
For one bz, when running managedsave the call never returns.
For the other bz, one cannot restart the paused domain.
If there's a better way to do this - I'm sure someone will
let me know.
John Ferlan (5):
qemu: Adjust async job failure message
qemu: Promote start_flags in qemuDomainRevertToSnapshot
qemu: Use start_flags for RUNNING and PAUSED transitions
qemu: Unset the genid start change flag for revert force
qemu: Don't use asyncJob after stop during snapshot revert
src/qemu/qemu_domain.c | 3 ++-
src/qemu/qemu_driver.c | 22 +++++++++++++++-------
2 files changed, 17 insertions(+), 8 deletions(-)
--
2.14.4
6 years, 4 months
[libvirt] [PATCH 0/6] qemu: command: Replace vlan= with netdev=
by Cole Robinson
Most VMs libvirt knows how to launch will have qemu network config like:
-netdev $NETDEV_OPTS,id=netdev1 -device e1000,id=netdev1
However for machine types with built-in platform network devices, we
currently do:
-net nic,model=e1000,vlan=1 -net $NETDEV_OPTS,vlan=1
However for the platform case, all qemu versions we support can do:
-netdev $NETDEV_OPTS,id=netdev1 -net nic,model=e1000,netdev=netdev1
Which simplifies our code, and is more future proof as qemu has
deprecated the vlan= option. This series switches to the netdev=
method, and performs some cleanups in related code.
Thanks,
Cole
Cole Robinson (6):
qemu: command: Make qemuBuildNicStr static
qemu: command: Rename BuildNicStr to BuildLegacyNicStr
qemu: command: remove unused LegacyNicStr arg 'prefix'
qemu: command: replace vlan= with netdev= for legacy nic
qemu: Remove vlan function arguments
qemu: command: vhost: cleanup error reporting
src/qemu/qemu_command.c | 99 ++++++-------------
src/qemu/qemu_command.h | 8 --
src/qemu/qemu_hotplug.c | 3 +-
.../arm-vexpressa9-basic.args | 4 +-
4 files changed, 33 insertions(+), 81 deletions(-)
--
2.17.1
6 years, 4 months
[libvirt] [PATCH 0/4] qemu: add comma escaping in qemu_command.c
by Anya Harter
The function virQEMUBuildBufferEscapeComma is used to escape commas in
user provided fields for qemu command line processing in the four
functions listed below.
A corresponding test for each comma escaping instance has been added to
tests/qemuxml2argvdata/name-escape.xml.
This should complete the BiteSizedTask entry at
https://wiki.libvirt.org/page/BiteSizedTasks#qemu:_Use_comma_escaping_for....
Anya Harter (4):
qemu: Escape commas for qemuBuildChrChardevStr
qemu: Escape commas for qemuBuildChrChardevFileStr
qemu: Escape commas for qemuBuildSmartcardCommandLine
qemu: Escape commas for qemuBuildGrapicsSPICECommandLine
src/qemu/qemu_command.c | 44 +++++++++++--------------
tests/qemuxml2argvdata/name-escape.args | 14 ++++++--
tests/qemuxml2argvdata/name-escape.xml | 18 ++++++++++
tests/qemuxml2argvtest.c | 10 +++++-
4 files changed, 58 insertions(+), 28 deletions(-)
--
2.17.1
6 years, 4 months
[libvirt] [PATCH v3 0/4] qemu: Allow concurrent access to monitor and guest agent
by Michal Privoznik
v3 of:
https://www.redhat.com/archives/libvir-list/2018-June/msg01358.html
Patches 1/4 and 2/4 are ACKed already. Patch 3/4 is new and implements
agent job acquiring when doing snapshots (as suggested by Jirka in his
review). Patch 4/4 is written differently (again as suggested by him)
although the semantic is the same as in previous version of the patch.
Michal Privoznik (4):
qemu: Introduce qemuDomainAgentJob
qemu: Introduce APIs for manipulating qemuDomainAgentJob
qemuDomainSnapshotCreateActiveExternal: Grab agent job
qemu: Switch code to use new agent job APIs
src/qemu/THREADS.txt | 112 +++++++++++++++++++++++---
src/qemu/qemu_domain.c | 211 ++++++++++++++++++++++++++++++++++++++++---------
src/qemu/qemu_domain.h | 30 +++++++
src/qemu/qemu_driver.c | 124 ++++++++++++++++++++---------
4 files changed, 390 insertions(+), 87 deletions(-)
--
2.16.4
6 years, 4 months
[libvirt] [PATCH 0/2] Fixes for segfault and deadlock
by Marc Hartmayer
One way to reproduce the bugs is to set admin_max_workers=0 in
libvirtd.conf, restart libvirtd, and then call:
$ virt-admin server-threadpool-info admin
Marc Hartmayer (2):
rpc: Fix deadlock if there is no worker pool available
rpc: Fix segmentation fault when no worker pool is available
src/rpc/virnetserver.c | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
--
2.13.6
6 years, 4 months
[libvirt] [PATCH v2] qemu: fix msg could be a wild pointer in qemuMonitorIOProcess()
by Weilun Zhu
As qemuMonitorJSONIOProcess() will unlock the qemu monitor, there is
some extreme situation, eg qemu send message to monitor twice in a short
time, where the local viriable 'msg' of qemuMonitorIOProcess() could be
a wild point:
1. qemuMonitorSend() assign mon->msg to parameter 'msg', which is alse a
local variable of its caller qemuMonitorJSONCommandWithFd(), cause
eventloop to send message to monitor, then wait condition.
2. qemu send message to monitor for the first time immediately.
3. qemuMonitorIOProcess() is called, then wake up the qemuMonitorSend()
thread, but the qemuMonitorSend() thread stuck for a while as cpu pressure
or some other reasons,, which means the qemu monitor is still unlocked.
4. qemu send event message to monitor for the second time,
such as RTC_CHANGE event
5. qemuMonitorIOProcess() is called, the local viriable 'msg' is
assigned to mon->msg.
6. qemuMonitorIOProcess() call qemuMonitorJSONIOProcess() to deal with
the qemu event.
7. qemuMonitorJSONIOProcess() unlock the qemu monitor in the macro
'QEMU_MONITOR_CALLBACK', then qemuMonitorSend() thread get the mutex
and free the mon->msg, assign mon->msg to NULL.
so the local viriable 'msg' of qemuMonitorIOProcess() is a wild pointer
now.
AFAIK, it is not harmful to call again virCondBroadcast() while msg is a
wild pointer, but just in case, we fix it in this patch.
---
src/qemu/qemu_monitor.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 215135aa3e..a4b8572e24 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -463,6 +463,14 @@ qemuMonitorIOProcess(qemuMonitorPtr mon)
#if DEBUG_IO
VIR_DEBUG("Process done %d used %d", (int)mon->bufferOffset, len);
#endif
+
+ /* As the monitor mutex was unlocked in qemuMonitorJSONIOProcess()
+ * while dealing with qemu event, mon->msg could be changed,
+ * thus we re-acquire the msg here */
+ msg = NULL;
+ if (mon->msg && mon->msg->txOffset == mon->msg->txLength) {
+ msg = mon->msg;
+
if (msg && msg->finished)
virCondBroadcast(&mon->notify);
return len;
--
2.18.0.rc1
6 years, 4 months
Re: [libvirt] [Qemu-devel] [PATCH v7 1/3] qmp: adding 'wakeup-suspend-support' in query-target
by Markus Armbruster
Cc'ing a few more people.
Daniel Henrique Barboza <danielhb(a)linux.ibm.com> writes:
> When issuing the qmp/hmp 'system_wakeup' command, what happens in a
> nutshell is:
>
> - qmp_system_wakeup_request set runstate to RUNNING, sets a wakeup_reason
> and notify the event
> - in the main_loop, all vcpus are paused, a system reset is issued, all
> subscribers of wakeup_notifiers receives a notification, vcpus are then
> resumed and the wake up QAPI event is fired
>
> Note that this procedure alone doesn't ensure that the guest will awake
> from SUSPENDED state - the subscribers of the wake up event must take
> action to resume the guest, otherwise the guest will simply reboot.
>
> At this moment there are only two subscribers of the wake up event: one
> in hw/acpi/core.c and another one in hw/i386/xen/xen-hvm.c. This means
> that system_wakeup does not work as intended with other architectures.
>
> However, only the presence of 'system_wakeup' is required for QGA to
> support 'guest-suspend-ram' and 'guest-suspend-hybrid' at this moment.
> This means that the user/management will expect to suspend the guest using
> one of those suspend commands and then resume execution using system_wakeup,
> regardless of the support offered in system_wakeup in the first place.
>
> This patch adds a new flag called 'wakeup-suspend-support' in TargetInfo
> that allows the caller to query if the guest supports wake up from
> suspend via system_wakeup. It goes over the subscribers of the wake up
> event and, if it's empty, it assumes that the guest does not support
> wake up from suspend (and thus, pm-suspend itself).
>
> This is the expected output of query-target when running a x86 guest:
>
> {"execute" : "query-target"}
> {"return": {"arch": "x86_64", "wakeup-suspend-support": true}}
>
> This is the output when running a pseries guest:
>
> {"execute" : "query-target"}
> {"return": {"arch": "ppc64", "wakeup-suspend-support": false}}
>
> Given that the TargetInfo structure is read-only, adding a new flag to
> it is backwards compatible. There is no need to deprecate the old
> TargetInfo format.
>
> With this extra tool, management can avoid situations where a guest
> that does not have proper suspend/wake capabilities ends up in
> inconsistent state (e.g.
> https://github.com/open-power-host-os/qemu/issues/31).
>
> Reported-by: Balamuruhan S <bala24(a)linux.vnet.ibm.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.ibm.com>
Is query-target is the right place to carry this flag? v7 is rather
late for this kind of question; my sincere apologies.
The flag is true after qemu_register_wakeup_notifier(). Callers so far:
* piix4_pm_realize() via acpi_pm1_cnt_init()
This is the realize method of device PIIX4_PM. It's an optional
onboard device (suppressed by -no-acpi) of machine types
pc-i440fx-VERSION, pc-VERSION, malta.
* pc_q35_init() via ich9_lpc_pm_init(), ich9_pm_init(),
acpi_pm1_cnt_init()
This is the initialization method of machine types pc-q35-VERSION.
Note that -no-acpi is not honored.
* vt82c686b_pm_realize() via acpi_pm1_cnt_init()
This is the realize method of device VT82C686B_PM. It's an onboard
device of machine type fulong2e. Again, -no-acpi is not honored.
* xen_hvm_init()
This one gets called with -accel xen. I suspect the actual callback
xen_wakeup_notifier() doesn't actually make wakeup work, unlike the
acpi_notify_wakeup() callback registered by the other callers.
Issue#1: this calls into question your assumption that the existence
of a wake-up notifier implies wake-up works. It still holds if
--accel xen is only accepted together with other configuration that
triggers registration of acpi_notify_wakeup(). Is it? Stefano,
Anthony?
Issue#2: the flag isn't a property of the target. Due to -no-acpi, it's
not even a property of the machine type. If it was, query-machines
would be the natural owner of the flag.
Perhaps query-machines is still the proper owner. The value of
wakeup-suspend-support would have to depend on -no-acpi for the machine
types that honor it. Not ideal; I'd prefer MachineInfo to be static.
Tolerable? I guess that's also a libvirt question.
6 years, 4 months
[libvirt] [dbus PATCH] maint: fix coding style
by Katerina Koukiou
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
src/connect.c | 12 ++++++------
src/domain.c | 2 +-
src/events.c | 24 ++++++++++++------------
src/network.c | 2 +-
src/util.c | 6 +++---
src/util.h | 4 ++--
6 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/src/connect.c b/src/connect.c
index 2e57d69..09e5628 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -1187,12 +1187,12 @@ virtDBusConnectNWFilterDefineXML(GVariant *inArgs,
static void
virtDBusConnectNWFilterLookupByName(GVariant *inArgs,
- GUnixFDList *inFDs G_GNUC_UNUSED,
- const gchar *objectPath G_GNUC_UNUSED,
- gpointer userData,
- GVariant **outArgs,
- GUnixFDList **outFDs G_GNUC_UNUSED,
- GError **error)
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath G_GNUC_UNUSED,
+ gpointer userData,
+ GVariant **outArgs,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
{
virtDBusConnect *connect = userData;
g_autoptr(virNWFilter) nwfilter = NULL;
diff --git a/src/domain.c b/src/domain.c
index 4aeb855..5c5e6da 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -2189,7 +2189,7 @@ virtDBusDomainMigrateToURI3(GVariant *inArgs,
virtDBusConnect *connect = userData;
g_autoptr(virDomain) domain = NULL;
g_autoptr(GVariantIter) iter = NULL;
- const gchar* dconuri;
+ const gchar *dconuri;
g_auto(virtDBusUtilTypedParams) params = { 0 };
guint flags;
diff --git a/src/events.c b/src/events.c
index 7cdc71d..e635a61 100644
--- a/src/events.c
+++ b/src/events.c
@@ -546,10 +546,10 @@ virtDBusEventsDomainDiskChange(virConnectPtr connection G_GNUC_UNUSED,
static gint
virtDBusEventsNetworkEvent(virConnectPtr connection G_GNUC_UNUSED,
- virNetworkPtr network,
- gint event,
- gint detail G_GNUC_UNUSED,
- gpointer opaque)
+ virNetworkPtr network,
+ gint event,
+ gint detail G_GNUC_UNUSED,
+ gpointer opaque)
{
virtDBusConnect *connect = opaque;
g_autofree gchar *path = NULL;
@@ -592,10 +592,10 @@ virtDBusEventsNodeDeviceEvent(virConnectPtr connection G_GNUC_UNUSED,
static gint
virtDBusEventsSecretEvent(virConnectPtr connection G_GNUC_UNUSED,
- virSecretPtr secret,
- gint event,
- gint detail,
- gpointer opaque)
+ virSecretPtr secret,
+ gint event,
+ gint detail,
+ gpointer opaque)
{
virtDBusConnect *connect = opaque;
g_autofree gchar *path = NULL;
@@ -615,10 +615,10 @@ virtDBusEventsSecretEvent(virConnectPtr connection G_GNUC_UNUSED,
static gint
virtDBusEventsStoragePoolEvent(virConnectPtr connection G_GNUC_UNUSED,
- virStoragePoolPtr storagePool,
- gint event,
- gint detail,
- gpointer opaque)
+ virStoragePoolPtr storagePool,
+ gint event,
+ gint detail,
+ gpointer opaque)
{
virtDBusConnect *connect = opaque;
g_autofree gchar *path = NULL;
diff --git a/src/network.c b/src/network.c
index 1bacb81..3957ee6 100644
--- a/src/network.c
+++ b/src/network.c
@@ -235,7 +235,7 @@ virtDBusNetworkGetDHCPLeases(GVariant *inArgs,
g_variant_builder_add(&builder, "(sxisssuss)",
lease->iface, lease->expirytime,
lease->type, lease->mac,
- lease->iaid ? lease->iaid : "" ,
+ lease->iaid ? lease->iaid : "",
lease->ipaddr, lease->prefix,
lease->hostname ? lease->hostname : "",
lease->clientid ? lease->clientid : "");
diff --git a/src/util.c b/src/util.c
index a1b29dd..8c822f2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -348,8 +348,8 @@ virtDBusUtilVirNodeDeviceListFree(virNodeDevicePtr *devs)
virNWFilterPtr
virtDBusUtilVirNWFilterFromBusPath(virConnectPtr connection,
- const gchar *path,
- const gchar *nwfilterPath)
+ const gchar *path,
+ const gchar *nwfilterPath)
{
g_autofree gchar *name = NULL;
gsize prefixLen = strlen(nwfilterPath) + 1;
@@ -361,7 +361,7 @@ virtDBusUtilVirNWFilterFromBusPath(virConnectPtr connection,
gchar *
virtDBusUtilBusPathForVirNWFilter(virNWFilterPtr nwfilter,
- const gchar *nwfilterPath)
+ const gchar *nwfilterPath)
{
gchar uuid[VIR_UUID_STRING_BUFLEN] = "";
g_autofree gchar *newUuid = NULL;
diff --git a/src/util.h b/src/util.h
index 7db0e25..a688a3d 100644
--- a/src/util.h
+++ b/src/util.h
@@ -67,8 +67,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainStatsRecordPtr, virDomainStatsRecordListF
virNetworkPtr
virtDBusUtilVirNetworkFromBusPath(virConnectPtr connection,
- const gchar *path,
- const gchar *networkPath);
+ const gchar *path,
+ const gchar *networkPath);
gchar *
virtDBusUtilBusPathForVirNetwork(virNetworkPtr network,
--
2.15.0
6 years, 4 months
[libvirt] [PATCH] conf: Remove unused virDomainDefNewFull
by Cole Robinson
The last usages were removed with the xend driver in 1dac5fbbbb0
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/conf/domain_conf.c | 22 ----------------------
src/conf/domain_conf.h | 3 ---
src/libvirt_private.syms | 1 -
3 files changed, 26 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 522e0c2bf3..f0b604e125 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3241,28 +3241,6 @@ virDomainDefNew(void)
}
-virDomainDefPtr
-virDomainDefNewFull(const char *name,
- const unsigned char *uuid,
- int id)
-{
- virDomainDefPtr def;
-
- if (!(def = virDomainDefNew()))
- return NULL;
-
- if (VIR_STRDUP(def->name, name) < 0) {
- VIR_FREE(def);
- return NULL;
- }
-
- memcpy(def->uuid, uuid, VIR_UUID_BUFLEN);
- def->id = id;
-
- return def;
-}
-
-
void virDomainObjAssignDef(virDomainObjPtr domain,
virDomainDefPtr def,
bool live,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 6344c02d1c..8cefef535a 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2919,9 +2919,6 @@ virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt);
virDomainChrDefPtr virDomainChrDefNew(virDomainXMLOptionPtr xmlopt);
virDomainDefPtr virDomainDefNew(void);
-virDomainDefPtr virDomainDefNewFull(const char *name,
- const unsigned char *uuid,
- int id);
void virDomainObjAssignDef(virDomainObjPtr domain,
virDomainDefPtr def,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index ea24f2847c..98913a577a 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -287,7 +287,6 @@ virDomainDefMaybeAddController;
virDomainDefMaybeAddInput;
virDomainDefNeedsPlacementAdvice;
virDomainDefNew;
-virDomainDefNewFull;
virDomainDefParseFile;
virDomainDefParseNode;
virDomainDefParseString;
--
2.17.1
6 years, 4 months