[libvirt] [PATCH 0/3] Allow inputvol when creating vol from inputvol to be encrypted
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1613737
Details in the patches (and even more in the bz).
John Ferlan (3):
storage: Remove secretPath from _virStorageBackendQemuImgInfo
storage: Allow for inputvol to have any format for encryption
storage: Allow inputvol to be encrypted
src/storage/storage_util.c | 79 ++++++++++++++++---
src/storage/storage_util.h | 1 +
.../luks-convert-encrypt.argv | 11 +++
.../luks-convert-encrypt2fileqcow2.argv | 7 ++
.../luks-convert-encrypt2fileraw.argv | 7 ++
.../luks-convert-qcow2.argv | 9 +++
tests/storagevolxml2argvtest.c | 19 ++++-
tests/storagevolxml2xmlin/vol-encrypt1.xml | 21 +++++
tests/storagevolxml2xmlin/vol-encrypt2.xml | 21 +++++
tests/storagevolxml2xmlin/vol-file-qcow2.xml | 21 +++++
10 files changed, 184 insertions(+), 12 deletions(-)
create mode 100644 tests/storagevolxml2argvdata/luks-convert-encrypt.argv
create mode 100644 tests/storagevolxml2argvdata/luks-convert-encrypt2fileqcow2.argv
create mode 100644 tests/storagevolxml2argvdata/luks-convert-encrypt2fileraw.argv
create mode 100644 tests/storagevolxml2argvdata/luks-convert-qcow2.argv
create mode 100644 tests/storagevolxml2xmlin/vol-encrypt1.xml
create mode 100644 tests/storagevolxml2xmlin/vol-encrypt2.xml
create mode 100644 tests/storagevolxml2xmlin/vol-file-qcow2.xml
--
2.17.1
6 years, 3 months
[libvirt] Fw: Re: [PATCH 4/6] util: netdev: use VIR_AUTOCLOSE instead of VIR_FORCE_CLOSE
by Shi Lei
On 2018-09-12 at 16:25, Shi Lei wrote:
On 2018-09-12 at 15:21, Erik Skultety wrote:
>On Tue, Sep 11, 2018 at 11:37:45PM +0800, Shi Lei wrote:
>> On 2018-09-11 at 20:44, Erik Skultety wrote:
>> >On Mon, Sep 10, 2018 at 11:47:53AM +0800, Shi Lei wrote:
>> >> By making use of GNU C's cleanup attribute handled by the VIR_AUTOCLOSE macro,
>> >> many of the VIR_FORCE_CLOSE calls can be dropped, which in turn leads to
>> >> getting rid of many of our cleanup sections.
>> >>
>> >> Signed-off-by: Shi Lei <shi_lei(a)massclouds.com>
>> >> ---
>> >> static int
>> >> @@ -909,9 +867,9 @@ char *virNetDevGetName(int ifindex)
>> >> #if defined(SIOCGIFINDEX) && defined(HAVE_STRUCT_IFREQ)
>> >> int virNetDevGetIndex(const char *ifname, int *ifindex)
>> >> {
>> >> - int ret = -1;
>> >> struct ifreq ifreq;
>> >> - int fd = socket(VIR_NETDEV_FAMILY, SOCK_DGRAM, 0);
>> >> + VIR_AUTOCLOSE(fd);
>> >> + socket(VIR_NETDEV_FAMILY, SOCK_DGRAM, 0);
>> >
>> >^this could not potentially work...
>> >
>> >Erik
>>
>> Sorry! I'm too careless.
>>
>> I think that a new syntax-check rule might make sense.
>> This rule checks below:
>>
>> type foo(a0, a1 ...);
>>
>> [type] var = foo(a0, a1, ...); /* It's OK */
>> ignore_value(foo(a0, a1, ...)); /* It's OK */
>>
>> foo(a0, a1, ...); /* Report this usage */
>
>but this would go away with the syntax-check rule you proposed in you response
>to the first patch? If not, then would you be more specific to help me
>understand the problem more?
>
>Thanks,
>Erik
Sorry! I was muddle-headed last night.
It is not the syntax-check rule in my response to the first patch.
This is another rule and I wanted to introduce it to avoid some faults then.
Today I find that it is not easy as I thought.
Please ignore it ... :-)
Shi Lei
>
>>
>> And it takes effect before compilation and even it's in the inactive
>> side of the #if-#else conditons.
>>
>> It would not check macros since their name are upper case and
>> we don't care for the function as condition in if-else statement.
>>
>> How about it?
>> And I can try it if it's a bit helpful ...
>>
>> Shi Lei
>>
>>
>>
>> --
>> libvir-list mailing list
>> libvir-list(a)redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list
6 years, 3 months
[libvirt] [PATCHv3 0/3] Add virNetlinkNewLink helper for simplifying virNetDev*Create
by Shi Lei
v2 here:
https://www.redhat.com/archives/libvir-list/2018-September/msg00131.html
Diff from V2:
This series remove all unrelated changes. Those changes would be
standalone patches.
Shi Lei (3):
util: netlink: Introduce virNetlinkNewLink helper
util: netlink: Add wrapper macros to make virNetlinkNewLink more
readable
util: netlink: Using virNetlinkNewLink to simplify virNetDev*Create
src/libvirt_private.syms | 1 +
src/util/virnetdevbridge.c | 73 +++---------------------
src/util/virnetdevmacvlan.c | 110 +++++-------------------------------
src/util/virnetlink.c | 104 ++++++++++++++++++++++++++++++++++
src/util/virnetlink.h | 43 ++++++++++++++
5 files changed, 172 insertions(+), 159 deletions(-)
--
2.17.1
6 years, 3 months
[libvirt] [PATCH] numa: fix unsafe access to numa_nodes_ptr
by Wang Yechao
numa_nodes_ptr is a global variable in libnuma.so. It is been freed
after main thread exits. If we have many running vms, restart the
libvirtd service continuously at intervals of a few seconds, the main
thread may exit before qemuProcessReconnect thread, and a segfault
error occurs. Backstrace as follows:
0 0x00007f40e3d2dd72 in numa_bitmask_isbitset () from /lib64/libnuma.so.1
1 0x00007f40e4d14c55 in virNumaNodeIsAvailable (node=node@entry=0) at util/virnuma.c:396
2 0x00007f40e4d16010 in virNumaGetHostMemoryNodeset () at util/virnuma.c:1011
3 0x00007f40b94ced90 in qemuRestoreCgroupState (vm=0x7f407c39df00, vm=0x7f407c39df00) at qemu/qemu_cgroup.c:877
4 qemuConnectCgroup (driver=driver@entry=0x7f407c21fe80, vm=0x7f407c39df00) at qemu/qemu_cgroup.c:969
5 0x00007f40b94eef93 in qemuProcessReconnect (opaque=<optimized out>) at qemu/qemu_process.c:3531
6 0x00007f40e4d34bd2 in virThreadHelper (data=<optimized out>) at util/virthread.c:206
7 0x00007f40e214ee25 in start_thread () from /lib64/libpthread.so.0
8 0x00007f40e1e7c36d in clone () from /lib64/libc.so.6
Signed-off-by: Wang Yechao <wang.yechao255(a)zte.com.cn>
---
src/util/virnuma.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index 67e6c86..502b1d5 100644
--- a/src/util/virnuma.c
+++ b/src/util/virnuma.c
@@ -381,7 +381,10 @@ virNumaGetMaxCPUs(void)
bool
virNumaNodeIsAvailable(int node)
{
- return numa_bitmask_isbitset(numa_nodes_ptr, node);
+ if (numa_nodes_ptr)
+ return numa_bitmask_isbitset(numa_nodes_ptr, node);
+ else
+ return false;
}
--
1.8.3.1
6 years, 3 months
Re: [libvirt] [PATCH v3 4/4] block/rbd: add deprecation documenation for filename keyvalue pairs
by Eric Blake
[MAINTAINERS says libvir-list should have been cc'd; not sure why that
didn't happen]
On 9/11/18 4:34 PM, Jeff Cody wrote:
> Signed-off-by: Jeff Cody <jcody(a)redhat.com>
In the subject: s/documenation/documentation/
> ---
> qemu-deprecated.texi | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
> index 1b9c007f12..4df8ac442d 100644
> --- a/qemu-deprecated.texi
> +++ b/qemu-deprecated.texi
> @@ -190,6 +190,13 @@ used instead.
> In order to prevent QEMU from automatically opening an image's backing
> chain, use ``"backing": null'' instead.
>
> +@subsubsection "rbd keyvalue pair encoded filenames": "" (since 3.1.0)
> +
> +Options for ``rbd'' should be specified according to its runtime options,
> +like other block drivers. Legacy parsing of keyvalue pair encoded
> +filenames is useful to open images with the old format for backing files;
> +These image files should be updated to use the current format.
Can we give an example? Cribbing from patch 3, an example might look
like changing:
json:{"file.driver":"rbd", "file.filename":"rbd:rbd/name"}
into:
json:{"file.driver":"rbd", "file.pool":"rbd", "file.image":"name"}
I'll let Peter or John comment on whether libvirt's RBD pool handler is
impacted by this deprecation, but it seems reasonable to me.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
6 years, 3 months
[libvirt] [PATCH] qemu_domain: Drop namespace check from top level functions
by Michal Privoznik
In some cases we are checking if the mount namespace is enabled
at two places: one is at the beginning of exported function (e.g.
qemuDomainNamespaceSetupDisk()) and the other is at the beginning
of qemuDomainNamespaceMknodPaths() which is called from the
former function anyway. Then we have some other functions which
rely on the later check solely.
In order to compensate for possibly needles function call,
qemuDomainNamespaceMknodPaths() returns early if @npaths is zero.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 5329899b13..15325aa4c1 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -12428,7 +12428,8 @@ qemuDomainNamespaceMknodPaths(virDomainObjPtr vm,
int ret = -1;
size_t i;
- if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
+ if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) ||
+ !npaths)
return 0;
cfg = virQEMUDriverGetConfig(driver);
@@ -12521,9 +12522,6 @@ qemuDomainNamespaceSetupDisk(virDomainObjPtr vm,
char *dmPath = NULL;
int ret = -1;
- if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
- return 0;
-
for (next = src; virStorageSourceIsBacking(next); next = next->backingStore) {
if (virStorageSourceIsEmpty(next) ||
!virStorageSourceIsLocalStorage(next)) {
@@ -12574,9 +12572,6 @@ qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm,
char **paths = NULL;
size_t i, npaths = 0;
- if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
- return 0;
-
if (qemuDomainGetHostdevPath(NULL, hostdev, false, &npaths, &paths, NULL) < 0)
goto cleanup;
@@ -12600,9 +12595,6 @@ qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm,
char **paths = NULL;
size_t i, npaths = 0;
- if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
- return 0;
-
if (qemuDomainGetHostdevPath(vm->def, hostdev, true,
&npaths, &paths, NULL) < 0)
goto cleanup;
--
2.16.4
6 years, 3 months
[libvirt] Terminal input “udevadm trigger” command,then produce “nl_recv returned with error:No buffer space available”
by xiajidong@cmss.chinamobile.com
Dear libvirt experts,
I have add some patch as follow.this two patch add buffer size to avoid to
produce “nl_recv returned with error:No buffer space available”
1. libvirt-nodedev-Increase-the-netlink-socket-buffer-size-to-t.patch
2. libvirt-util-increase-libnl-buffer-size.patch
but as I set some configuration in /etc/libvirt/libvitd.conf as follows
# Logging level: 4 errors, 3 warnings, 2 information, 1 debug
log_level =2
# Multiple outputs can be defined, they just need to be separated by spaces.
# e.g. to log all warnings and errors to syslog under the libvirtd ident:
log_outputs="2:syslog:libvirtd"
when I input “udevadm trigger” command
[root@localhost ~]# vi /etc/libvirt/libvirtd.conf
[root@localhost ~]# systemctl restart libvirtd
[root@localhost ~]# udevadm trigger
[root@localhost ~]# udevadm trigger
[root@localhost ~]# udevadm trigger
[root@localhost ~]#
then will produce “nl_recv returned with error:No buffer space available”
[root@localhost ~]# tail -f /var/log/messages | grep buffer
Sep 2 22:44:00 localhost libvirtd: 4004: error :
virNetlinkEventCallback:699 : nl_recv returned with error: No buffer space
available
Sep 2 23:11:33 localhost libvirtd: 4004: error :
virNetlinkEventCallback:699 : nl_recv returned with error: No buffer space
available
Sep 2 23:11:45 localhost libvirtd: 4004: error :
virNetlinkEventCallback:699 : nl_recv returned with error: No buffer space
available
So my question is:
When input “udevadm trigger” in terminal, if setting log_level and
log_outputs="2:syslog:libvirtd",how to avoid to produce “error
virNetlinkEventCallback:699 : nl_recv returned with error: No buffer space
available” log information?
I am looking forward to your reply.
_____
Best Regards,
Jidong Xia
China Mobile (Suzhou) Software Technology Company.cloud computing product
department
Tel: (+86) 18896726087
E-Mail:xiajidong(a)cmss.chinamobile.com
<mailto:xiajidong@cmss.chinamobile.com>
6 years, 3 months
[libvirt] [PATCH] test: Remove possible infinite loop in virnetsockettest
by John Ferlan
Commit 39015a6f3 modified the test to be more reliable/realistic,
but without checking the return status of virEventRunDefaultImpl
it's possible that the test could run infinitely.
Found by Coverity
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
tests/virnetsockettest.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index cccb90d0be..490f720fd0 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -243,8 +243,13 @@ testSocketAccept(const void *opaque)
&cdata) < 0)
goto cleanup;
- while (rsock == NULL)
- virEventRunDefaultImpl();
+ while (rsock == NULL) {
+ if (virEventRunDefaultImpl() < 0) {
+ VIR_WARN("Failed to run event loop: %s\n",
+ virGetLastErrorMessage());
+ break;
+ }
+ }
for (i = 0; i < nlsock; i++) {
if (lsock[i] == rsock) {
--
2.17.1
6 years, 3 months
[libvirt] [PATCH] news: Mention Xen support for PM suspend and wakeup
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
docs/news.xml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index b8bee35df0..9d16b2930b 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -35,6 +35,15 @@
<libvirt>
<release version="v4.8.0" date="unreleased">
<section title="New features">
+ <change>
+ <summary>
+ Xen: Support PM Suspend and Wakeup
+ </summary>
+ <description>
+ The libxl driver now supports the virDomainPMSuspendForDuration
+ and virDomainPMWakeup APIs.
+ </description>
+ </change>
</section>
<section title="Improvements">
<change>
--
2.18.0
6 years, 3 months