[libvirt] Publishing libvirt 'patches' JSON database?
by Kashyap Chamarthy
I'd imagine most developers on this list have their own workflows to
track/apply/test patches from the mailing list. I normally just save
patches in Mutt's Maildir and apply them manually to a Git branch. I
recently began using the 'patches'[1] tool, that some of you on this
list must be familiar with, to test arbitrary QEMU patches from the
mailing list, and found it relatively easy large patch series from
mailing list.
I'm writing this to check if the libvirt upstream community finds it
desirable to setup such a patches database.
What is 'patches'?
------------------
Quoting the README[2]:
"patches is a patch tracking system. It consists of two parts: a set
of commands that build a database of patches from a mailing list and
then a set of commands that can search that database. It supports
the following features:
- Tracking patch status by determining which patches are already
committed, have newer versions posted, are RFC, etc.
- Applying patches or pull requests with a single command.
- Searching for patches using a rich query language."
A quick workflow to test patches from mailing list
---------------------------------------------------
FWIW, this is my rudimentary use-case.
Clone the repo, and fetch the patches database (may take a few minutes):
$ git clone https://github.com/stefanha/patches.git
$ cd patches
$ ./patches fetch http://wiki.qemu.org/patches/patches.json
And, suppose, I want to test Dan's LUKS encryption support (26) patch series, I
go find the message ID:
$ ./patches list | grep -B5 "Support LUKS encryption"
Message-id: 1456747261-22032-1-git-send-email-berrange(a)redhat.com
From: Daniel P. Berrange <berrange(a)redhat.com>
Date: 2016-02-29
Tags: v4
[0/26] Support LUKS encryption in block devices
Trivially apply it (assuming you have a test branch):
$ ./patches apply --git-dir ~/src/qemu/ \
id:1456747261-22032-1-git-send-email-berrange@redhat.com
Applying: crypto: add cryptographic random byte source
Applying: crypto: add support for PBKDF2 algorithm
Applying: crypto: add support for generating initialization vectors
Applying: crypto: add support for anti-forensic split algorithm
Applying: crypto: skip testing of unsupported cipher algorithms
[...]
Test away!
Rinse, repeat:
"The `fetch` command should be run whenever you want to refresh the
patch database; it will download any new patches that have arrived
since the last time you did a fetch."
Here's[3] the documentation to setup the patches database.
[1] https://github.com/stefanha/patches/tree/stefanha-tweaks
[2] https://github.com/stefanha/patches/blob/stefanha-tweaks/README.md
[3] https://github.com/stefanha/patches/blob/stefanha-tweaks/README-server.md
--
/kashyap
8 years, 8 months
[libvirt] [PATCH 00/10] Introduce worker tuning APIs
by Erik Skultety
Erik Skultety (10):
libvirt-host: Move virTypedParam* to libvirt-common
admin: Enable usage of typed parameters
admin: Introduce virAdmConnectServerLookupByName
util: Refactor thread creation by introducing virThreadPoolExpand
util: Report system error when virThreadCreateFull fails
util: Add more getters to threadpool parameters
admin: Prepare admin protocol for future worker related procedures
admin: Introduce virAdmServerGethreadPoolParameters
admin: Introduce virAdmServerSetThreadPoolParameters
virt-admin: Introduce srv-workertune command
cfg.mk | 2 +-
daemon/admin.c | 129 ++++++++++++++++++++++++
daemon/admin_server.c | 129 ++++++++++++++++++++++++
daemon/admin_server.h | 15 +++
include/libvirt/libvirt-admin.h | 74 ++++++++++++++
include/libvirt/libvirt-common.h.in | 185 ++++++++++++++++++++++++++++++++++
include/libvirt/libvirt-host.h | 186 ----------------------------------
include/libvirt/virterror.h | 1 +
po/POTFILES.in | 4 +-
src/admin/admin_protocol.x | 67 +++++++++++-
src/admin/admin_remote.c | 104 +++++++++++++++++++
src/admin_protocol-structs | 52 ++++++++++
src/libvirt-admin.c | 114 +++++++++++++++++++++
src/libvirt_admin_private.syms | 5 +
src/libvirt_admin_public.syms | 3 +
src/libvirt_private.syms | 4 +
src/rpc/virnetserver.c | 37 +++++++
src/rpc/virnetserver.h | 13 +++
src/util/virerror.c | 6 ++
src/util/virthreadpool.c | 196 ++++++++++++++++++++++++------------
src/util/virthreadpool.h | 8 ++
tools/virt-admin.c | 132 ++++++++++++++++++++++++
22 files changed, 1212 insertions(+), 254 deletions(-)
--
2.4.3
8 years, 9 months
[libvirt] [PATCH] rbd: use unsigned long long instead of uint64_t
by Shanzhi Yu
Fix below error:
storage/storage_backend_rbd.c: In function 'virStorageBackendRBDSetAllocation':
storage/storage_backend_rbd.c:337:5: error: format '%llu' expects argument of type 'long long unsigned int', but argument 8 has type 'uint64_t' [-Werror=format=]
VIR_DEBUG("Found %llu bytes allocated for RBD image %s",
Signed-off-by: Shanzhi Yu <shyu(a)redhat.com>
---
src/storage/storage_backend_rbd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index c9b47e2..dec0905 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -324,7 +324,7 @@ virStorageBackendRBDSetAllocation(virStorageVolDefPtr vol,
rbd_image_info_t *info)
{
int r, ret = -1;
- uint64_t allocation = 0;
+ unsigned long long allocation = 0;
if ((r = rbd_diff_iterate2(image, NULL, 0, info->size, 0, 1,
&virStorageBackendRBDRefreshVolInfoCb,
--
1.8.3.1
8 years, 9 months
[libvirt] [PATCH] storage: rbd: Fix build
by Peter Krempa
After the recent commits the build didn't work for me. Fix it by
using size_t as the callback argument is using and the correct
formatter. The attempted fixup to use %llu as a formatter was wrong.
---
Pushed now.
src/storage/storage_backend_rbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index c9b47e2..6e92ff7 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -311,7 +311,7 @@ virStorageBackendRBDRefreshVolInfoCb(uint64_t offset ATTRIBUTE_UNUSED,
int exists,
void *arg)
{
- uint64_t *used_size = (uint64_t *)(arg);
+ size_t *used_size = (size_t *)(arg);
if (exists)
(*used_size) += len;
@@ -324,7 +324,7 @@ virStorageBackendRBDSetAllocation(virStorageVolDefPtr vol,
rbd_image_info_t *info)
{
int r, ret = -1;
- uint64_t allocation = 0;
+ size_t allocation = 0;
if ((r = rbd_diff_iterate2(image, NULL, 0, info->size, 0, 1,
&virStorageBackendRBDRefreshVolInfoCb,
@@ -334,7 +334,7 @@ virStorageBackendRBDSetAllocation(virStorageVolDefPtr vol,
goto cleanup;
}
- VIR_DEBUG("Found %llu bytes allocated for RBD image %s",
+ VIR_DEBUG("Found %zu bytes allocated for RBD image %s",
allocation, vol->name);
vol->target.allocation = allocation;
--
2.7.3
8 years, 9 months
[libvirt] [PATCH] util: generate correct macvtap name
by Shanzhi Yu
in commit 370608b, bitmap of in-used macvtap devices was introduced.
if there is already macvtap device created not by libvirt,
virNetDevMacVLanCreateWithVPortProfile will failed after try
MACVLAN_MAX_ID times call virNetDevMacVLanReleaseID
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1321546
Signed-off-by: Shanzhi Yu <shyu(a)redhat.com>
---
src/util/virnetdevmacvlan.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index 2409113..973363e 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -988,7 +988,8 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested,
MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX;
const char *pattern = (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ?
MACVTAP_NAME_PATTERN : MACVLAN_NAME_PATTERN;
- int rc, reservedID = -1;
+ int rc = -1;
+ int reservedID = 0;
char ifname[IFNAMSIZ];
int retries, do_retry = 0;
uint32_t macvtapMode;
@@ -1072,16 +1073,17 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested,
retries = MACVLAN_MAX_ID;
while (!ifnameCreated && retries) {
virMutexLock(&virNetDevMacVLanCreateMutex);
- reservedID = virNetDevMacVLanReserveID(reservedID, flags, false, true);
- if (reservedID < 0) {
- virMutexUnlock(&virNetDevMacVLanCreateMutex);
- return -1;
- }
snprintf(ifname, sizeof(ifname), pattern, reservedID);
rc = virNetDevMacVLanCreate(ifname, type, macaddress, linkdev,
macvtapMode, &do_retry);
if (rc < 0) {
- virNetDevMacVLanReleaseID(reservedID, flags);
+ reservedID++;
+ reservedID = virNetDevMacVLanReserveID(reservedID, flags, false, true);
+ if (reservedID < 0) {
+ virMutexUnlock(&virNetDevMacVLanCreateMutex);
+ return -1;
+ }
+
virMutexUnlock(&virNetDevMacVLanCreateMutex);
if (!do_retry)
return -1;
--
1.8.3.1
8 years, 9 months
[libvirt] [PATCH 0/3] libxl: improve libxlDomainStart error handling
by Jim Fehlig
libxlDomainStart allocates and reserves resources, which should be cleaned
up on error paths. This small series is based on Chunyan's patch to do the
same [0]. It breaks the patch into three patches to ease review and better
understand the changes.
[0] https://www.redhat.com/archives/libvir-list/2016-March/msg00929.html
Chunyan Liu (1):
libxl: fix resource leaks in libxlDomainStart error paths
Jim Fehlig (2):
libxl: rename cleanup_dom label
libxl: only disable domain death events in libxlDomainCleanup
src/libxl/libxl_domain.c | 44 ++++++++++++++++++++------------------------
1 file changed, 20 insertions(+), 24 deletions(-)
--
2.1.4
8 years, 9 months
[libvirt] [PATCH] libxl: remove reference to non-existent out label
by Jim Fehlig
Commit e6336442 changed the 'out:' label to 'cleanup' in
libxlDomainAttachNetDevice(), but missed a comment referencing
the 'out:' label. Remove it from the comment since it is no
longer accurate anyhow.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Pushing as trivial.
src/libxl/libxl_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index cfc4555..5103495 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3159,7 +3159,7 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver,
/* This is really a "smart hostdev", so it should be attached
* as a hostdev (the hostdev code will reach over into the
* netdev-specific code as appropriate), then also added to
- * the nets list (see out:) if successful.
+ * the nets list if successful.
*/
ret = libxlDomainAttachHostDevice(driver, vm, hostdev);
goto cleanup;
--
2.1.4
8 years, 9 months
[libvirt] [PATCH] tests: virtnettlscontexttest: Use virGetLastErrorMessage()
by Cole Robinson
Use virGetLastErrorMessage() rather than open code it
---
There's many more examples of this spread around the code; this patch
is meant as an example for http://wiki.libvirt.org/page/BiteSizedTasks
tests/virnettlscontexttest.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
index a3e24a3..d33b896 100644
--- a/tests/virnettlscontexttest.c
+++ b/tests/virnettlscontexttest.c
@@ -90,13 +90,12 @@ static int testTLSContextInit(const void *opaque)
goto cleanup;
}
} else {
- virErrorPtr err = virGetLastError();
if (!data->expectFail) {
VIR_WARN("Unexpected failure %s against %s",
data->cacrt, data->crt);
goto cleanup;
}
- VIR_DEBUG("Got error %s", err ? err->message : "<unknown>");
+ VIR_DEBUG("Got error %s", virGetLastErrorMessage());
}
ret = 0;
--
2.5.0
8 years, 9 months
[libvirt] [PATCH] docs: Update the hyperv feature qemu supported version
by John Ferlan
In order to follow recent comments which indicate support for specific
feature bits are supported by a specific QEMU version add the version
from whence the relaxed, vapic, and spinlocks support was added.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Pushing as trivial and essentially a follow on to commit id '7068b56c'
in order to keep things looking the same
docs/formatdomain.html.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 630c682..a1d7c4a 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1528,19 +1528,19 @@
<td>relaxed</td>
<td>Relax constraints on timers</td>
<td> on, off</td>
- <td><span class="since">1.0.0 (QEMU only)</span></td>
+ <td><span class="since">1.0.0 (QEMU 2.0)</span></td>
</tr>
<tr>
<td>vapic</td>
<td>Enable virtual APIC</td>
<td>on, off</td>
- <td><span class="since">1.1.0 (QEMU only)</span></td>
+ <td><span class="since">1.1.0 (QEMU 2.0)</span></td>
</tr>
<tr>
<td>spinlocks</td>
<td>Enable spinlock support</td>
<td>on, off; retries - at least 4095</td>
- <td><span class="since">1.1.0 (QEMU only)</span></td>
+ <td><span class="since">1.1.0 (QEMU 2.0)</span></td>
</tr>
<tr>
<td>vpindex</td>
--
2.5.5
8 years, 9 months