[libvirt] [PATCH] Avoid variable named 'stat'
by Daniel P. Berrange
Using a variable named 'stat' clashes with the system function
'stat()' causing compiler warnings on some platforms
cc1: warnings being treated as errors
../../src/qemu/qemu_monitor_text.c: In function 'parseMemoryStat':
../../src/qemu/qemu_monitor_text.c:604: error: declaration of 'stat' shadows a global declaration [-Wshadow]
/usr/include/sys/stat.h:455: error: shadowed declaration is here [-Wshadow]
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
Pushed as a build fix.
src/qemu/qemu_monitor_text.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index a2a5885..bc83218 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -601,7 +601,7 @@ int qemuMonitorTextGetVirtType(qemuMonitorPtr mon,
static int parseMemoryStat(char **text, unsigned int tag,
- const char *search, virDomainMemoryStatPtr stat)
+ const char *search, virDomainMemoryStatPtr mstat)
{
char *dummy;
unsigned long long value;
@@ -625,8 +625,8 @@ static int parseMemoryStat(char **text, unsigned int tag,
case VIR_DOMAIN_MEMORY_STAT_AVAILABLE:
value >>= 10;
}
- stat->tag = tag;
- stat->val = value;
+ mstat->tag = tag;
+ mstat->val = value;
return 1;
}
return 0;
--
2.9.3
7 years, 11 months
[libvirt] [PATCH] docs: Use href_base in absolute links
by Martin Kletzander
That way all links work even if you click them in a subdirectory.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/page.xsl | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs/page.xsl b/docs/page.xsl
index fcb51916ce25..1d662c670686 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -104,9 +104,9 @@
</div>
<div id="jumplinks">
<ul>
- <li><a href="downloads.html">Download</a></li>
- <li><a href="contribute.html">Contribute</a></li>
- <li><a href="docs.html">Learn</a></li>
+ <li><a href="{$href_base}downloads.html">Download</a></li>
+ <li><a href="{$href_base}contribute.html">Contribute</a></li>
+ <li><a href="{$href_base}docs.html">Learn</a></li>
</ul>
</div>
<div id="search">
@@ -122,8 +122,8 @@
<div id="contact">
<h3>Contact</h3>
<ul>
- <li><a href="contact.html#email">email</a></li>
- <li><a href="contact.html#irc">irc</a></li>
+ <li><a href="{$href_base}contact.html#email">email</a></li>
+ <li><a href="{$href_base}contact.html#irc">irc</a></li>
</ul>
</div>
<div id="community">
@@ -136,7 +136,7 @@
</ul>
</div>
<div id="conduct">
- Participants in the libvirt project agree to abide by <a href="governance.html#codeofconduct">the project code of conduct</a>
+ Participants in the libvirt project agree to abide by <a href="{$href_base}governance.html#codeofconduct">the project code of conduct</a>
</div>
<br class="clear"/>
</div>
--
2.11.0
7 years, 11 months
[libvirt] [PATCH jenkins-ci] Add libvirt-go to build
by Daniel P. Berrange
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
jobs/go.yaml | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
projects/libvirt-go.yaml | 14 ++++++++++
2 files changed, 85 insertions(+)
create mode 100644 jobs/go.yaml
create mode 100644 projects/libvirt-go.yaml
diff --git a/jobs/go.yaml b/jobs/go.yaml
new file mode 100644
index 0000000..ce6f79b
--- /dev/null
+++ b/jobs/go.yaml
@@ -0,0 +1,71 @@
+
+- job-template:
+ id: go-build-job
+ name: '{name}-{branch}-build'
+ project-type: matrix
+ description: '{title} Build'
+ autogen_args: ''
+ workspace: '{name}-{branch}'
+ block-downstream: true
+ block-upstream: true
+ properties:
+ - build-discarder:
+ days-to-keep: 30
+ num-to-keep: 1000
+ scm:
+ - git:
+ url: git://n64.pufty.ci.centos.org/{name}.git
+ branches:
+ - origin/{branch}
+ clean:
+ after: true
+ skip-tag: true
+ wipe-workspace: false
+ triggers:
+ - reverse:
+ jobs: '{obj:parent_jobs}'
+ - pollscm:
+ cron: "H/20 * * * *"
+ axes:
+ - axis:
+ name: systems
+ type: slave
+ values: '{obj:machines}'
+ builders:
+ - shell: |
+ go build -v
+ publishers:
+ - email:
+ recipients: '{obj:spam}'
+ notify-every-unstable-build: true
+ send-to-individuals: false
+
+- job-template:
+ id: go-check-job
+ name: '{name}-{branch}-check'
+ project-type: matrix
+ description: '{title} Check'
+ check_env: ''
+ workspace: '{name}-{branch}'
+ block-downstream: true
+ block-upstream: true
+ properties:
+ - build-discarder:
+ days-to-keep: 30
+ num-to-keep: 1000
+ triggers:
+ - reverse:
+ jobs: '{obj:parent_jobs}'
+ axes:
+ - axis:
+ name: systems
+ type: slave
+ values: '{obj:machines}'
+ builders:
+ - shell: |
+ go test -tags api
+ publishers:
+ - email:
+ recipients: '{obj:spam}'
+ notify-every-unstable-build: true
+ send-to-individuals: false
diff --git a/projects/libvirt-go.yaml b/projects/libvirt-go.yaml
new file mode 100644
index 0000000..8ad7a2e
--- /dev/null
+++ b/projects/libvirt-go.yaml
@@ -0,0 +1,14 @@
+
+- project:
+ name: libvirt-go
+ machines:
+ - libvirt-centos-7
+ - libvirt-fedora-23
+ - libvirt-fedora-24
+ - libvirt-fedora-rawhide
+ title: Libvirt Go
+ jobs:
+ - go-build-job:
+ parent_jobs: 'libvirt-master-build'
+ - go-check-job:
+ parent_jobs: 'libvirt-go-master-build'
--
2.9.3
7 years, 11 months
[libvirt] [PATCH] Deal with gnutls 3.5.6 regression
by Daniel P. Berrange
I was not originally planning to do anything for the gnutls 3.5.6
regression:
https://www.redhat.com/archives/libvir-list/2016-November/msg00816.html
but there's still no immediate sign of the new 3.5.7 release,
so while I still don't want to workaround the bug in libvirt,
we can at least blacklist that version of gnutls in the test
suite, so 'make check' passes on affected systems while we're
waiting for 3.5.7 to arrive.
Daniel P. Berrange (1):
tests: blacklist gnutls 3.5.6 for wildcard tests
tests/virnettlssessiontest.c | 9 +++++++++
1 file changed, 9 insertions(+)
--
2.9.3
7 years, 11 months
[libvirt] [PATCH] qemu: Fix virQEMUCapsFindTarget on ppc64le
by Jiri Denemark
virQEMUCapsFindTarget is supposed to find an alternative QEMU binary if
qemu-system-$GUEST_ARCH doesn't exist. The alternative is using host
architecture when it is compatible with $GUEST_ARCH. But a special
treatment has to be applied for ppc64le since the QEMU binary is always
called qemu-system-ppc64.
Broken by me in v2.2.0-171-gf2e71550d.
https://bugzilla.redhat.com/show_bug.cgi?id=1403745
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 081afc566..f4ca84e98 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -482,13 +482,13 @@ static virArch
virQEMUCapsFindTarget(virArch hostarch,
virArch guestarch)
{
+ if (virQEMUCapsGuestIsNative(hostarch, guestarch))
+ guestarch = hostarch;
+
/* Both ppc64 and ppc64le guests can use the ppc64 target */
if (ARCH_IS_PPC64(guestarch))
guestarch = VIR_ARCH_PPC64;
- if (virQEMUCapsGuestIsNative(hostarch, guestarch))
- guestarch = hostarch;
-
return guestarch;
}
--
2.11.0
7 years, 11 months
[libvirt] [PATCH 0/2] Fix copy-pasta errors in config loading for aux daemons
by Peter Krempa
Apparently the option is not configured very often since nobody figured it out
until now.
Peter Krempa (2):
lock: Fix loading of config file for the lock daemon
log: Fix loading of conf file for log daemon
src/locking/lock_daemon_config.c | 2 +-
src/logging/log_daemon_config.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.11.0
7 years, 11 months
[libvirt] [PATCH for-2.9 00/17] target-i386: Implement query-cpu-model-expansion
by Eduardo Habkost
This series implements query-cpu-model-expansion on target-i386.
QAPI / interface changes
------------------------
When implementing this, I have noticed that the "host" CPU model
in i386 includes some migration-unsafe features that can't be
translated to any migration-safe representation: "pmu", and
"host-cache-info".
To be able to handle the migration-unsafe features, I have
extended the query-cpu-model-expansion definition to be clear
about what happens to those features when the CPU model is
expanded (in short: static expansion removes them, full expansion
keeps them).
I also added "static" and "migration-safe" fields to the return
value of query-cpu-model-expansion, so callers can know if the
the expanded representation is static and migration-safe.
Test code
---------
I have added a Python test script for the feature, that will try
multiple combinations of the expansion operation, and see if the
returned data keeps matches some constratins.
The test script works with the s390x query-cpu-model-expansion
command, except that: 1) I couldn't test it with KVM; 2) qtest.py
error handling when QEMU refuses to run is unreliable (so the
script needs runnability information to be availble in TCG mode,
too, to skip not-runnable CPU models and avoid problems).
Future versions of the test script could run a arch-specific
CPUID-dump guest binary, and validate data seen by the guest
directly. While we don't do that, the script validates all QOM
properties on the CPU objects looking for unexpected changes. At
least in the case of x86, the QOM properties will include lots of
the CPUID data seen by the guest, giving us decent coverage.
Patches from other series
-------------------------
This series includes patches from other series, just to help on
the implementation of the test code:
* "qmp: Report QOM type name on query-cpu-definitions", that
was already submitted for 2.9
* qemu.py, qtest.py, and tests/Makefile.include changes
---
Cc: Cornelia Huck <cornelia.huck(a)de.ibm.com>
Cc: Christian Borntraeger <borntraeger(a)de.ibm.com>
Cc: David Hildenbrand <david(a)redhat.com>
Cc: libvir-list(a)redhat.com
Cc: Jiri Denemark <jdenemar(a)redhat.com>
Cc: "Jason J. Herne" <jjherne(a)linux.vnet.ibm.com>
Cc: Markus Armbruster <armbru(a)redhat.com>
Cc: Richard Henderson <rth(a)twiddle.net>
Cc: Igor Mammedov <imammedo(a)redhat.com>
Cc: Eric Blake <eblake(a)redhat.com>
Eduardo Habkost (17):
qmp: Report QOM type name on query-cpu-definitions
qemu.py: Make logging optional
qtest.py: Support QTEST_LOG environment variable
qtest.py: make logging optional
qtest.py: Make 'binary' parameter optional
tests: Add rules to non-gtester qtest test cases
target-i386: Reorganize and document CPUID initialization steps
target-i386: Support "-cpu host" on TCG too
target-i386: Move "host" properties to base class
target-i386: Allow short strings to be used as vendor ID
target-i386: Remove AMD feature flag aliases from Opteron models
target-i386: Return migration-safe field on query-cpu-definitions
cpu: Support comma escaping when parsing -cpu
qapi: add static/migration-safe info to query-cpu-model-expansion
target-i386: Define static "base" CPU model
tests: query-cpu-model-test.py test code
target-i386: Implement query-cpu-model-expansion QMP command
qapi-schema.json | 30 ++-
scripts/qemu.py | 25 ++-
scripts/qtest.py | 15 +-
target-i386/cpu-qom.h | 8 +-
tests/Makefile.include | 40 +++-
tests/query-cpu-model-test.py | 421 ++++++++++++++++++++++++++++++++++++
tests/test-x86-cpuid-compat.c | 19 ++
monitor.c | 4 +-
qom/cpu.c | 32 ++-
target-arm/helper.c | 1 +
target-i386/cpu.c | 481 +++++++++++++++++++++++++++++++-----------
target-ppc/translate_init.c | 1 +
target-s390x/cpu_models.c | 5 +
13 files changed, 928 insertions(+), 154 deletions(-)
create mode 100755 tests/query-cpu-model-test.py
--
2.7.4
7 years, 11 months
[libvirt] [PATCH] docs: Update formatstorage to match code for pool path
by John Ferlan
Seems commit id '0257d06b' forgot to include formatstorage when updating
the docs to describe allowing zfs as a pool type and to furthermore note
that the pool's target path element will be generated rather than read.
Similarly commit id 'efab27afb' neglected to indicate that the target path
for a logical pool will now be generated by libvirt.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Pushed as trivial
docs/formatstorage.html.in | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in
index f1be511..47c8b0c 100644
--- a/docs/formatstorage.html.in
+++ b/docs/formatstorage.html.in
@@ -380,8 +380,8 @@
<code>pool</code> element for some types of pools (pool
types <code>dir</code>, <code>fs</code>, <code>netfs</code>,
<code>logical</code>, <code>disk</code>, <code>iscsi</code>,
- <code>scsi</code>, <code>mpath</code>). This tag is used to
- describe the mapping of
+ <code>scsi</code>, <code>mpath</code>, <code>zfs</code>).
+ This tag is used to describe the mapping of
the storage pool into the host filesystem. It can contain the following
child elements:
</p>
@@ -411,6 +411,8 @@
guaranteed stable across reboots, since they are allocated on
demand. It is preferable to use a stable location such as one
of the <code>/dev/disk/by-{path|id|uuid|label}</code> locations.
+ For <code>logical</code> and <code>zfs</code> pool types, a
+ provided value is ignored and a default path generated.
For a Multipath pool (type <code>mpath</code>), the provided
value is ignored and the default value of "/dev/mapper" is used.
<span class="since">Since 0.4.1</span>
--
2.7.4
7 years, 11 months
[libvirt] [PATCH python] HACKING: fix grammar
by Cole Robinson
From: Prabodh Agarwal <prabodh1194(a)users.noreply.github.com>
---
Pushed as trivial. This was submitted on github, and since it's trivial
I just pushed it, but I pointed the user at the hacking guidelines for
future submissions
https://github.com/libvirt/libvirt-python/pull/1#issuecomment-266807394
HACKING | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/HACKING b/HACKING
index 7a6e150..6eeb9e6 100644
--- a/HACKING
+++ b/HACKING
@@ -3,7 +3,7 @@
Most of the libvirt python binding code is automatically generated
using the script generator.py, and the API description that the
-libvirt library installs the location shown by pkg-config, with
+libvirt library installs at the location shown by pkg-config, with
this command:
$ pkg-config --variable libvirt_api libvirt
--
2.9.3
7 years, 11 months
[libvirt] [PATCH RFC] libxl: reverse defaults on HVM net device attach
by Joao Martins
libvirt libxl picks its own default with respect to the default NIC
to use. libxlMakeNic is the one responsible for this and on boot it
picks LIBXL_NIC_TYPE_VIF_IOEMU such that it accomodates both PV and
emulated one. The good behaving guest at boot will then select the pv
and unplug the emulated device.
Now, on HVM when attaching an interface it will pick the same default
that is LIBXL_NIC_TYPE_VIF_IOEMU which as a result will fail the attach
(see xen commit 32e9d0f ("libxl: nic type defaults to vif in hotplug for
hvm guest"). Xen doesn't yet support the hotplug of emulated devices,
but we don't want to rule out that case either, which might get support
in the future. Hence we simply reverse the defaults when we are
attaching the interface which allows libvirt to prefer the PV nic first
without adding "model='netfront'" following the same pattern as above
commit. Also to avoid ruling out the emulated one we set to
LIBXL_NIC_TYPE_IOEMU when setting a model type that is not 'netfront'.
Signed-off-by: Joao Martins <joao.m.martins(a)oracle.com>
---
This allows Openstack to attach network interfaces, which currently
is broken on libxl if it doesn't set model 'netfront'. I am not sure
whether this is the best way (hence RFC) or if users should really be
setting the model='netfront' when attaching devices. But sounds to me
that it would be better to have by default the supported, and if users
want emulated attach to specify a nic model. Thoughts?
---
src/libxl/libxl_conf.c | 9 ++++++---
src/libxl/libxl_conf.h | 3 ++-
src/libxl/libxl_driver.c | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index dcf8e7e..50aa958 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -881,9 +881,10 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config)
int
libxlMakeNic(virDomainDefPtr def,
virDomainNetDefPtr l_nic,
- libxl_device_nic *x_nic)
+ libxl_device_nic *x_nic,
+ bool attach)
{
- bool ioemu_nic = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
+ bool ioemu_nic = def->os.type == VIR_DOMAIN_OSTYPE_HVM && !attach;
virDomainNetType actual_type = virDomainNetGetActualType(l_nic);
virNetworkPtr network = NULL;
virConnectPtr conn = NULL;
@@ -917,6 +918,8 @@ libxlMakeNic(virDomainDefPtr def,
goto cleanup;
if (STREQ(l_nic->model, "netfront"))
x_nic->nictype = LIBXL_NIC_TYPE_VIF;
+ else
+ x_nic->nictype = LIBXL_NIC_TYPE_VIF_IOEMU;
}
if (VIR_STRDUP(x_nic->ifname, l_nic->ifname) < 0)
@@ -1047,7 +1050,7 @@ libxlMakeNicList(virDomainDefPtr def, libxl_domain_config *d_config)
if (virDomainNetGetActualType(l_nics[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV)
continue;
- if (libxlMakeNic(def, l_nics[i], &x_nics[nvnics]))
+ if (libxlMakeNic(def, l_nics[i], &x_nics[nvnics], false))
goto error;
/*
* The devid (at least right now) will not get initialized by
diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
index 0ea76b4..851f3af 100644
--- a/src/libxl/libxl_conf.h
+++ b/src/libxl/libxl_conf.h
@@ -178,7 +178,8 @@ libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev);
int
libxlMakeNic(virDomainDefPtr def,
virDomainNetDefPtr l_nic,
- libxl_device_nic *x_nic);
+ libxl_device_nic *x_nic,
+ bool attach);
int
libxlMakeVfb(virPortAllocatorPtr graphicsports,
virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index b19b17e..7e5d9b6 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3379,7 +3379,7 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver,
goto cleanup;
}
- if (libxlMakeNic(vm->def, net, &nic) < 0)
+ if (libxlMakeNic(vm->def, net, &nic, true) < 0)
goto cleanup;
if (libxl_device_nic_add(cfg->ctx, vm->def->id, &nic, 0)) {
--
2.1.4
7 years, 11 months