* [PATCH 1/3] migration: compile migration/ram.c once
2025-07-25 20:17 [PATCH 0/3] single-binary: compile once migration files Pierrick Bouvier
@ 2025-07-25 20:17 ` Pierrick Bouvier
2025-07-25 20:26 ` Richard Henderson
2025-07-25 20:17 ` [PATCH 2/3] migration: rename target.c to vfio.c Pierrick Bouvier
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Pierrick Bouvier @ 2025-07-25 20:17 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Peter Xu, Fabiano Rosas,
Pierrick Bouvier
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
migration/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/migration/meson.build b/migration/meson.build
index 9aa48b290e2..36fb950b3b1 100644
--- a/migration/meson.build
+++ b/migration/meson.build
@@ -31,6 +31,7 @@ system_ss.add(files(
'multifd-zero-page.c',
'options.c',
'postcopy-ram.c',
+ 'ram.c',
'savevm.c',
'socket.c',
'tls.c',
@@ -50,5 +51,4 @@ system_ss.add(when: uadk, if_true: files('multifd-uadk.c'))
system_ss.add(when: qatzip, if_true: files('multifd-qatzip.c'))
specific_ss.add(when: 'CONFIG_SYSTEM_ONLY',
- if_true: files('ram.c',
- 'target.c'))
+ if_true: files('target.c'))
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 1/3] migration: compile migration/ram.c once
2025-07-25 20:17 ` [PATCH 1/3] migration: compile migration/ram.c once Pierrick Bouvier
@ 2025-07-25 20:26 ` Richard Henderson
0 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2025-07-25 20:26 UTC (permalink / raw)
To: qemu-devel
On 7/25/25 10:17, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> migration/meson.build | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/migration/meson.build b/migration/meson.build
> index 9aa48b290e2..36fb950b3b1 100644
> --- a/migration/meson.build
> +++ b/migration/meson.build
> @@ -31,6 +31,7 @@ system_ss.add(files(
> 'multifd-zero-page.c',
> 'options.c',
> 'postcopy-ram.c',
> + 'ram.c',
> 'savevm.c',
> 'socket.c',
> 'tls.c',
> @@ -50,5 +51,4 @@ system_ss.add(when: uadk, if_true: files('multifd-uadk.c'))
> system_ss.add(when: qatzip, if_true: files('multifd-qatzip.c'))
>
> specific_ss.add(when: 'CONFIG_SYSTEM_ONLY',
> - if_true: files('ram.c',
> - 'target.c'))
> + if_true: files('target.c'))
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] migration: rename target.c to vfio.c
2025-07-25 20:17 [PATCH 0/3] single-binary: compile once migration files Pierrick Bouvier
2025-07-25 20:17 ` [PATCH 1/3] migration: compile migration/ram.c once Pierrick Bouvier
@ 2025-07-25 20:17 ` Pierrick Bouvier
2025-07-25 20:27 ` Richard Henderson
2025-07-25 20:17 ` [PATCH 3/3] migration/vfio: compile only once Pierrick Bouvier
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Pierrick Bouvier @ 2025-07-25 20:17 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Peter Xu, Fabiano Rosas,
Pierrick Bouvier
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
migration/{target.c => vfio.c} | 2 +-
migration/meson.build | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
rename migration/{target.c => vfio.c} (90%)
diff --git a/migration/target.c b/migration/vfio.c
similarity index 90%
rename from migration/target.c
rename to migration/vfio.c
index 12fd399f0c5..0b64e49ef06 100644
--- a/migration/target.c
+++ b/migration/vfio.c
@@ -1,5 +1,5 @@
/*
- * QEMU live migration - functions that need to be compiled target-specific
+ * QEMU live migration - VFIO
*
* This work is licensed under the terms of the GNU GPL, version 2
* or (at your option) any later version.
diff --git a/migration/meson.build b/migration/meson.build
index 36fb950b3b1..45e9445f97d 100644
--- a/migration/meson.build
+++ b/migration/meson.build
@@ -51,4 +51,4 @@ system_ss.add(when: uadk, if_true: files('multifd-uadk.c'))
system_ss.add(when: qatzip, if_true: files('multifd-qatzip.c'))
specific_ss.add(when: 'CONFIG_SYSTEM_ONLY',
- if_true: files('target.c'))
+ if_true: files('vfio.c'))
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 2/3] migration: rename target.c to vfio.c
2025-07-25 20:17 ` [PATCH 2/3] migration: rename target.c to vfio.c Pierrick Bouvier
@ 2025-07-25 20:27 ` Richard Henderson
0 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2025-07-25 20:27 UTC (permalink / raw)
To: qemu-devel
On 7/25/25 10:17, Pierrick Bouvier wrote:
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> migration/{target.c => vfio.c} | 2 +-
> migration/meson.build | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> rename migration/{target.c => vfio.c} (90%)
>
> diff --git a/migration/target.c b/migration/vfio.c
> similarity index 90%
> rename from migration/target.c
> rename to migration/vfio.c
> index 12fd399f0c5..0b64e49ef06 100644
> --- a/migration/target.c
> +++ b/migration/vfio.c
> @@ -1,5 +1,5 @@
> /*
> - * QEMU live migration - functions that need to be compiled target-specific
> + * QEMU live migration - VFIO
> *
> * This work is licensed under the terms of the GNU GPL, version 2
> * or (at your option) any later version.
> diff --git a/migration/meson.build b/migration/meson.build
> index 36fb950b3b1..45e9445f97d 100644
> --- a/migration/meson.build
> +++ b/migration/meson.build
> @@ -51,4 +51,4 @@ system_ss.add(when: uadk, if_true: files('multifd-uadk.c'))
> system_ss.add(when: qatzip, if_true: files('multifd-qatzip.c'))
>
> specific_ss.add(when: 'CONFIG_SYSTEM_ONLY',
> - if_true: files('target.c'))
> + if_true: files('vfio.c'))
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] migration/vfio: compile only once
2025-07-25 20:17 [PATCH 0/3] single-binary: compile once migration files Pierrick Bouvier
2025-07-25 20:17 ` [PATCH 1/3] migration: compile migration/ram.c once Pierrick Bouvier
2025-07-25 20:17 ` [PATCH 2/3] migration: rename target.c to vfio.c Pierrick Bouvier
@ 2025-07-25 20:17 ` Pierrick Bouvier
2025-07-25 20:29 ` Richard Henderson
2025-07-25 21:11 ` [PATCH 0/3] single-binary: compile once migration files Fabiano Rosas
2025-07-28 20:04 ` Peter Xu
4 siblings, 1 reply; 9+ messages in thread
From: Pierrick Bouvier @ 2025-07-25 20:17 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Peter Xu, Fabiano Rosas,
Pierrick Bouvier
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
migration/vfio-stub.c | 16 ++++++++++++++++
migration/vfio.c | 14 --------------
migration/meson.build | 6 +++---
3 files changed, 19 insertions(+), 17 deletions(-)
create mode 100644 migration/vfio-stub.c
diff --git a/migration/vfio-stub.c b/migration/vfio-stub.c
new file mode 100644
index 00000000000..f59ebe075dc
--- /dev/null
+++ b/migration/vfio-stub.c
@@ -0,0 +1,16 @@
+/*
+ * QEMU live migration - stubs for VFIO
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "migration.h"
+
+void migration_populate_vfio_info(MigrationInfo *info)
+{
+}
+
+void migration_reset_vfio_bytes_transferred(void)
+{
+}
diff --git a/migration/vfio.c b/migration/vfio.c
index 0b64e49ef06..af6ae2c1e19 100644
--- a/migration/vfio.c
+++ b/migration/vfio.c
@@ -8,13 +8,8 @@
#include "qemu/osdep.h"
#include "qapi/qapi-types-migration.h"
#include "migration.h"
-#include CONFIG_DEVICES
-
-#ifdef CONFIG_VFIO
#include "hw/vfio/vfio-migration.h"
-#endif
-#ifdef CONFIG_VFIO
void migration_populate_vfio_info(MigrationInfo *info)
{
if (vfio_migration_active()) {
@@ -27,12 +22,3 @@ void migration_reset_vfio_bytes_transferred(void)
{
vfio_migration_reset_bytes_transferred();
}
-#else
-void migration_populate_vfio_info(MigrationInfo *info)
-{
-}
-
-void migration_reset_vfio_bytes_transferred(void)
-{
-}
-#endif
diff --git a/migration/meson.build b/migration/meson.build
index 45e9445f97d..0f71544a825 100644
--- a/migration/meson.build
+++ b/migration/meson.build
@@ -49,6 +49,6 @@ system_ss.add(when: zstd, if_true: files('multifd-zstd.c'))
system_ss.add(when: qpl, if_true: files('multifd-qpl.c'))
system_ss.add(when: uadk, if_true: files('multifd-uadk.c'))
system_ss.add(when: qatzip, if_true: files('multifd-qatzip.c'))
-
-specific_ss.add(when: 'CONFIG_SYSTEM_ONLY',
- if_true: files('vfio.c'))
+system_ss.add(when: 'CONFIG_VFIO',
+ if_true: files('vfio.c'),
+ if_false: files('vfio-stub.c'))
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 0/3] single-binary: compile once migration files
2025-07-25 20:17 [PATCH 0/3] single-binary: compile once migration files Pierrick Bouvier
` (2 preceding siblings ...)
2025-07-25 20:17 ` [PATCH 3/3] migration/vfio: compile only once Pierrick Bouvier
@ 2025-07-25 21:11 ` Fabiano Rosas
2025-07-28 20:04 ` Peter Xu
4 siblings, 0 replies; 9+ messages in thread
From: Fabiano Rosas @ 2025-07-25 21:11 UTC (permalink / raw)
To: Pierrick Bouvier, qemu-devel
Cc: Philippe Mathieu-Daudé, Peter Xu, Pierrick Bouvier
Pierrick Bouvier <pierrick.bouvier@linaro.org> writes:
> This series removes target dependencies in migration code.
>
> Pierrick Bouvier (3):
> migration: compile migration/ram.c once
> migration: rename target.c to vfio.c
> migration/vfio: compile only once
>
> migration/vfio-stub.c | 16 ++++++++++++++++
> migration/{target.c => vfio.c} | 16 +---------------
> migration/meson.build | 8 ++++----
> 3 files changed, 21 insertions(+), 19 deletions(-)
> create mode 100644 migration/vfio-stub.c
> rename migration/{target.c => vfio.c} (67%)
Series:
Acked-by: Fabiano Rosas <farosas@suse.de>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 0/3] single-binary: compile once migration files
2025-07-25 20:17 [PATCH 0/3] single-binary: compile once migration files Pierrick Bouvier
` (3 preceding siblings ...)
2025-07-25 21:11 ` [PATCH 0/3] single-binary: compile once migration files Fabiano Rosas
@ 2025-07-28 20:04 ` Peter Xu
4 siblings, 0 replies; 9+ messages in thread
From: Peter Xu @ 2025-07-28 20:04 UTC (permalink / raw)
To: Pierrick Bouvier; +Cc: qemu-devel, Philippe Mathieu-Daudé, Fabiano Rosas
On Fri, Jul 25, 2025 at 01:17:26PM -0700, Pierrick Bouvier wrote:
> This series removes target dependencies in migration code.
>
> Pierrick Bouvier (3):
> migration: compile migration/ram.c once
> migration: rename target.c to vfio.c
> migration/vfio: compile only once
>
> migration/vfio-stub.c | 16 ++++++++++++++++
> migration/{target.c => vfio.c} | 16 +---------------
> migration/meson.build | 8 ++++----
> 3 files changed, 21 insertions(+), 19 deletions(-)
> create mode 100644 migration/vfio-stub.c
> rename migration/{target.c => vfio.c} (67%)
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
^ permalink raw reply [flat|nested] 9+ messages in thread