[libvirt] [PATCH] qemuBuildVideoCommandLine: Don't access def->videos without check
by Michal Privoznik
This function can be called over a domain definition that has no
video configured. The
tests/qemuxml2argvdata/qemuxml2argv-minimal.xml file could serve
as an example. Problem is, before the check that domain has some
or none video configured, def->videos is dereferenced causing a
segmentation fault in case there's none video configured.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ba8c216..32d32b1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3809,7 +3809,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
virQEMUCapsPtr qemuCaps)
{
size_t i;
- int primaryVideoType = def->videos[0]->type;
+ int primaryVideoType;
if (!def->nvideos) {
/* If we have -device, then we set -nodefaults already */
@@ -3819,6 +3819,8 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
return 0;
}
+ primaryVideoType = def->videos[0]->type;
+
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY) &&
((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA)) ||
--
2.4.10
9 years, 3 months
[libvirt] Enhancement: Random Clock Offset
by bancfc@openmailbox.org
For better system anonymity (to decouple VM OS timestamps leaked in
traffic from host ones) a feature can be added to the clock offset
variable to select randomly from a specified range of seconds from
instead of a fixed number of seconds. That way a guest's clock can vary
unpredictably from the host's and confuse correlation by network
adversaries.
Full Disclosure: I am from the Tor centric Whonix Project - whonix.org
and this would be a very useful feature for us.
9 years, 3 months
[libvirt] [PATCH REPOST 0/9] Reorganize qemu_command.c in smaller piles
by John Ferlan
Rather than hope for a review of 25 patches or creating some remote
place to place a branch - I'll repost the original:
http://www.redhat.com/archives/libvir-list/2016-February/msg00975.html
in smaller chunks. No differences in these patches other than a rebase
to top of tree a short while ago (commit id 'cf091094a'). There were also
no conflicts from changes since initial posting.
John Ferlan (9):
qemu: Introduce qemuBuildClockCommandLine
qemu: Introduce qemuBuildPMCommandLine
qemu: Introduce qemuBuildBootCommandLine
qemu: Introduce qemuBuildGlobalControllerCommandLine
qemu: Introduce qemuBuildControllerDevCommandLine
qemu: Introduce qemuBuildHubCommandLine
qemu: Introduce qemuBuildDiskDriveCommandLine
qemu: Introduce qemuBuildFSDevCommandLine
qemu: Introduce qemuBuildNetCommandLine
src/conf/domain_conf.c | 14 +-
src/conf/domain_conf.h | 8 +-
src/qemu/qemu_command.c | 5488 +++++++++++++++++++++-------------------
src/qemu/qemu_command.h | 15 +-
src/qemu/qemu_domain_address.c | 2 +-
src/qemu/qemu_domain_address.h | 2 +-
6 files changed, 2843 insertions(+), 2686 deletions(-)
--
2.5.0
9 years, 3 months
[libvirt] [PATCH 0/2] Fix building with clang (again)
by Martin Kletzander
*** SOME VERY RANDOM BLURB HERE ***
Martin Kletzander (2):
Skip pdwtags-related tests when compiling with clang
Fix build with clang
src/Makefile.am | 4 +++-
tests/qemuxml2argvmock.c | 28 ++++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletion(-)
--
2.7.3
9 years, 3 months
[libvirt] any better way to treat device-detach timeout ?
by Zhangbo (Oscar)
Hi,all:
I find that we remove devices only after DEVICE_DELETED event.(patch:3fbf78bd).
And it treats TIMEOUT as success. The detailed codes are shown as below:
rc = qemuDomainWaitForDeviceRemoval(vm);
if (rc == 0 || rc == 1)
ret = qemuDomainRemoveDiskDevice(driver, vm, detach);
else
ret = 0;
Here comes the problem:
If
1. We pass flags=3(VIR_DOMAIN_AFFECT_LIVE|VIR_DOMAIN_AFFECT_CONFIG) to virDomainDetachDeviceFlags,
2. It timed out to receive DEVICE_DELETED event, virDomainDetachDeviceFlags api will return 0(succeed).
Please be aware that: vm->newdef(persistent) removes the device while vm->def(transient) keeps it untouched.
3. Then we try to attach the same device with flag 3, because it differs in newDef and def, the API virDomainDetachDeviceFlags() returns ERROR.
Consequent attach/detach jobs all fail after then.
So, shall we make it return FAIL when it fails in qemuDomainWaitForDeviceRemoval()? Or just remove the device in def after we get the DEVICE_DELETED event?
Any ideas, thanks!
9 years, 3 months
[libvirt] [PATCH REPOST 0/8] Reorganize qemu_command.c in smaller piles (round 2)
by John Ferlan
Rather than hope for a review of 25 patches or creating some remote
place to place a branch - I'll repost the original:
http://www.redhat.com/archives/libvir-list/2016-February/msg00975.html
in smaller chunks. Differences in this set of patches vs. original series
includes handling merge conflicts for logManager series plus a few minor
edits/tweaks for better formatting/flow. This series was based off of
git head commit 'ef2ab8fdc' which is the round 1 of the split:
http://www.redhat.com/archives/libvir-list/2016-March/msg00288.html
John Ferlan (8):
qemu: Introduce qemuBuildSmartcardCommandLine
qemu: Introduce qemuBuildSerialCommandLine
qemu: Introduce qemuBuildParallelsCommandLine
qemu: Introduce qemuBuildChannelsCommandLine
qemu: Introduce qemuBuildConsoleCommandLine
qemu: Modify qemuBuildTPMCommandLine
qemu: Introduce qemuBuildInputCommandLine
qemu: Introduce qemuBuildVideoCommandLine
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_command.c | 1410 +++++++++++++++++++++++-------------------
src/qemu/qemu_command.h | 6 +-
4 files changed, 760 insertions(+), 660 deletions(-)
--
2.5.0
9 years, 3 months
[libvirt] [libvirt-glib v2 0/9] gconfig: Add hostdev support
by Christophe Fergeau
Hey,
While reviewing Zeeshan's libvirt-gconfig hostdev series, I fixed up a few
things, and added a few additional helpers/getters in order to simplify the
code/make the test case more complete.
This series contains this new code. The changes I made to Zeeshan's initial
patches are in separate fixup! commits to make reviewing them easier (for you Zeeshan ;).
I expect these to be squashed in the main commits before being pushed.
Zeeshan's commits are unchanged from v1.
Christophe
9 years, 3 months
[libvirt] [libvirt-glib v3 1/5] gconfig: Add gvir_config_object_has_child
by Christophe Fergeau
---
libvirt-gconfig/libvirt-gconfig-object-private.h | 2 ++
libvirt-gconfig/libvirt-gconfig-object.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-object-private.h b/libvirt-gconfig/libvirt-gconfig-object-private.h
index e91c4ef..7a0d21f 100644
--- a/libvirt-gconfig/libvirt-gconfig-object-private.h
+++ b/libvirt-gconfig/libvirt-gconfig-object-private.h
@@ -117,6 +117,8 @@ GVirConfigObject *gvir_config_object_get_child(GVirConfigObject *object,
GVirConfigObject *gvir_config_object_get_child_with_type(GVirConfigObject *object,
const gchar *child_name,
GType child_type);
+gboolean gvir_config_object_has_child(GVirConfigObject *object,
+ const gchar *child_name);
G_END_DECLS
diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
index bf328f3..6225de2 100644
--- a/libvirt-gconfig/libvirt-gconfig-object.c
+++ b/libvirt-gconfig/libvirt-gconfig-object.c
@@ -970,3 +970,16 @@ gvir_config_object_get_child(GVirConfigObject *object,
child_name,
GVIR_CONFIG_TYPE_OBJECT);
}
+
+G_GNUC_INTERNAL gboolean
+gvir_config_object_has_child(GVirConfigObject *object, const gchar *child_name)
+{
+ xmlNodePtr node;
+
+ g_return_val_if_fail(GVIR_CONFIG_IS_OBJECT(object), FALSE);
+ g_return_val_if_fail(child_name != NULL, FALSE);
+
+ node = gvir_config_xml_get_element(object->priv->node, child_name, NULL);
+
+ return (node != NULL);
+}
--
2.5.0
9 years, 3 months