Re: [PATCH] fix uint64 underflow

2023-09-18 Thread Michal Prívozník
On 9/12/23 16:50, Dmitry Frolov wrote: > According to previous statement, > 'free_mem' is less than 'needed_mem'. > So, the subtraction 'free_mem - needed_mem' is negative, > and will raise uint64 underflow. > > Signed-off-by: Dmitry Frolov > --- > src/libxl/libxl_domain.c | 2 +- > 1 file

Re: [libvirt PATCH 09/12] ci: jobs.sh: run_cmd: Use eval to run commands

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:45PM +0200, Erik Skultety wrote: > We tried to evade usage of eval in commit 6214ae55f6a, but trying to > use I/O redirections with a command doesn't have the desired effect, > because when Shell eats the redirection it is applied to anything > inside the run_cmd

Re: [PATCH] src: Avoid needless checks before calling g_strdup()

2023-09-18 Thread Ján Tomko
On a Monday in 2023, Michal Privoznik wrote: There are few places where the following pattern occurs: if (var) other = g_strdup(var); where @other wasn't initialized before g_strdup(). Checking for var != NULL is useless in this case, as that's exactly what g_strdup() does (in which case

[libvirt PATCH v3 10/10] NEWS: document support for reverting external snapshots

2023-09-18 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- NEWS.rst | 8 1 file changed, 8 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 926620b03f..940e6e348a 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -23,6 +23,14 @@ v9.8.0 (unreleased) * **New features** + * QEMU: implement reverting external

Re: [PATCH] fix uint64 underflow

2023-09-18 Thread Дмитрий Фролов
Hi, Michal Of course, this changes the semantics. To my opinion, it is obvious from the source code, that we need some additional memory. I really doubt, that we intended to allocate some Exabytes additionally (using dirty underflow hack by the way). Dmitry 18.09.2023 10:59, Michal Prívozník

Re: [libvirt PATCH 08/12] ci: jobs: run_integration: Make POSIX-compliant

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:44PM +0200, Erik Skultety wrote: > Neither '&>' nor 'source' are defined in POSIX. > > Signed-off-by: Erik Skultety > --- > ci/jobs.sh | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/ci/jobs.sh b/ci/jobs.sh > index

[libvirt PATCH v3 01/10] qemu_saveimage: extract starting process to qemuSaveImageStartProcess

2023-09-18 Thread Pavel Hrdina
Part of qemuSaveImageStartVM() function will be used when reverting external snapshots. To avoid duplicating code and logic extract the shared bits into separate function. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_saveimage.c | 96 +++

[libvirt PATCH v3 03/10] qemu_saveimage: move qemuSaveImageStartProcess to qemu_process

2023-09-18 Thread Pavel Hrdina
The function will no longer be used only when restoring VM as it will be used when reverting snapshot as well so move it to qemu_process and rename it accordingly. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_process.c | 73 + src/qemu/qemu_process.h |

[libvirt PATCH v3 04/10] qemuProcessStartWithMemoryState: allow setting reason for audit log

2023-09-18 Thread Pavel Hrdina
When called by snapshot code we will need to use different reason. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_process.c | 6 +- src/qemu/qemu_process.h | 1 + src/qemu/qemu_saveimage.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git

[libvirt PATCH v3 09/10] capabilities: report full external snapshot support

2023-09-18 Thread Pavel Hrdina
Now that deleting and reverting external snapshots is implemented we can report that in capabilities so management applications can use that information and start using external snapshots. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- docs/formatcaps.rst

[libvirt PATCH v3 05/10] qemuProcessStartWithMemoryState: add snapshot argument

2023-09-18 Thread Pavel Hrdina
When called from snapshot code we will need to pass snapshot object in order to make internal snapshots work correctly. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_process.c | 9 - src/qemu/qemu_process.h | 1 + src/qemu/qemu_saveimage.c | 2 +- 3 files changed, 10 insertions(+),

[libvirt PATCH v3 06/10] qemuProcessStartWithMemoryState: make it possible to use without data

2023-09-18 Thread Pavel Hrdina
When used with internal snapshots there is no memory state file so we have no data to load and decompression is not needed. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_process.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git

[libvirt PATCH v3 08/10] qemu_snapshot: correctly load the saved memory state file

2023-09-18 Thread Pavel Hrdina
Original code assumed that the memory state file is only migration stream but it has additional metadata stored by libvirt. To correctly load the memory state file we need to reuse code that is used when restoring domain from saved image. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c

[libvirt PATCH v3 07/10] qemu_snapshot: fix reverting external snapshot when not all disks are included

2023-09-18 Thread Pavel Hrdina
We need to skip all disks that have snapshot type other than 'external'. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_snapshot.c | 12 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index cdc8e12cff..44bd97e564 100644 ---

[libvirt PATCH v3 02/10] qemu_saveimage: introduce helpers to decompress memory state file

2023-09-18 Thread Pavel Hrdina
These new helpers separates the code from the logic used to start new QEMU process with memory state and will make it easier to move qemuSaveImageStartProcess() into qemu_process.c file. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_saveimage.c | 155 +++---

[libvirt PATCH v3 00/10] external snapshot revert fixes

2023-09-18 Thread Pavel Hrdina
This fixes reverting external snapshots to not error out in cases where it should work and makes it correctly load the memory state when reverting to snapshot of running VM. This discards v2 completely and makes changes to v1: - moves qemuSaveImageStartProcess to qemu_process as

[PATCH] src: Avoid needless checks before calling g_strdup()

2023-09-18 Thread Michal Privoznik
There are few places where the following pattern occurs: if (var) other = g_strdup(var); where @other wasn't initialized before g_strdup(). Checking for var != NULL is useless in this case, as that's exactly what g_strdup() does (in which case it returns NULL). Signed-off-by: Michal

Re: [libvirt PATCH 09/12] ci: jobs.sh: run_cmd: Use eval to run commands

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 01:47:03PM +0200, Erik Skultety wrote: > On Mon, Sep 18, 2023 at 11:31:53AM +0100, Daniel P. Berrangé wrote: > > On Mon, Sep 18, 2023 at 12:22:45PM +0200, Erik Skultety wrote: > > > We tried to evade usage of eval in commit 6214ae55f6a, but trying to > > > use I/O

Re: [libvirt PATCH 01/12] syntax-check: Drop the shell's 'check for minus' rule

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:37PM +0200, Erik Skultety wrote: > Apparently we've only had it because the -[ao] options weren't portable > at the time, but according to > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html > > both are defined in POSIX.1-2017 revision which is

Re: [PATCH 3/8] Add Event ID, Server side dispatcher and virsh print function

2023-09-18 Thread Michal Prívozník
On 9/3/23 16:58, K Shiva Kiran wrote: > Adds the following for Network Metadata change callback events: > > - New Event ID VIR_NETWORK_EVENT_ID_METADATA_CHANGE > - Server side dispatcher > > virsh: > - New event type `metadata-change` > - vshEventMetadataChangePrint() to display the above

Re: [PATCH 0/8] network: Add callback for metadata changes

2023-09-18 Thread Michal Prívozník
On 9/3/23 16:58, K Shiva Kiran wrote: > This patchset adds support to trigger an event upon changes in the > content of ``, `` or `` in the network. > > K Shiva Kiran (8): > Define Network Metadata change callback function > Define Network event struct for Metadata change > Add Event ID,

Re: [PATCH 4/8] Add methods to create Metadata change events

2023-09-18 Thread Michal Prívozník
On 9/3/23 16:58, K Shiva Kiran wrote: > Adds two new private methods to create metadata change events: > - virNetworkEventMetadataChangeNewFromNet() > - virNetworkEventMetadataChangeNewFromObj() > > Signed-off-by: K Shiva Kiran > --- > src/conf/network_event.c | 48

[libvirt PATCH 01/12] syntax-check: Drop the shell's 'check for minus' rule

2023-09-18 Thread Erik Skultety
Apparently we've only had it because the -[ao] options weren't portable at the time, but according to https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html both are defined in POSIX.1-2017 revision which is old enough for all our supported platforms to have adopted it already.

[libvirt PATCH 04/12] ci: integration: Drop the 'install-deps' hidden job and reference

2023-09-18 Thread Erik Skultety
Since the section now only consists of a single command, we can happily move the command to the main integration template job body. Signed-off-by: Erik Skultety --- ci/integration-template.yml | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ci/integration-template.yml

[libvirt PATCH 00/12] Extract the integration job commands to a shell script

2023-09-18 Thread Erik Skultety
Now that we have our base GitLab jobs extracted to ci/jobs.sh file, let's stay consistent and do the same for the core integration tests job template. Technically a v2 of: https://listman.redhat.com/archives/libvir-list/2023-January/237201.html Despite the above, quite a few things have changed,

Re: [libvirt PATCH 09/12] ci: jobs.sh: run_cmd: Use eval to run commands

2023-09-18 Thread Erik Skultety
On Mon, Sep 18, 2023 at 11:31:53AM +0100, Daniel P. Berrangé wrote: > On Mon, Sep 18, 2023 at 12:22:45PM +0200, Erik Skultety wrote: > > We tried to evade usage of eval in commit 6214ae55f6a, but trying to > > use I/O redirections with a command doesn't have the desired effect, > > because when

Re: [libvirt PATCH 05/12] ci: jobs.sh: Drop comment about the need for Avocado 98.0

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:41PM +0200, Erik Skultety wrote: > We needed v98.0 due to a bug in the past and have been installing the > latest Avocado for a while, yet we kept the comment by a mistake. > Besides, looks like v98.0 ignores the avocado.config file in the TCK > repo instructing it to

[libvirt PATCH 02/12] ci: integration: Extract the integration CI main recipe to jobs.sh

2023-09-18 Thread Erik Skultety
Follow what's been done to other jobs in .gitlab-ci.yml and extract the shell logic from YAML to a function in ci/jobs.sh Signed-off-by: Erik Skultety --- ci/integration-template.yml | 36 ++-- ci/jobs.sh | 32 2

Re: [libvirt PATCH 06/12] ci: jobs.sh: integration: Use --quiet with virsh

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:42PM +0200, Erik Skultety wrote: > We've not been interested in any extra output from the command at all > since we always redirected both stdout and stderr to /dev/null. Future > patch will change that slightly, so --quiet will start making sense. > > Signed-off-by:

Re: [libvirt PATCH 07/12] ci: jobs.sh: run_integration: Add/Rewrite/Reformat commentaries

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:43PM +0200, Erik Skultety wrote: > Because of the nature of writing inline shell commands to YAML, most of > the commentaries where inlined with the command not to hinder YAML > readability any further. Since we moved the logic to a standalone > script, we can now do

Plans for 9.8.0 release (freeze on Tuesday 26 Sep)

2023-09-18 Thread Jiri Denemark
We are getting close to 9.8.0 release of libvirt. To aim for the release on Monday 02 Oct I suggest entering the freeze on Tuesday 26 Sep and tagging RC2 on Friday 29 Sep. I hope this works for everyone. Jirka

[libvirt PATCH 09/12] ci: jobs.sh: run_cmd: Use eval to run commands

2023-09-18 Thread Erik Skultety
We tried to evade usage of eval in commit 6214ae55f6a, but trying to use I/O redirections with a command doesn't have the desired effect, because when Shell eats the redirection it is applied to anything inside the run_cmd function, even the print command we use for debugging purposes. In order to

[libvirt PATCH 05/12] ci: jobs.sh: Drop comment about the need for Avocado 98.0

2023-09-18 Thread Erik Skultety
We needed v98.0 due to a bug in the past and have been installing the latest Avocado for a while, yet we kept the comment by a mistake. Besides, looks like v98.0 ignores the avocado.config file in the TCK repo instructing it to run the test suite sequentially leading to test stability issues, so

[libvirt PATCH 10/12] ci: jobs: integration: Execute raw commands via 'run_cmd' helper

2023-09-18 Thread Erik Skultety
Unfortunately, once we go down the line of running our own scripts as part of GitLab CI jobs rather than open coding Shell in YAML, we lose the benefit of seeing each line the script executes. The downside of the default YAML however is that we have to maintain the same piece of code on 2 places

[libvirt PATCH 06/12] ci: jobs.sh: integration: Use --quiet with virsh

2023-09-18 Thread Erik Skultety
We've not been interested in any extra output from the command at all since we always redirected both stdout and stderr to /dev/null. Future patch will change that slightly, so --quiet will start making sense. Signed-off-by: Erik Skultety --- ci/jobs.sh | 2 +- 1 file changed, 1 insertion(+), 1

[libvirt PATCH 07/12] ci: jobs.sh: run_integration: Add/Rewrite/Reformat commentaries

2023-09-18 Thread Erik Skultety
Because of the nature of writing inline shell commands to YAML, most of the commentaries where inlined with the command not to hinder YAML readability any further. Since we moved the logic to a standalone script, we can now do whatever formatting & readability adjustments we want. Signed-off-by:

[libvirt PATCH 12/12] ci: jobs.sh: Define and create SCRATCH_DIR for local executions

2023-09-18 Thread Erik Skultety
Running outside of GitLab will likely not have the variable set and hence the execution would fail. To make sure we always start with a clean scratch dir (which may or may not be the best thing), create it with 'mktemp'. The main reason for a temporary directory is to ensure a clean environment

[libvirt PATCH 08/12] ci: jobs: run_integration: Make POSIX-compliant

2023-09-18 Thread Erik Skultety
Neither '&>' nor 'source' are defined in POSIX. Signed-off-by: Erik Skultety --- ci/jobs.sh | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/jobs.sh b/ci/jobs.sh index 37bca452fa..f4e83dda2e 100644 --- a/ci/jobs.sh +++ b/ci/jobs.sh @@ -91,7 +91,7 @@

[libvirt PATCH 11/12] ci: jobs: run_integration: Print DAEMONS variable for debugging

2023-09-18 Thread Erik Skultety
One advantage that GitLab's YAML has with Shell commands is that every single line is printed out as is, including control structures. In order to see whether the logic did the same thing and the tests are going to operate on the right set of daemons (monolithic vs modular), lets print the DAEMONS

Re: [libvirt PATCH 11/12] ci: jobs: run_integration: Print DAEMONS variable for debugging

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:47PM +0200, Erik Skultety wrote: > One advantage that GitLab's YAML has with Shell commands is that every > single line is printed out as is, including control structures. In > order to see whether the logic did the same thing and the tests are > going to operate on

Re: [libvirt PATCH 10/12] ci: jobs: integration: Execute raw commands via 'run_cmd' helper

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:46PM +0200, Erik Skultety wrote: > Unfortunately, once we go down the line of running our own scripts as > part of GitLab CI jobs rather than open coding Shell in YAML, we lose > the benefit of seeing each line the script executes. The downside of > the default YAML

Re: [libvirt PATCH 12/12] ci: jobs.sh: Define and create SCRATCH_DIR for local executions

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:48PM +0200, Erik Skultety wrote: > Running outside of GitLab will likely not have the variable set and > hence the execution would fail. To make sure we always start with a > clean scratch dir (which may or may not be the best thing), create it > with 'mktemp'. The

[libvirt PATCH 03/12] ci: integration: Adjust the check for CentOS Stream version

2023-09-18 Thread Erik Skultety
All supported versions of Fedora and CentOS Stream 9 default to modular setup, it's probably better if we cosmetically adjust the CentOS Stream version check to make it explicit that monolithic daemon services ought to be started only on Stream 8. Signed-off-by: Erik Skultety --- ci/jobs.sh | 2

Re: [libvirt PATCH 03/12] ci: integration: Adjust the check for CentOS Stream version

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:39PM +0200, Erik Skultety wrote: > All supported versions of Fedora and CentOS Stream 9 default to modular > setup, it's probably better if we cosmetically adjust the CentOS Stream > version check to make it explicit that monolithic daemon services ought > to be

Re: [libvirt PATCH 04/12] ci: integration: Drop the 'install-deps' hidden job and reference

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:40PM +0200, Erik Skultety wrote: > Since the section now only consists of a single command, we can happily > move the command to the main integration template job body. > > Signed-off-by: Erik Skultety > --- > ci/integration-template.yml | 6 +- > 1 file

Re: [libvirt PATCH 02/12] ci: integration: Extract the integration CI main recipe to jobs.sh

2023-09-18 Thread Daniel P . Berrangé
On Mon, Sep 18, 2023 at 12:22:38PM +0200, Erik Skultety wrote: > Follow what's been done to other jobs in .gitlab-ci.yml and extract the > shell logic from YAML to a function in ci/jobs.sh > > Signed-off-by: Erik Skultety > --- > ci/integration-template.yml | 36

Share qemuInterfacexxxxConnect methods with ch

2023-09-18 Thread Praveen Paladugu
Folks, I am working on upstreaming network support for ch driver. Like qemu driver,ch driver invokes steps in qemuInterfaceEthernetConnect, qemuInterfaceBridgeConnect methods to connect tap devices to appropriate host backends. Current implementation clones aboves methods to ch_interface files

[PATCH] libxl: Fix Domain-0 ballooning logic

2023-09-18 Thread Jim Fehlig
When Domain-0 autoballooning is enabled, it's possible that memory may need to be ballooned down in Domain-0 to accommodate the needs of another virtual machine. libxlDomainFreeMemory handles this task, but due to a logic bug is underflowing the variable containing Domain-0 new target memory. The

Re: [PATCH] fix uint64 underflow

2023-09-18 Thread Jim Fehlig
On 9/18/23 02:22, Дмитрий Фролов wrote: Hi, Michal Of course, this changes the semantics. To my opinion, it is obvious from the source code, that we need some additional memory. I really doubt, that we intended to allocate some Exabytes additionally (using dirty underflow hack by the way).