On 2020/7/8 上午3:54, Peter Xu wrote:
On Tue, Jul 07, 2020 at 04:03:10PM +0800, Jason Wang wrote:
On 2020/7/3 下午9:03, Peter Xu wrote:
On Fri, Jul 03, 2020 at 03:24:19PM +0800, Jason Wang wrote:
On 2020/7/2 下午11:45, Peter Xu wrote:
On Thu, Jul 02, 2020 at 11:01:54AM +0800, Jason Wang wrote:
Add link and description of libvirt knowledge base to make it
easier for users and testers to understand libvirt.
Signed-off-by: Jianan Gao
---
docs/index.html.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/docs/index.html.in b/docs/index.html.in
index 26e8406917..586defff54 100644
libvirt has several uses of xmlNodeGetContent() (from libxml2) added at
different times over the years. Some of those uses report an Out of
Memory error when xmlNodeGetContent() returns NULL, and some of them
ignore a NULL return (treating it as if it were ""), and some just
assume that the
Signed-off-by: Laine Stump
---
src/network/bridge_driver.c | 45 +++--
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 79b2ca3330..7d81d4dd78 100644
--- a/src/network/bridge_driver.c
Signed-off-by: Laine Stump
---
src/nwfilter/nwfilter_dhcpsnoop.c | 16
src/nwfilter/nwfilter_driver.c| 10 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 2 +-
src/nwfilter/nwfilter_gentech_driver.c| 6 +++---
src/nwfilter/nwfilter_learnipaddr.c
g_new() is used in only 3 places. Switching them to g_new0() will do
no harm, reduces confusion, and helps me sleep better at night knowing
that all allocated memory is initialized to 0 :-) (Yes, I *know* that
in all three cases the associated memory is immediately assigned some
other value.
This includes standard g_autofree() as well as other objects that have
a cleanup function defined to use via g_autoptr (virCommand,
virJSONValue)
Signed-off-by: Laine Stump
---
src/network/bridge_driver.c | 206 ++
src/network/bridge_driver_linux.c | 7 +-
Rather than having labels named exit, done, exit_snooprequnlock,
skip_rename, etc, use the standard "cleanup" label. And instead of
err_exit, malformed, tear_down_tmpebchains, use "error".
Signed-off-by: Laine Stump
---
src/nwfilter/nwfilter_dhcpsnoop.c | 36 +++
Signed-off-by: Laine Stump
---
src/nwfilter/nwfilter_dhcpsnoop.c | 9 +++--
src/nwfilter/nwfilter_driver.c| 3 +--
src/nwfilter/nwfilter_ebiptables_driver.c | 3 +--
src/nwfilter/nwfilter_gentech_driver.c| 3 +--
src/nwfilter/nwfilter_learnipaddr.c | 6 ++
5
V1 was here:
https://www.redhat.com/archives/libvir-list/2020-June/msg01156.html
Some patches were ACKed and pushed. I re-ordered/re-organized most of
the rest, and removed some others to deal with separately (the
xmlNodeContent stuff)
What's left here is a few preliminary patches, then the
Signed-off-by: Laine Stump
---
src/nwfilter/nwfilter_dhcpsnoop.c | 91 +++
src/nwfilter/nwfilter_ebiptables_driver.c | 75 +++
src/nwfilter/nwfilter_gentech_driver.c| 15 ++--
src/nwfilter/nwfilter_learnipaddr.c | 7 +-
4 files changed, 61
Signed-off-by: Laine Stump
---
src/nwfilter/nwfilter_ebiptables_driver.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c
b/src/nwfilter/nwfilter_ebiptables_driver.c
index 426212e0dc..cc0f3f93d9 100644
---
It's possible/probable the callers to virNWFilterInstReset() make it
unnecessary to set the object's nrules to 0 after freeing all its
rules, but that same function is setting nfilters to 0, so let's do
the same for the sake of consistency.
Signed-off-by: Laine Stump
---
This rewrite of a nested conditional produces the same results, but
eliminate a goto and corresponding label.
Signed-off-by: Laine Stump
---
src/nwfilter/nwfilter_ebiptables_driver.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git
On failure, this function would clear out and free the list of
subchains it had been called with. This is unnecessary, because the
*only* caller of this function will also clear out and free the list
of subchains if it gets a failure from ebtablesGetSubChainInsts().
(It also makes more logical
Signed-off-by: Laine Stump
---
src/network/bridge_driver.c | 29 ++---
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 713763130b..ab359acdb5 100644
--- a/src/network/bridge_driver.c
+++
virNetworkDHCPLease and virNetworkDHCPLeaseFree() are declared in the
public API file libvirt-network.h, and we can't pollute that with glib
macro invocations, so put this in src/datatypes.h next to the other
virNetwork items.
Signed-off-by: Laine Stump
---
src/datatypes.h | 2 ++
1 file
Signed-off-by: Laine Stump
---
src/util/virdnsmasq.h | 4
1 file changed, 4 insertions(+)
diff --git a/src/util/virdnsmasq.h b/src/util/virdnsmasq.h
index 4c14bc6ca7..e3814c2eb1 100644
--- a/src/util/virdnsmasq.h
+++ b/src/util/virdnsmasq.h
@@ -78,10 +78,14 @@ typedef enum {
typedef
All these cleanup/error labels were reduced to having just "return
ret" by a previous patch, so get rid of them and return directly.
Signed-off-by: Laine Stump
---
src/network/bridge_driver.c | 264 --
src/network/bridge_driver_linux.c | 15 +-
2 files
On 7/3/20 3:56 AM, Daniel Veillard wrote:
It will also be my last release of libvirt after close to 15 years,
.
(I missed this sentence when I saw the mail the first time, and just now
it randomly popped up when scrolling through messages.)
Thanks for your helpful and positive attitude,
On 7/7/20 11:07 AM, Kevin Wolf wrote:
Am 06.07.2020 um 22:39 hat Eric Blake geschrieben:
There are many existing qcow2 images that specify a backing file but
no format. This has been the source of CVEs in the past, but has
become more prominent of a problem now that libvirt has switched to
On 7/7/20 10:23 AM, Peter Krempa wrote:
The semantics of the backup operation don't strictly require that all
disks being backed up are part of the same incremental part (when a disk
was checkpointed/backed up separately or in a different VM), or even
they may not have an previous checkpoint at
On Tue, Jul 07, 2020 at 04:03:10PM +0800, Jason Wang wrote:
>
> On 2020/7/3 下午9:03, Peter Xu wrote:
> > On Fri, Jul 03, 2020 at 03:24:19PM +0800, Jason Wang wrote:
> > > On 2020/7/2 下午11:45, Peter Xu wrote:
> > > > On Thu, Jul 02, 2020 at 11:01:54AM +0800, Jason Wang wrote:
> > > > > So I think
On 7/7/20 10:23 AM, Peter Krempa wrote:
Call the post-processing function so that we can validate that it does
the correct thing.
virDomainBackupAlignDisks requires disk definitions to be present so
let's fake them by copying disks from the backup definition and add one
extra disk
This callback is called when the server sends us STREAM_HOLE
meaning there is no real data, only zeroes. For regular files
we would just seek() beyond EOF and ftruncate() to create the
hole. But for block devices this won't work. Not only we can't
seek() beyond EOF, and ftruncate() will fail, this
On 7/7/20 10:23 AM, Peter Krempa wrote:
Format the disk state only when it isn't _NONE.
Signed-off-by: Peter Krempa
---
src/conf/backup_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Eric Blake
diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c
On 7/7/20 10:23 AM, Peter Krempa wrote:
Replace the output by a copy of the input file for further changes once
we start testing virDomainBackupAlignDisks.
Signed-off-by: Peter Krempa
---
.../backup-pull-internal-invalid.xml | 37 ++-
1 file changed, 36
This is very similar to previous commit.
The virshStreamInData() callback is used by virStreamSparseSendAll()
to detect whether the file the data is read from is in data or hole
section. The SendAll() will then send corresponding type of virStream
message to make server create a hole or write
This function will be used to detect zero buffers (which are
going to be interpreted as hole in virStream later).
I shamelessly took inspiration from coreutils.
Signed-off-by: Michal Privoznik
---
src/libvirt_private.syms | 1 +
src/util/virstring.c | 38
A cleanup function can be declared for virFDStreamMsg type so
that the structure doesn't have to be freed explicitly.
Signed-off-by: Michal Privoznik
---
src/util/virfdstream.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/util/virfdstream.c
The aim of virFileInDataDetectZeroes() is to mimic virFileInData()
so that it can be used in sparse virStream with very little change
to logic. This was implemented in previous commits. These two
functions act alike - the passed FD is rewound back to the position
it was in when either of the
We can't use virFileInData() with block devices, but we could use
new virFileInDataDetectZeroes(). But to decide we need to know if
the FD we are reading data from / writing data to is a block
device. Store this information in _virshStreamCallbackData.
Signed-off-by: Michal Privoznik
---
For libvirt, the volume is just a binary blob and it doesn't
interpret data on volume upload/download. But as it turns out,
this unspoken assumption is not clear to our users. Document it
explicitly.
Suggested in: https://bugzilla.redhat.com/show_bug.cgi?id=1851023#c17
Signed-off-by: Michal
Signed-off-by: Michal Privoznik
---
NEWS.rst | 7 +++
1 file changed, 7 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 232387ebdc..e225cbbcd3 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -15,6 +15,13 @@ v6.6.0 (unreleased)
* **Improvements**
+ * Allow sparse streams for block devices
When handling sparse stream, a thread is executed. This thread
runs a read() or write() loop (depending what API is called; in
this case it's virStorageVolDownload() and this the thread run
read() loop). The read() is handled in virFDStreamThreadDoRead()
which is then data/hole section aware,
Again, instead of closing FDs explicitly, we can automatically
close them when they go out of their respective scopes.
Signed-off-by: Michal Privoznik
---
src/util/virfdstream.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/util/virfdstream.c
This is similar to one of previous patches.
When receiving stream (on virStorageVolUpload() and subsequent
virStreamSparseSendAll()) we may receive a hole. If the volume we
are saving the incoming data into is a regular file we just
lseek() and ftruncate() to create the hole. But this won't work
This switch allow us to save a few lines of code.
Signed-off-by: Michal Privoznik
---
src/util/virfdstream.c | 20 +++-
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c
index 25661736ca..c85dee05c3 100644
---
For given file descriptor determine if the current position it is
in plus 1MiB (arbitrary chosen value) consists solely from zero
bytes or not. This is a block device friendly version of
virFileInData().
Signed-off-by: Michal Privoznik
---
src/libvirt_private.syms | 1 +
src/util/virfile.c
These callback will need to know more that the FD they are
working on. Pass the structure that is passed to other stream
callbacks (e.g. virshStreamSource() or virshStreamSourceSkip())
instead of inventing a new one.
Signed-off-by: Michal Privoznik
---
tools/virsh-util.c | 10 +-
The buffer that allocated in the virFDStreamThreadDoRead() can be
automatically freed, or if saved into the message structure it
can be stolen.
Signed-off-by: Michal Privoznik
---
src/util/virfdstream.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git
After previous cleanups, some labels in some functions have
nothing but 'return' statement in them. Drop the labels and
replace 'goto'-s with respective return statements.
Signed-off-by: Michal Privoznik
---
src/util/virfdstream.c | 24 +---
1 file changed, 9 insertions(+),
v2 of:
https://www.redhat.com/archives/libvir-list/2020-July/msg00145.html
diff to v1:
- Switch virfdstream to glib (patches 1-6)
- Document the feature in NEWS.rst
- Introduced test cases for virStringIsNull()
- Included what was WIP patch in v1 => patch 16 which ensures block
devices aren't
All callers of virFDStreamMsgQueuePush() have the same pattern:
they explicitly set @msg passed to NULL to avoid freeing it later
on. Well, the function can take address of the pointer and clear
it for them.
Signed-off-by: Michal Privoznik
---
src/util/virfdstream.c | 13 +
1 file
Am 06.07.2020 um 22:39 hat Eric Blake geschrieben:
> v5 was here:
> https://lists.gnu.org/archive/html/qemu-devel/2020-04/msg00679.html
> In v6:
> - add a few more patches
> - change qcow semantics based on several iterations of mailing list
> debates on what behavior is easiest to support
> - add
Am 06.07.2020 um 22:39 hat Eric Blake geschrieben:
> There are many existing qcow2 images that specify a backing file but
> no format. This has been the source of CVEs in the past, but has
> become more prominent of a problem now that libvirt has switched to
> -blockdev. With older -drive, at
Call the post-processing function so that we can validate that it does
the correct thing.
virDomainBackupAlignDisks requires disk definitions to be present so
let's fake them by copying disks from the backup definition and add one
extra disk 'vdextradisk'.
Signed-off-by: Peter Krempa
---
Format the disk state only when it isn't _NONE.
Signed-off-by: Peter Krempa
---
src/conf/backup_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c
index 781dd53f6b..5e4144d371 100644
--- a/src/conf/backup_conf.c
+++
The semantics of the backup operation don't strictly require that all
disks being backed up are part of the same incremental part (when a disk
was checkpointed/backed up separately or in a different VM), or even
they may not have an previous checkpoint at all (e.g. when the disk
was freshly
Replace the output by a copy of the input file for further changes once
we start testing virDomainBackupAlignDisks.
Signed-off-by: Peter Krempa
---
.../backup-pull-internal-invalid.xml | 37 ++-
1 file changed, 36 insertions(+), 1 deletion(-)
mode change 12 =>
This series addresses some of the testing issues raised in the review of
4/4. Patches 1-3 are new adding testing of virDomainBackupAlignDisks.
Peter Krempa (4):
backupxml2xmltest: Remove output symlink of
'backup-pull-internal-invalid'
virDomainBackupDiskDefFormat: Format internal disk
On Thu, Jul 02, 2020 at 14:31:19 -0500, Eric Blake wrote:
> On 7/2/20 9:40 AM, Peter Krempa wrote:
> > The semantics of the backup operation don't strictly require that all
> > disks being backed up are part of the same incremental part (when a disk
> > was checkpointed/backed up separately or in
Since the ESX virtual hardware version 4.0, virtual machines support up
to 10 virtual NICs instead of 4 previously. This changes the limit
accordingly based on the provided `virtualHW.version`.
Signed-off-by: Bastien Orivel
---
src/vmx/vmx.c | 20 ++--
src/vmx/vmx.h | 2 +-
2
On 7/7/20 9:14 AM, Ján Tomko wrote:
virFileIsAccessible does not return true on accessible
directories. Check whether it set EISDIR and only
then assume the directory is inaccessible.
Return 0 (not found) instead of 1 (found),
since the bridge driver taints the network based on
this return
Add headers with declarations of geteuid/getegid
and virGetUserName/virGetGroupName.
Signed-off-by: Nikolay Shirokovskiy
---
src/storage/storage_backend_vstorage.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/storage/storage_backend_vstorage.c
virFileIsAccessible does not return true on accessible
directories. Check whether it set EISDIR and only
then assume the directory is inaccessible.
Return 0 (not found) instead of 1 (found),
since the bridge driver taints the network based on
this return value, not whether the hook actually ran.
On Tue, Jul 07, 2020 at 06:36:23 -0500, Eric Blake wrote:
> On 7/7/20 2:12 AM, Peter Krempa wrote:
> >
> > 1) the virDomainBlockCopy operation flattens the backing chain into the
> > top level only. This means that must be stripped or the
> > operation rejected, as otherwise shutting down the VM
On 7/7/20 2:12 AM, Peter Krempa wrote:
You can install a qcow2 overlay on top of a raw file too. IMO the
implications of using allow that.
As said above I'd strongly prefer if the overlay is created in qemu
using the blockdev-create blockjob (there is already infrastructure in
libvirt to
On Tue, Jul 07, 2020 at 12:48:35PM +0200, Andrea Bolognani wrote:
> Changes from [v1]:
>
> * fix a few instances where we were still using github.com instead
> of libvirt.org for Go imports;
>
> * replace all uses of godoc.org, not just a subset.
>
> [v1]
On Thu, Jul 02, 2020 at 14:53:28 -0500, Eric Blake wrote:
> On 7/2/20 9:40 AM, Peter Krempa wrote:
> > Allow enabling TLS for the NBD server used to do pull-mode backups. Note
> > that documentation already mentions 'tls', so this just implements the
> > schema and XML bits.
> >
> >
On Tue, Jul 07, 2020 at 12:39:22PM +0200, Andrea Bolognani wrote:
> The former is the new recommended frontend for browsing Go API
> documentation online.
>
> Signed-off-by: Andrea Bolognani
> ---
> docs/libvirt-go-xml.rst | 2 +-
> docs/libvirt-go.rst | 2 +-
> 2 files changed, 2
Fixes: 193ad364062407c3fcd3267f0f135d8960b53020
Signed-off-by: Andrea Bolognani
---
docs/bindings.html.in | 2 +-
docs/docs.html.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/bindings.html.in b/docs/bindings.html.in
index 8a482015b9..081af25ebb 100644
---
Changes from [v1]:
* fix a few instances where we were still using github.com instead
of libvirt.org for Go imports;
* replace all uses of godoc.org, not just a subset.
[v1] https://www.redhat.com/archives/libvir-list/2020-July/msg00270.html
Andrea Bolognani (2):
docs: Use
The former is the new recommended frontend for browsing Go API
documentation online.
Signed-off-by: Andrea Bolognani
---
docs/bindings.html.in | 2 +-
docs/docs.html.in | 2 +-
docs/downloads.html.in | 4 ++--
docs/libvirt-go-xml.rst | 2 +-
docs/libvirt-go.rst | 2 +-
5 files
On Thu, Jul 02, 2020 at 14:42:50 -0500, Eric Blake wrote:
> On 7/2/20 9:40 AM, Peter Krempa wrote:
> > Introduce code which merges the appropriate bitmaps and queries the
> > final size of the backup, so that we can print the XML with size
> > information.
> >
> > Signed-off-by: Peter Krempa
> >
The former is the new recommended frontend for browsing Go API
documentation online.
Signed-off-by: Andrea Bolognani
---
docs/libvirt-go-xml.rst | 2 +-
docs/libvirt-go.rst | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/libvirt-go-xml.rst
On a Tuesday in 2020, Andrea Bolognani wrote:
On Tue, 2020-07-07 at 09:47 +0200, Peter Krempa wrote:
On Thu, Jul 02, 2020 at 18:13:49 +0200, Andrea Bolognani wrote:
> Can you please include updates to the release notes in your series?
> Based on the summary above, it sounds like most of the
On Sun, Jul 5, 2020 at 3:08 PM Philippe Mathieu-Daudé wrote:
>
> I tried to maintain the SPI mode because it is useful in
> tiny embedded devices, and thought it would be helpful for
> the AVR MCUs.
> As AVR was blocked, I thought it was wise to deprecate the
> SPI mode as users are interested in
On Tue, 2020-07-07 at 09:47 +0200, Peter Krempa wrote:
> On Thu, Jul 02, 2020 at 18:13:49 +0200, Andrea Bolognani wrote:
> > Can you please include updates to the release notes in your series?
> > Based on the summary above, it sounds like most of the changes will
> > be user-visible. Thanks!
>
>
On 2020/7/3 下午9:03, Peter Xu wrote:
On Fri, Jul 03, 2020 at 03:24:19PM +0800, Jason Wang wrote:
On 2020/7/2 下午11:45, Peter Xu wrote:
On Thu, Jul 02, 2020 at 11:01:54AM +0800, Jason Wang wrote:
So I think we agree that a new notifier is needed?
Good to me, or a new flag should be easier
On Thu, Jul 02, 2020 at 18:13:49 +0200, Andrea Bolognani wrote:
> On Thu, 2020-07-02 at 16:39 +0200, Peter Krempa wrote:
> > This series consists of multiple parts fixing the following bugs. Some
> > of them depend on previous so I'm sending it as one to prevent
> > conflicts.
> >
> > - Patches 1
On Mon, Jul 06, 2020 at 14:20:25 -0400, Masayoshi Mizuma wrote:
> From: Masayoshi Mizuma
>
> Add a unit test for transient option for qcow2 file.
>
> Signed-off-by: Masayoshi Mizuma
> ---
> tests/qemublocktest.c | 10 ++
>
On Mon, Jul 06, 2020 at 14:20:23 -0400, Masayoshi Mizuma wrote:
> From: Masayoshi Mizuma
>
> Here is the implementation of transient option for qcow2 file.
> This gets available directive in domain xml file
> like as:
>
>
>
>
>
>
>
>
> The internal
On Mon, Jul 06, 2020 at 00:07:31 +0200, Philippe Mathieu-Daudé wrote:
> SD cards be used with SPI, SD or MMC protocol.
>
> Unfortunately, maintaining the SPI protocol make improving the
> MMC mode very difficult. As of 2020 users are more interested
> in using cards with the MMC protocol.
>
>
On Mon, Jul 06, 2020 at 00:07:30 +0200, Philippe Mathieu-Daudé wrote:
> This device duplicate the SPI mode of the sd-card device. The
> SPI protocol is better handler in the sd-card, however as the
> TYPE_SSI_SLAVE is not an interface, the sd-card can not implement
> it easily to be pluggable on
> -Original Message-
> From: Daniel P. Berrangé [mailto:berra...@redhat.com]
> Sent: Monday, July 6, 2020 9:48 PM
> To: Wangxin (Alexander, Cloud Infrastructure Service Product Dept.)
>
> Cc: libvir-list@redhat.com; mklet...@redhat.com; Huangweidong (C)
>
> Subject: Re: [question]qemu:
76 matches
Mail list logo