On Fri, Feb 11, 2022 at 06:39:14PM +0100, Andrea Bolognani wrote:
> This results in the generated script having consistent spacing
> throughout, instead of having repeated whitespace in some parts
> and commands that are separated by a semicolon and no spacing at
> all in others.
This is going to
On Fri, Feb 11, 2022 at 06:39:19PM +0100, Andrea Bolognani wrote:
> Just like the name of the netcat command and the connection URI,
> the socket path is a user-provided piece of information that
> might contain characters that have special meaning for the
> shell, and as such should be escaped.
>
Currently the test cases all follow the proxy=auto behavior, but
we want to add coverage for other proxy modes as well.
Signed-off-by: Andrea Bolognani
---
tests/virnetsockettest.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/virnetsockettest.c
This results in the generated script having consistent spacing
throughout, instead of having repeated whitespace in some parts
and commands that are separated by a semicolon and no spacing at
all in others.
Signed-off-by: Andrea Bolognani
---
src/rpc/virnetclient.c | 12 ++--
We can exit early when the input is an empty string, and we can
avoid storing the string length in a variable since we only use
that information once.
Signed-off-by: Andrea Bolognani
---
src/util/virbuffer.c | 17 +++--
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git
On Fri, Feb 11, 2022 at 06:39:15PM +0100, Andrea Bolognani wrote:
> This makes the generated script a bit shorter and removes an
> unnecessary call to test.
>
> Signed-off-by: Andrea Bolognani
> ---
> src/rpc/virnetclient.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff
The important part of the value we assign to "netcat" is that it
contains whitespace, so drop everything else to highlight this
fact. Change the path to the socket so that it also contains
whitespace: this will not actually work outside of the test suite
at the moment, but we're going to fix that
Make this test case consistent with all the other ones.
Signed-off-by: Andrea Bolognani
---
tests/virnetsockettest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 0928f7056a..429c4e5f9d 100644
---
Test the behavior of virBufferEscapeShell for different types of
quotes as well as the empty string.
Signed-off-by: Andrea Bolognani
---
tests/virbuftest.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/virbuftest.c b/tests/virbuftest.c
index
Just like the name of the netcat command and the connection URI,
the socket path is a user-provided piece of information that
might contain characters that have special meaning for the
shell, and as such should be escaped.
Signed-off-by: Andrea Bolognani
---
src/rpc/virnetclient.c | 5 +++--
Add test cases for quotes appearing in the netcat and socket
parameters, for the default behavior of proxy=auto where
virt-ssh-helper is used if available, and for proxy=native.
Signed-off-by: Andrea Bolognani
---
tests/virnetsockettest.c | 62 +++-
1 file
This makes the generated script a bit shorter and removes an
unnecessary call to test.
Signed-off-by: Andrea Bolognani
---
src/rpc/virnetclient.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index cbefa8f11f..7e7e9d52a6
Having the actual script indented and the closing quote on a
separate line, like
sh -c '
if foo; then
bar;
fi
'
makes things more readable and easier to scan visually.
Signed-off-by: Andrea Bolognani
---
tests/virnetsockettest.c | 78 +---
No need to escape a single quote.
Signed-off-by: Andrea Bolognani
---
tests/virnetsockettest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 447cbee89c..0928f7056a 100644
--- a/tests/virnetsockettest.c
+++
I initially started looking into this because of
https://gitlab.com/libvirt/libvirt/-/issues/273
I have now convinced myself that we don't need to change the way we
quote things, but in the process I have accumulated several
improvements and one bug fix.
Andrea Bolognani (11):
virbuftest:
On Thu, Feb 10, 2022 at 10:08:42AM +0100, Andrea Bolognani wrote:
> +++ b/src/util/virhostcpu.c
> @@ -928,8 +928,14 @@ virHostCPUGetInfo(virArch hostarch G_GNUC_UNUSED,
> *mhz = cpu_freq;
> # else
> if (sysctlbyname("hw.cpufrequency", _freq, _freq_len, NULL, 0) <
> 0) {
> -
On Fri, Feb 11, 2022 at 03:16:35PM +0100, Ján Tomko wrote:
> On a Friday in 2022, Jiri Denemark wrote:
> > On Fri, Feb 11, 2022 at 14:34:04 +0100, Jiri Denemark wrote:
> > > This partially reverts commit 0fc4a43d248b86fd54ad7323beb66faec8c1043c.
> > >
> > > Signed-off-by: Jiri Denemark
> > > ---
On Fri, Feb 11, 2022 at 15:16:35 +0100, Ján Tomko wrote:
> On a Friday in 2022, Jiri Denemark wrote:
> >On Fri, Feb 11, 2022 at 14:34:04 +0100, Jiri Denemark wrote:
> >> This partially reverts commit 0fc4a43d248b86fd54ad7323beb66faec8c1043c.
> >>
> >> Signed-off-by: Jiri Denemark
> >> ---
> >>
On 2/11/22 11:30, Tim Wiederhake wrote:
> Use the recently implemented VIR_LOCK_GUARD and VIR_WITH_MUTEX_LOCK_GUARD
> to simplify mutex management.
>
> Tim Wiederhake (10):
> vz: Use automatic mutex management
> vmware: Use automatic mutex management
> secret: Factor out mutex
> secret:
On a Friday in 2022, Jiri Denemark wrote:
On Fri, Feb 11, 2022 at 14:34:04 +0100, Jiri Denemark wrote:
This partially reverts commit 0fc4a43d248b86fd54ad7323beb66faec8c1043c.
Signed-off-by: Jiri Denemark
---
tests/securityselinuxlabeltest.c | 4 +++-
1 file changed, 3 insertions(+), 1
On Fri, Feb 11, 2022 at 14:34:04 +0100, Jiri Denemark wrote:
> This partially reverts commit 0fc4a43d248b86fd54ad7323beb66faec8c1043c.
>
> Signed-off-by: Jiri Denemark
> ---
> tests/securityselinuxlabeltest.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git
This transition will make it easier for me to generalize jobs in
the future as they will always use virDomainJobData and
virDomainJobInfo will be only used in the public api..
Signed-off-by: Kristina Hanicova
---
src/libxl/libxl_domain.c | 10 +-
src/libxl/libxl_domain.h | 3 ++-
This patch includes:
* introducing new files: src/hypervisor/domain_job.c and
src/hypervisor/domain_job.h
* new struct virDomainJobData, which is almost the same as
qemuDomainJobInfo - the only differences are moving qemu specific
job stats into the qemuDomainJobDataPrivate and adding jobType
We only need to set statsType in almost every case of setting
something from private data, so it seems unnecessary to pull
privateData out of current / completed job for just this one
thing every time. I think this patch keeps the code cleaner
without variables used just once.
Signed-off-by:
v1 is here:
https://listman.redhat.com/archives/libvir-list/2022-January/msg00958.html
diff to v1:
* rebase onto the current master
(bellow are the ones suggested by Jirka, thanks)
* removed check if callbacks exists when cb struct exists
* renamed functions from qemuDomainJobInfoX to
On Fri, Feb 11, 2022 at 14:26:12 +0100, Michal Prívozník wrote:
> On 2/11/22 13:39, Jiri Denemark wrote:
> > Otherwise devAddr.multi would be uninitialized.
> >
> > Signed-off-by: Jiri Denemark
> > ---
> > src/conf/node_device_conf.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
On Fri, Feb 11, 2022 at 14:36:51 +0100, Michal Privoznik wrote:
> There are few places where a virPCIDeviceAddress typed variable
> is allocated on the stack but it's not initialized. This can lead
> to random values of its members which in turn can lead to a
> random behaviour.
>
> Generated
There are few places where a virPCIDeviceAddress typed variable
is allocated on the stack but it's not initialized. This can lead
to random values of its members which in turn can lead to a
random behaviour.
Generated with help of the following spatch:
@@
identifier I;
@@
-
On 2/11/22 13:29, Jiri Denemark wrote:
> If 1024 was not enough to fit the DN, gnutls_x509_crt_get_dn would store
> the required size in subjectlen. And since we're not checking the return
> value of this function, we would happily overwrite some random memory.
>
> Signed-off-by: Jiri Denemark
>
This partially reverts commit 0fc4a43d248b86fd54ad7323beb66faec8c1043c.
Signed-off-by: Jiri Denemark
---
tests/securityselinuxlabeltest.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index
On 2/11/22 13:39, Jiri Denemark wrote:
> Otherwise devAddr.multi would be uninitialized.
>
> Signed-off-by: Jiri Denemark
> ---
> src/conf/node_device_conf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Oh, there are more places like this. But it's not something that a small
On 2/11/22 13:59, Jiri Denemark wrote:
> All callers currently guarantee flags passed to virDomainObjGetMessages
> are either zero or contain at least one of the supported flags. But it
> doesn't mean we should not check for the possibility an unknown flag was
> the only one passed to
All callers currently guarantee flags passed to virDomainObjGetMessages
are either zero or contain at least one of the supported flags. But it
doesn't mean we should not check for the possibility an unknown flag was
the only one passed to virDomainObjGetMessages.
Signed-off-by: Jiri Denemark
---
On Fri, Feb 11, 2022 at 01:30:29PM +0100, Michal Privoznik wrote:
> After previous commits, the cleanup label shrank to plain
> 'return' statement. There's no point in having such label, so
> drop it.
>
> Signed-off-by: Michal Privoznik
> ---
> src/qemu/qemu_process.c | 11 ---
> 1 file
On Fri, Feb 11, 2022 at 01:30:26PM +0100, Michal Privoznik wrote:
> When rewriting a file using virFileRewrite() and error occurs
> while writing into a temporary file it's actually the callback
> that can report the most accurate error. Move error reporting
> into very few callback we have
On Fri, Feb 11, 2022 at 01:30:27PM +0100, Michal Privoznik wrote:
> After previous commits there is no need for qemuPrepareNVRAM() to
> open code virFileRewrite(). Deduplicate the code by calling the
> function.
>
> Signed-off-by: Michal Privoznik
> ---
> src/qemu/qemu_process.c | 112
On Fri, Feb 11, 2022 at 01:30:28PM +0100, Michal Privoznik wrote:
> Nothing inside the qemuPrepareNVRAM function relies on @srcFD
> being closed early and nothing closes it early. It's okay then to
> close it automatically when leaving the function.
>
> Signed-off-by: Michal Privoznik
> ---
>
Otherwise devAddr.multi would be uninitialized.
Signed-off-by: Jiri Denemark
---
src/conf/node_device_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 61c8715037..eaa42c05ee 100644
---
After previous commits there is no need for qemuPrepareNVRAM() to
open code virFileRewrite(). Deduplicate the code by calling the
function.
Signed-off-by: Michal Privoznik
---
src/qemu/qemu_process.c | 112
1 file changed, 44 insertions(+), 68
Nothing inside the qemuPrepareNVRAM function relies on @srcFD
being closed early and nothing closes it early. It's okay then to
close it automatically when leaving the function.
Signed-off-by: Michal Privoznik
---
src/qemu/qemu_process.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Jiri Denemark (2):
qemu_migration_cookie: Rename ret in qemuDomainExtractTLSSubject
qemu_migration_cookie: Properly fetch cert DN
src/qemu/qemu_migration_cookie.c | 34
1 file changed, 21 insertions(+), 13 deletions(-)
--
2.35.0
When rewriting a file using virFileRewrite() and error occurs
while writing into a temporary file it's actually the callback
that can report the most accurate error. Move error reporting
into very few callback we have currently. Those callbacks are
trivial so the benefit of this change is not
After previous commits, the cleanup label shrank to plain
'return' statement. There's no point in having such label, so
drop it.
Signed-off-by: Michal Privoznik
---
src/qemu/qemu_process.c | 11 ---
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_process.c
v2 of:
https://listman.redhat.com/archives/libvir-list/2022-February/msg00330.html
I've pushed patches 1/5 and 2/5 from the original patchset because they
were independent.
diff to v1:
- Reworked virFileRewrite() so that it's callback's responsibility to
report error,
- More trivial cleanups
Currently, due to the way virFileRewrite() works, the rewritten
file is owned by user and group that the daemon runs under. So
far, this is not a problem, because the function is used to write
XML files or secrets for persistent objects (domains, networks,
etc.) and we don't need other users to
On Thu, Feb 10, 2022 at 17:03:01 +0100, Ján Tomko wrote:
> On a Thursday in 2022, Jiri Denemark wrote:
> >If 1024 was not enough to fit the DN, gnutls_x509_crt_get_dn would store
> >the required size in subjectlen. And since we're not checking the return
> >value of this function, we would happily
We use 'ret' for storing values to be returned from a function. Return
values from called functions that are not supposed to be returned
further are usually called 'rv' (or 'rc').
Signed-off-by: Jiri Denemark
Reviewed-by: Ján Tomko
---
Notes:
Version 2:
- no change
If 1024 was not enough to fit the DN, gnutls_x509_crt_get_dn would store
the required size in subjectlen. And since we're not checking the return
value of this function, we would happily overwrite some random memory.
Signed-off-by: Jiri Denemark
---
Notes:
Version 2:
- do not pass NULL
The typical scenario for UEFI is that we have readonly firmware with
separate NVRAM
/some/ovmf/path_CODE.fd
In this case we of course copy path_VARS.fd into a private file
path we invent under /var/lib. The user can give an explicit
NVRAM path too:
/some/ovmf/path_CODE.fd
Signed-off-by: Tim Wiederhake
---
src/vbox/vbox_common.c | 18 +++---
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 40180b0dfd..36db6e06be 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -224,7
Signed-off-by: Tim Wiederhake
---
src/util/virfirewall.c | 13 -
tools/virsh.c | 12 ++--
tools/virt-admin.c | 12 ++--
tools/vsh.c| 8
4 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/src/util/virfirewall.c
Signed-off-by: Tim Wiederhake
---
tests/qemumonitortestutils.c | 65
1 file changed, 28 insertions(+), 37 deletions(-)
diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index ce8e6e1645..86300da68a 100644
---
Signed-off-by: Tim Wiederhake
---
tests/qemusecuritymock.c | 88 +---
1 file changed, 29 insertions(+), 59 deletions(-)
diff --git a/tests/qemusecuritymock.c b/tests/qemusecuritymock.c
index 778b0561ac..03c818d8a3 100644
--- a/tests/qemusecuritymock.c
+++
Signed-off-by: Tim Wiederhake
---
src/util/virtpm.c | 39 ---
1 file changed, 12 insertions(+), 27 deletions(-)
diff --git a/src/util/virtpm.c b/src/util/virtpm.c
index c02b42f948..ca7506d82e 100644
--- a/src/util/virtpm.c
+++ b/src/util/virtpm.c
@@ -137,18
Signed-off-by: Tim Wiederhake
---
src/util/virlockspace.c | 106 +---
1 file changed, 33 insertions(+), 73 deletions(-)
diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index a7f1c2324f..79925053bf 100644
--- a/src/util/virlockspace.c
+++
Signed-off-by: Tim Wiederhake
---
src/vmware/vmware_driver.c | 100 -
1 file changed, 31 insertions(+), 69 deletions(-)
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index 998ecdb546..da66f98db0 100644
--- a/src/vmware/vmware_driver.c
Signed-off-by: Tim Wiederhake
---
src/secret/secret_driver.c | 54 +++---
1 file changed, 21 insertions(+), 33 deletions(-)
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index d0e819809b..09782b38d3 100644
--- a/src/secret/secret_driver.c
If the mutex is part of the `driver` object, it cannot guard that
object's creation and destruction perfectly.
Signed-off-by: Tim Wiederhake
---
src/secret/secret_driver.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/secret/secret_driver.c
Signed-off-by: Tim Wiederhake
---
src/vz/vz_driver.c | 44 ++--
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index be3e5e4b49..86bc53d631 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@
Use the recently implemented VIR_LOCK_GUARD and VIR_WITH_MUTEX_LOCK_GUARD
to simplify mutex management.
Tim Wiederhake (10):
vz: Use automatic mutex management
vmware: Use automatic mutex management
secret: Factor out mutex
secret: Use automatic mutex management
virlockspace: Use
On Wed, Feb 09, 2022 at 01:58:07PM +0100, Michal Privoznik wrote:
> Even though the CH driver doesn't implement virNetworkUpdate()
> API, when it does it will see the arguments in correct order.
> This is similar to other drivers that don't implement the API,
> like ESX, libxl, LXC, etc. Enabling
On Thu, Feb 10, 2022 at 03:13:26PM -0600, Jonathon Jongsma wrote:
> Add the ability to specify the 'blob=on/off' option to qemu for the
> virtio-vga/virtio-gpu device.
It would be nice to explain what the blob option actually
does...
> Resolves:
On 2/7/22 14:12, Tim Wiederhake wrote:
> Use the recently implemented VIR_LOCK_GUARD and VIR_WITH_MUTEX_LOCK_GUARD
> to simplify mutex management.
>
> This made a solitary "virMutexUnlock()" call without previous call to
> "virMutexLock()" in ch_driver.c obvious, which is removed in patch #8.
>
On Thu, 2022-02-10 at 16:51 +0100, Michal Privoznik wrote:
> While reviewing Tim's patches [1] I've found couple of places in CH
> driver that are downright bugs. Fix them.
>
> 1:
> https://listman.redhat.com/archives/libvir-list/2022-February/msg00226.html
>
> Michal Prívozník (6):
>
On 2/10/22 17:16, Daniel P. Berrangé wrote:
> On Thu, Feb 10, 2022 at 12:13:26PM +0100, Michal Privoznik wrote:
>> After previous commits there is no need for qemuPrepareNVRAM() to
>> open code virFileRewrite(). Deduplicate the code by calling the
>> function.
>>
>> Signed-off-by: Michal Privoznik
On 2/10/22 17:12, Daniel P. Berrangé wrote:
> On Thu, Feb 10, 2022 at 12:13:25PM +0100, Michal Privoznik wrote:
>> Sometimes it may be handy for the callback to report error, even
>> though our current callbacks are trivial. Let's report an error
>> only if callback returns a well known value,
66 matches
Mail list logo