[PATCH 00/10] Unify argument name of migration APIs

Some of our APIs have 'bandwidth' argument but then, at internal impl level it's renamed to 'resource', inconsistently. Since it's really describing bandwidth that the migration can use, let's rename it. Michal Prívozník (10): src: Unify argument name of virDomainMigratePrepare() src: Unify argument name of virDomainMigratePerform() src: Unify argument name of virDomainMigratePrepare2() src: Unify argument name of virDomainMigratePrepareTunnel() src: Unify argument name of virDomainMigratePrepare3() src: Unify argument name of virDomainMigratePrepareTunnel3() src: Unify argument name of virDomainMigrateBegin3() src: Unify argument name of virDomainMigratePerform3() qemu: Finish argument rename gendispatch: Finish rename of the migration argument src/driver-hypervisor.h | 16 +++---- src/esx/esx_driver.c | 2 +- src/libvirt_internal.h | 16 +++---- src/qemu/qemu_driver.c | 18 ++++---- src/qemu/qemu_migration.c | 72 ++++++++++++++--------------- src/remote/remote_daemon_dispatch.c | 10 ++-- src/remote/remote_driver.c | 24 +++++----- src/remote/remote_protocol.x | 16 +++---- src/remote_protocol-structs | 16 +++---- src/rpc/gendispatch.pl | 36 +++++++-------- 10 files changed, 113 insertions(+), 113 deletions(-) -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> The virDomainMigratePrepare() API declares its last argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/esx/esx_driver.c | 2 +- src/libvirt_internal.h | 2 +- src/remote/remote_daemon_dispatch.c | 2 +- src/remote/remote_driver.c | 4 ++-- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 8e080620bb..fa2c08391f 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -584,7 +584,7 @@ typedef int char **uri_out, unsigned long flags, const char *dname, - unsigned long resource); + unsigned long bandwidth); typedef int (*virDrvDomainMigratePerform)(virDomainPtr domain, diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 512ca6c028..34c0e28d31 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -3614,7 +3614,7 @@ esxDomainMigratePrepare(virConnectPtr dconn, char **uri_out, unsigned long flags, const char *dname G_GNUC_UNUSED, - unsigned long resource G_GNUC_UNUSED) + unsigned long bandwidth G_GNUC_UNUSED) { esxPrivate *priv = dconn->privateData; diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index 1ae3e2b2e0..c532218226 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -146,7 +146,7 @@ int virDomainMigratePrepare (virConnectPtr dconn, char **uri_out, unsigned long flags, const char *dname, - unsigned long resource); + unsigned long bandwidth); int virDomainMigratePerform (virDomainPtr domain, const char *cookie, int cookielen, diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index 5dfed7ceef..229bd677bb 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -3075,7 +3075,7 @@ remoteDispatchDomainMigratePrepare(virNetServer *server G_GNUC_UNUSED, if (virDomainMigratePrepare(conn, &cookie, &cookielen, uri_in, uri_out, - args->flags, dname, args->resource) < 0) + args->flags, dname, args->bandwidth) < 0) goto cleanup; /* remoteDispatchClientRequest will free cookie, uri_out and diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 2690c05267..1609c6b391 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -2333,7 +2333,7 @@ remoteDomainMigratePrepare(virConnectPtr dconn, char **cookie, int *cookielen, const char *uri_in, char **uri_out, unsigned long flags, const char *dname, - unsigned long resource) + unsigned long bandwidth) { remote_domain_migrate_prepare_args args = {0}; g_auto(remote_domain_migrate_prepare_ret) ret = {0}; @@ -2343,7 +2343,7 @@ remoteDomainMigratePrepare(virConnectPtr dconn, args.uri_in = uri_in == NULL ? NULL : (char **) &uri_in; args.flags = flags; args.dname = dname == NULL ? NULL : (char **) &dname; - args.resource = resource; + args.bandwidth = bandwidth; if (call(dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE, (xdrproc_t) xdr_remote_domain_migrate_prepare_args, (char *) &args, diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 57cd5796af..2dc0a6fea6 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -1055,7 +1055,7 @@ struct remote_domain_migrate_prepare_args { remote_string uri_in; unsigned hyper flags; remote_string dname; - unsigned hyper resource; + unsigned hyper bandwidth; }; struct remote_domain_migrate_prepare_ret { diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index dd612b4dc6..50fcdaa134 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -628,7 +628,7 @@ struct remote_domain_migrate_prepare_args { remote_string uri_in; uint64_t flags; remote_string dname; - uint64_t resource; + uint64_t bandwidth; }; struct remote_domain_migrate_prepare_ret { struct { diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index f9fae39fb1..2b7fd657cb 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -405,7 +405,7 @@ my $long_legacy = { DomainMigratePeer2Peer => { arg => { flags => 1, resource => 1 } }, DomainMigratePerform => { arg => { flags => 1, resource => 1 } }, DomainMigratePerform3 => { arg => { flags => 1, resource => 1 } }, - DomainMigratePrepare => { arg => { flags => 1, resource => 1 } }, + DomainMigratePrepare => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare2 => { arg => { flags => 1, resource => 1 } }, DomainMigratePrepare3 => { arg => { flags => 1, resource => 1 } }, DomainMigratePrepareTunnel => { arg => { flags => 1, resource => 1 } }, -- 2.49.0

On a Thursday in 2025, Michal Privoznik via Devel wrote:
From: Michal Privoznik <mprivozn@redhat.com>
The virDomainMigratePrepare() API declares its last argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name.
Did you just noun confusing? The prescriptivist in me is screaming, but the other part of me feels it's too funny to fix.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/esx/esx_driver.c | 2 +- src/libvirt_internal.h | 2 +- src/remote/remote_daemon_dispatch.c | 2 +- src/remote/remote_driver.c | 4 ++-- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

From: Michal Privoznik <mprivozn@redhat.com> The virDomainMigratePerform() API declares its last argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/libvirt_internal.h | 2 +- src/qemu/qemu_driver.c | 4 ++-- src/qemu/qemu_migration.c | 12 ++++++------ src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index fa2c08391f..65c20cbb74 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -593,7 +593,7 @@ typedef int const char *uri, unsigned long flags, const char *dname, - unsigned long resource); + unsigned long bandwidth); typedef virDomainPtr (*virDrvDomainMigrateFinish)(virConnectPtr dconn, diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index c532218226..aead4dbfb6 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -153,7 +153,7 @@ int virDomainMigratePerform (virDomainPtr domain, const char *uri, unsigned long flags, const char *dname, - unsigned long resource); + unsigned long bandwidth); virDomainPtr virDomainMigrateFinish (virConnectPtr dconn, const char *dname, const char *cookie, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b3b0ee66f8..a531bdc581 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10863,7 +10863,7 @@ qemuDomainMigratePerform(virDomainPtr dom, const char *uri, unsigned long flags, const char *dname, - unsigned long resource) + unsigned long bandwidth) { virQEMUDriver *driver = dom->conn->privateData; virDomainObj *vm = NULL; @@ -10904,7 +10904,7 @@ qemuDomainMigratePerform(virDomainPtr dom, NULL, migParams, cookie, cookielen, NULL, NULL, /* No output cookies in v2 */ - flags, dname, resource, false); + flags, dname, bandwidth, false); cleanup: virDomainObjEndAPI(&vm); diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 2400750ee4..38ffcdf428 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -6447,7 +6447,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver, int *cookieoutlen, unsigned int flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, bool v3proto) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -6457,12 +6457,12 @@ qemuMigrationSrcPerform(virQEMUDriver *driver, "migrate_disks=%p, nbdPort=%d, " "nbdURI=%s, " "cookiein=%s, cookieinlen=%d, cookieout=%p, cookieoutlen=%p, " - "flags=0x%x, dname=%s, resource=%lu, v3proto=%d", + "flags=0x%x, dname=%s, bandwidth=%lu, v3proto=%d", driver, conn, vm, NULLSTR(xmlin), NULLSTR(dconnuri), NULLSTR(uri), NULLSTR(graphicsuri), NULLSTR(listenAddress), migrate_disks, nbdPort, NULLSTR(nbdURI), NULLSTR(cookiein), cookieinlen, cookieout, cookieoutlen, - flags, NULLSTR(dname), resource, v3proto); + flags, NULLSTR(dname), bandwidth, v3proto); if (cfg->migrateTLSForce && !(flags & VIR_MIGRATE_TUNNELLED) && @@ -6485,7 +6485,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver, nbdURI, migParams, cookiein, cookieinlen, cookieout, cookieoutlen, - flags, dname, resource, v3proto); + flags, dname, bandwidth, v3proto); } if (dconnuri) { @@ -6501,7 +6501,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver, migParams, cookiein, cookieinlen, cookieout, cookieoutlen, - flags, resource, nbdURI); + flags, bandwidth, nbdURI); } return qemuMigrationSrcPerformJob(driver, conn, vm, xmlin, persist_xml, NULL, @@ -6510,7 +6510,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver, nbdURI, migParams, cookiein, cookieinlen, cookieout, cookieoutlen, flags, - dname, resource, v3proto); + dname, bandwidth, v3proto); } static int diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 2dc0a6fea6..9210c0dc1c 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -1069,7 +1069,7 @@ struct remote_domain_migrate_perform_args { remote_nonnull_string uri; unsigned hyper flags; remote_string dname; - unsigned hyper resource; + unsigned hyper bandwidth; }; struct remote_domain_migrate_finish_args { diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 50fcdaa134..5c30e9d107 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -646,7 +646,7 @@ struct remote_domain_migrate_perform_args { remote_nonnull_string uri; uint64_t flags; remote_string dname; - uint64_t resource; + uint64_t bandwidth; }; struct remote_domain_migrate_finish_args { remote_nonnull_string dname; diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index 2b7fd657cb..fc8e7e8891 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -403,7 +403,7 @@ my $long_legacy = { DomainMigrateFinish2 => { arg => { flags => 1 } }, DomainMigrateFinish3 => { arg => { flags => 1 } }, DomainMigratePeer2Peer => { arg => { flags => 1, resource => 1 } }, - DomainMigratePerform => { arg => { flags => 1, resource => 1 } }, + DomainMigratePerform => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePerform3 => { arg => { flags => 1, resource => 1 } }, DomainMigratePrepare => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare2 => { arg => { flags => 1, resource => 1 } }, -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> The virDomainMigratePrepare2() API declares one of its argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/libvirt_internal.h | 2 +- src/qemu/qemu_driver.c | 2 +- src/remote/remote_daemon_dispatch.c | 2 +- src/remote/remote_driver.c | 4 ++-- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 65c20cbb74..cd0b32c455 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -644,7 +644,7 @@ typedef int char **uri_out, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml); typedef virDomainPtr diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index aead4dbfb6..626d794a8c 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -167,7 +167,7 @@ int virDomainMigratePrepare2 (virConnectPtr dconn, char **uri_out, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml); virDomainPtr virDomainMigrateFinish2 (virConnectPtr dconn, const char *dname, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a531bdc581..f5657dbd0e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10807,7 +10807,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn, char **uri_out, unsigned long flags, const char *dname, - unsigned long resource G_GNUC_UNUSED, + unsigned long bandwidth G_GNUC_UNUSED, const char *dom_xml) { virQEMUDriver *driver = dconn->privateData; diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index 229bd677bb..7ebaca6cf1 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -3125,7 +3125,7 @@ remoteDispatchDomainMigratePrepare2(virNetServer *server G_GNUC_UNUSED, if (virDomainMigratePrepare2(conn, &cookie, &cookielen, uri_in, uri_out, - args->flags, dname, args->resource, + args->flags, dname, args->bandwidth, args->dom_xml) < 0) goto cleanup; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 1609c6b391..1d1b88df29 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -2367,7 +2367,7 @@ remoteDomainMigratePrepare2(virConnectPtr dconn, char **cookie, int *cookielen, const char *uri_in, char **uri_out, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml) { remote_domain_migrate_prepare2_args args = {0}; @@ -2378,7 +2378,7 @@ remoteDomainMigratePrepare2(virConnectPtr dconn, args.uri_in = uri_in == NULL ? NULL : (char **) &uri_in; args.flags = flags; args.dname = dname == NULL ? NULL : (char **) &dname; - args.resource = resource; + args.bandwidth = bandwidth; args.dom_xml = (char *) dom_xml; if (call(dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2, diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 9210c0dc1c..ad29ecbd06 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -1087,7 +1087,7 @@ struct remote_domain_migrate_prepare2_args { remote_string uri_in; unsigned hyper flags; remote_string dname; - unsigned hyper resource; + unsigned hyper bandwidth; remote_nonnull_string dom_xml; }; diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 5c30e9d107..ced8120bab 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -664,7 +664,7 @@ struct remote_domain_migrate_prepare2_args { remote_string uri_in; uint64_t flags; remote_string dname; - uint64_t resource; + uint64_t bandwidth; remote_nonnull_string dom_xml; }; struct remote_domain_migrate_prepare2_ret { diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index fc8e7e8891..e867dda9c9 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -406,7 +406,7 @@ my $long_legacy = { DomainMigratePerform => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePerform3 => { arg => { flags => 1, resource => 1 } }, DomainMigratePrepare => { arg => { flags => 1, bandwidth => 1 } }, - DomainMigratePrepare2 => { arg => { flags => 1, resource => 1 } }, + DomainMigratePrepare2 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare3 => { arg => { flags => 1, resource => 1 } }, DomainMigratePrepareTunnel => { arg => { flags => 1, resource => 1 } }, DomainMigratePrepareTunnel3 => { arg => { flags => 1, resource => 1 } }, -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> The virDomainMigratePrepareTunnel() API declares one of its argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/libvirt_internal.h | 2 +- src/qemu/qemu_driver.c | 2 +- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index cd0b32c455..975a6b9700 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -675,7 +675,7 @@ typedef int virStreamPtr st, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml); typedef int diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index 626d794a8c..51510c34b3 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -180,7 +180,7 @@ int virDomainMigratePrepareTunnel(virConnectPtr dconn, virStreamPtr st, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f5657dbd0e..c6ace58491 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10757,7 +10757,7 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn, virStreamPtr st, unsigned long flags, const char *dname, - unsigned long resource G_GNUC_UNUSED, + unsigned long bandwidth G_GNUC_UNUSED, const char *dom_xml) { virQEMUDriver *driver = dconn->privateData; diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index ad29ecbd06..9457bb603d 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -2373,7 +2373,7 @@ struct remote_secret_lookup_by_usage_ret { struct remote_domain_migrate_prepare_tunnel_args { unsigned hyper flags; remote_string dname; - unsigned hyper resource; + unsigned hyper bandwidth; remote_nonnull_string dom_xml; }; diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index ced8120bab..6cf7b8e9e3 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -1786,7 +1786,7 @@ struct remote_secret_lookup_by_usage_ret { struct remote_domain_migrate_prepare_tunnel_args { uint64_t flags; remote_string dname; - uint64_t resource; + uint64_t bandwidth; remote_nonnull_string dom_xml; }; struct remote_connect_is_secure_ret { diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index e867dda9c9..0cc4d3fe42 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -408,7 +408,7 @@ my $long_legacy = { DomainMigratePrepare => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare2 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare3 => { arg => { flags => 1, resource => 1 } }, - DomainMigratePrepareTunnel => { arg => { flags => 1, resource => 1 } }, + DomainMigratePrepareTunnel => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepareTunnel3 => { arg => { flags => 1, resource => 1 } }, DomainMigrateToURI => { arg => { flags => 1, resource => 1 } }, DomainMigrateToURI2 => { arg => { flags => 1, resource => 1 } }, -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> The virDomainMigratePrepare3() API declares one of its argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/libvirt_internal.h | 2 +- src/qemu/qemu_driver.c | 2 +- src/remote/remote_daemon_dispatch.c | 2 +- src/remote/remote_driver.c | 4 ++-- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 975a6b9700..8302f0b42e 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -993,7 +993,7 @@ typedef int char **uri_out, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml); typedef int diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index 51510c34b3..62ba807ec5 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -201,7 +201,7 @@ int virDomainMigratePrepare3(virConnectPtr dconn, char **uri_out, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml); int virDomainMigratePrepareTunnel3(virConnectPtr dconn, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c6ace58491..dda0a32681 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11037,7 +11037,7 @@ qemuDomainMigratePrepare3(virConnectPtr dconn, char **uri_out, unsigned long flags, const char *dname, - unsigned long resource G_GNUC_UNUSED, + unsigned long bandwidth G_GNUC_UNUSED, const char *dom_xml) { virQEMUDriver *driver = dconn->privateData; diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index 7ebaca6cf1..12ad1ce548 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -4855,7 +4855,7 @@ remoteDispatchDomainMigratePrepare3(virNetServer *server G_GNUC_UNUSED, args->cookie_in.cookie_in_len, &cookieout, &cookieoutlen, uri_in, uri_out, - args->flags, dname, args->resource, + args->flags, dname, args->bandwidth, args->dom_xml) < 0) goto cleanup; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 1d1b88df29..42f98f132f 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -5691,7 +5691,7 @@ remoteDomainMigratePrepare3(virConnectPtr dconn, char **uri_out, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml) { remote_domain_migrate_prepare3_args args = {0}; @@ -5704,7 +5704,7 @@ remoteDomainMigratePrepare3(virConnectPtr dconn, args.uri_in = uri_in == NULL ? NULL : (char **) &uri_in; args.flags = flags; args.dname = dname == NULL ? NULL : (char **) &dname; - args.resource = resource; + args.bandwidth = bandwidth; args.dom_xml = (char *) dom_xml; if (call(dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE3, diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 9457bb603d..a56b4cdeb9 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -2960,7 +2960,7 @@ struct remote_domain_migrate_prepare3_args { remote_string uri_in; unsigned hyper flags; remote_string dname; - unsigned hyper resource; + unsigned hyper bandwidth; remote_nonnull_string dom_xml; }; diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 6cf7b8e9e3..e3d16ea061 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -2279,7 +2279,7 @@ struct remote_domain_migrate_prepare3_args { remote_string uri_in; uint64_t flags; remote_string dname; - uint64_t resource; + uint64_t bandwidth; remote_nonnull_string dom_xml; }; struct remote_domain_migrate_prepare3_ret { diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index 0cc4d3fe42..4c699337b1 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -407,7 +407,7 @@ my $long_legacy = { DomainMigratePerform3 => { arg => { flags => 1, resource => 1 } }, DomainMigratePrepare => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare2 => { arg => { flags => 1, bandwidth => 1 } }, - DomainMigratePrepare3 => { arg => { flags => 1, resource => 1 } }, + DomainMigratePrepare3 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepareTunnel => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepareTunnel3 => { arg => { flags => 1, resource => 1 } }, DomainMigrateToURI => { arg => { flags => 1, resource => 1 } }, -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> The virDomainMigratePrepareTunnel3() API declares one of its argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/libvirt_internal.h | 2 +- src/qemu/qemu_driver.c | 2 +- src/remote/remote_driver.c | 4 ++-- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 8302f0b42e..c0099198bb 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -1005,7 +1005,7 @@ typedef int int *cookieoutlen, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml); diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index 62ba807ec5..293a11be4e 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -212,7 +212,7 @@ int virDomainMigratePrepareTunnel3(virConnectPtr dconn, int *cookieoutlen, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dda0a32681..6b8f60cc23 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11188,7 +11188,7 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn, int *cookieoutlen, unsigned long flags, const char *dname, - unsigned long resource G_GNUC_UNUSED, + unsigned long bandwidth G_GNUC_UNUSED, const char *dom_xml) { virQEMUDriver *driver = dconn->privateData; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 42f98f132f..815be8548d 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -5744,7 +5744,7 @@ remoteDomainMigratePrepareTunnel3(virConnectPtr dconn, int *cookieoutlen, unsigned long flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, const char *dom_xml) { struct private_data *priv = dconn->privateData; @@ -5769,7 +5769,7 @@ remoteDomainMigratePrepareTunnel3(virConnectPtr dconn, args.cookie_in.cookie_in_len = cookieinlen; args.flags = flags; args.dname = dname == NULL ? NULL : (char **) &dname; - args.resource = resource; + args.bandwidth = bandwidth; args.dom_xml = (char *) dom_xml; if (call(dconn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PREPARE_TUNNEL3, diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index a56b4cdeb9..f6d0ad30b6 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -2973,7 +2973,7 @@ struct remote_domain_migrate_prepare_tunnel3_args { opaque cookie_in<REMOTE_MIGRATE_COOKIE_MAX>; unsigned hyper flags; remote_string dname; - unsigned hyper resource; + unsigned hyper bandwidth; remote_nonnull_string dom_xml; }; diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index e3d16ea061..370a5e2344 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -2296,7 +2296,7 @@ struct remote_domain_migrate_prepare_tunnel3_args { } cookie_in; uint64_t flags; remote_string dname; - uint64_t resource; + uint64_t bandwidth; remote_nonnull_string dom_xml; }; struct remote_domain_migrate_prepare_tunnel3_ret { diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index 4c699337b1..abc260ea56 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -409,7 +409,7 @@ my $long_legacy = { DomainMigratePrepare2 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare3 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepareTunnel => { arg => { flags => 1, bandwidth => 1 } }, - DomainMigratePrepareTunnel3 => { arg => { flags => 1, resource => 1 } }, + DomainMigratePrepareTunnel3 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigrateToURI => { arg => { flags => 1, resource => 1 } }, DomainMigrateToURI2 => { arg => { flags => 1, resource => 1 } }, DomainMigrateVersion1 => { arg => { flags => 1, resource => 1 } }, -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> The virDomainMigrateBegin3() API declares its last argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/libvirt_internal.h | 2 +- src/qemu/qemu_driver.c | 2 +- src/remote/remote_daemon_dispatch.c | 2 +- src/remote/remote_driver.c | 4 ++-- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index c0099198bb..3f367806ee 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -981,7 +981,7 @@ typedef char * int *cookieoutlen, unsigned long flags, const char *dname, - unsigned long resource); + unsigned long bandwidth); typedef int (*virDrvDomainMigratePrepare3)(virConnectPtr dconn, diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index 293a11be4e..df99fe260c 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -190,7 +190,7 @@ char *virDomainMigrateBegin3(virDomainPtr domain, int *cookieoutlen, unsigned long flags, const char *dname, - unsigned long resource); + unsigned long bandwidth); int virDomainMigratePrepare3(virConnectPtr dconn, const char *cookiein, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6b8f60cc23..a89b78d5d8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10961,7 +10961,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain, int *cookieoutlen, unsigned long flags, const char *dname, - unsigned long resource G_GNUC_UNUSED) + unsigned long bandwidth G_GNUC_UNUSED) { virDomainObj *vm; diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index 12ad1ce548..2abfe7bf3b 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -4805,7 +4805,7 @@ remoteDispatchDomainMigrateBegin3(virNetServer *server G_GNUC_UNUSED, if (!(xml = virDomainMigrateBegin3(dom, xmlin, &cookieout, &cookieoutlen, - args->flags, dname, args->resource))) + args->flags, dname, args->bandwidth))) goto cleanup; /* remoteDispatchClientRequest will free cookie and diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 815be8548d..8fd387fc1c 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -5648,7 +5648,7 @@ remoteDomainMigrateBegin3(virDomainPtr domain, int *cookieoutlen, unsigned long flags, const char *dname, - unsigned long resource) + unsigned long bandwidth) { remote_domain_migrate_begin3_args args = {0}; g_auto(remote_domain_migrate_begin3_ret) ret = {0}; @@ -5659,7 +5659,7 @@ remoteDomainMigrateBegin3(virDomainPtr domain, args.xmlin = xmlin == NULL ? NULL : (char **) &xmlin; args.flags = flags; args.dname = dname == NULL ? NULL : (char **) &dname; - args.resource = resource; + args.bandwidth = bandwidth; if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_BEGIN3, (xdrproc_t) xdr_remote_domain_migrate_begin3_args, (char *) &args, diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index f6d0ad30b6..21aaf615ba 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -2947,7 +2947,7 @@ struct remote_domain_migrate_begin3_args { remote_string xmlin; unsigned hyper flags; remote_string dname; - unsigned hyper resource; + unsigned hyper bandwidth; }; struct remote_domain_migrate_begin3_ret { diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 370a5e2344..63a51e3362 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -2262,7 +2262,7 @@ struct remote_domain_migrate_begin3_args { remote_string xmlin; uint64_t flags; remote_string dname; - uint64_t resource; + uint64_t bandwidth; }; struct remote_domain_migrate_begin3_ret { struct { diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index abc260ea56..1a7d09056e 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -396,7 +396,7 @@ my $long_legacy = { DomainGetInfo => { ret => { maxMem => 1, memory => 1 } }, DomainMigrate => { arg => { flags => 1, resource => 1 } }, DomainMigrate2 => { arg => { flags => 1, resource => 1 } }, - DomainMigrateBegin3 => { arg => { flags => 1, resource => 1 } }, + DomainMigrateBegin3 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigrateConfirm3 => { arg => { flags => 1, resource => 1 } }, DomainMigrateDirect => { arg => { flags => 1, resource => 1 } }, DomainMigrateFinish => { arg => { flags => 1 } }, -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> The virDomainMigratePerform3() API declares its last argument as 'bandwidth', though throughout various typedefs, RPC and callback implementations the name is changed to 'resource'. This creates a confusing. Unify the name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/driver-hypervisor.h | 2 +- src/libvirt_internal.h | 2 +- src/qemu/qemu_driver.c | 4 ++-- src/remote/remote_daemon_dispatch.c | 2 +- src/remote/remote_driver.c | 4 ++-- src/remote/remote_protocol.x | 2 +- src/remote_protocol-structs | 2 +- src/rpc/gendispatch.pl | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 3f367806ee..6a43688b0c 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -1020,7 +1020,7 @@ typedef int const char *uri, unsigned long flags, const char *dname, - unsigned long resource); + unsigned long bandwidth); typedef virDomainPtr (*virDrvDomainMigrateFinish3)(virConnectPtr dconn, diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h index df99fe260c..b3376e4a24 100644 --- a/src/libvirt_internal.h +++ b/src/libvirt_internal.h @@ -226,7 +226,7 @@ int virDomainMigratePerform3(virDomainPtr dom, const char *uri, /* VM Migration URI */ unsigned long flags, const char *dname, - unsigned long resource); + unsigned long bandwidth); virDomainPtr virDomainMigrateFinish3(virConnectPtr dconn, const char *dname, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a89b78d5d8..99db92008f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11284,7 +11284,7 @@ qemuDomainMigratePerform3(virDomainPtr dom, const char *uri, unsigned long flags, const char *dname, - unsigned long resource) + unsigned long bandwidth) { virQEMUDriver *driver = dom->conn->privateData; virDomainObj *vm = NULL; @@ -11308,7 +11308,7 @@ qemuDomainMigratePerform3(virDomainPtr dom, NULL, migParams, cookiein, cookieinlen, cookieout, cookieoutlen, - flags, dname, resource, true); + flags, dname, bandwidth, true); cleanup: virDomainObjEndAPI(&vm); diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index 2abfe7bf3b..7e74ff063f 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -4910,7 +4910,7 @@ remoteDispatchDomainMigratePerform3(virNetServer *server G_GNUC_UNUSED, args->cookie_in.cookie_in_len, &cookieout, &cookieoutlen, dconnuri, uri, - args->flags, dname, args->resource) < 0) + args->flags, dname, args->bandwidth) < 0) goto cleanup; /* remoteDispatchClientRequest will free cookie diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 8fd387fc1c..ec71eaed87 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -5806,7 +5806,7 @@ remoteDomainMigratePerform3(virDomainPtr dom, const char *uri, unsigned long flags, const char *dname, - unsigned long resource) + unsigned long bandwidth) { remote_domain_migrate_perform3_args args = {0}; g_auto(remote_domain_migrate_perform3_ret) ret = {0}; @@ -5822,7 +5822,7 @@ remoteDomainMigratePerform3(virDomainPtr dom, args.dname = dname == NULL ? NULL : (char **) &dname; args.uri = uri == NULL ? NULL : (char **) &uri; args.dconnuri = dconnuri == NULL ? NULL : (char **) &dconnuri; - args.resource = resource; + args.bandwidth = bandwidth; if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_MIGRATE_PERFORM3, (xdrproc_t) xdr_remote_domain_migrate_perform3_args, (char *) &args, diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 21aaf615ba..3c93203210 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -2989,7 +2989,7 @@ struct remote_domain_migrate_perform3_args { remote_string uri; unsigned hyper flags; remote_string dname; - unsigned hyper resource; + unsigned hyper bandwidth; }; struct remote_domain_migrate_perform3_ret { diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 63a51e3362..0f87d13a5a 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -2316,7 +2316,7 @@ struct remote_domain_migrate_perform3_args { remote_string uri; uint64_t flags; remote_string dname; - uint64_t resource; + uint64_t bandwidth; }; struct remote_domain_migrate_perform3_ret { struct { diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index 1a7d09056e..dd3362c831 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -404,7 +404,7 @@ my $long_legacy = { DomainMigrateFinish3 => { arg => { flags => 1 } }, DomainMigratePeer2Peer => { arg => { flags => 1, resource => 1 } }, DomainMigratePerform => { arg => { flags => 1, bandwidth => 1 } }, - DomainMigratePerform3 => { arg => { flags => 1, resource => 1 } }, + DomainMigratePerform3 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare2 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare3 => { arg => { flags => 1, bandwidth => 1 } }, -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> There are still some functions around migration code that use 'resource' instead 'bandwidth'. Rename the variable/argument inside them. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/qemu/qemu_migration.c | 60 +++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 38ffcdf428..c8974dbc5b 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4897,7 +4897,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver, char **cookieout, int *cookieoutlen, unsigned int flags, - unsigned long resource, + unsigned long bandwidth, qemuMigrationSpec *spec, virConnectPtr dconn, const char *graphicsuri, @@ -4922,15 +4922,15 @@ qemuMigrationSrcRun(virQEMUDriver *driver, g_autoptr(virDomainDef) persistDef = NULL; int rc; - if (resource > 0) - priv->migMaxBandwidth = resource; + if (bandwidth > 0) + priv->migMaxBandwidth = bandwidth; VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, " - "cookieout=%p, cookieoutlen=%p, flags=0x%x, resource=%lu, " + "cookieout=%p, cookieoutlen=%p, flags=0x%x, bandwidth=%lu, " "spec=%p (dest=%d, fwd=%d), dconn=%p, graphicsuri=%s, " "migrate_disks=%p, migrate_disks_detect_zeroes=%p", driver, vm, NULLSTR(cookiein), cookieinlen, - cookieout, cookieoutlen, flags, resource, + cookieout, cookieoutlen, flags, bandwidth, spec, spec->destType, spec->fwdType, dconn, NULLSTR(graphicsuri), migrate_disks, migrate_disks_detect_zeroes); @@ -5322,7 +5322,7 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver, char **cookieout, int *cookieoutlen, unsigned int flags, - unsigned long resource, + unsigned long bandwidth, virConnectPtr dconn, const char *graphicsuri, const char **migrate_disks, @@ -5336,10 +5336,10 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver, qemuMigrationSpec spec; VIR_DEBUG("driver=%p, vm=%p, uri=%s, cookiein=%s, cookieinlen=%d, " - "cookieout=%p, cookieoutlen=%p, flags=0x%x, resource=%lu, " + "cookieout=%p, cookieoutlen=%p, flags=0x%x, bandwidth=%lu, " "graphicsuri=%s, migrate_disks=%p, migrate_disks_detect_zeroes=%p", driver, vm, uri, NULLSTR(cookiein), cookieinlen, - cookieout, cookieoutlen, flags, resource, + cookieout, cookieoutlen, flags, bandwidth, NULLSTR(graphicsuri), migrate_disks, migrate_disks_detect_zeroes); if (!(uribits = qemuMigrationAnyParseURI(uri, NULL))) @@ -5404,7 +5404,7 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver, cookieout, cookieoutlen, &spec, dconn, flags); } else { ret = qemuMigrationSrcRun(driver, vm, persist_xml, cookiein, cookieinlen, - cookieout, cookieoutlen, flags, resource, + cookieout, cookieoutlen, flags, bandwidth, &spec, dconn, graphicsuri, migrate_disks, migrate_disks_detect_zeroes, migParams, nbdURI); @@ -5427,7 +5427,7 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver, char **cookieout, int *cookieoutlen, unsigned int flags, - unsigned long resource, + unsigned long bandwidth, virConnectPtr dconn, const char *graphicsuri, const char **migrate_disks, @@ -5438,10 +5438,10 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver, int fds[2] = { -1, -1 }; VIR_DEBUG("driver=%p, vm=%p, st=%p, cookiein=%s, cookieinlen=%d, " - "cookieout=%p, cookieoutlen=%p, flags=0x%x, resource=%lu, " + "cookieout=%p, cookieoutlen=%p, flags=0x%x, bandwidth=%lu, " "graphicsuri=%s, migrate_disks=%p", driver, vm, st, NULLSTR(cookiein), cookieinlen, - cookieout, cookieoutlen, flags, resource, + cookieout, cookieoutlen, flags, bandwidth, NULLSTR(graphicsuri), migrate_disks); spec.fwdType = MIGRATION_FWD_STREAM; @@ -5469,7 +5469,7 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver, /* Migration with NBD is not supported with _TUNNELLED, thus * 'migrate_disks_detect_zeroes' is NULL here */ ret = qemuMigrationSrcRun(driver, vm, persist_xml, cookiein, cookieinlen, - cookieout, cookieoutlen, flags, resource, &spec, + cookieout, cookieoutlen, flags, bandwidth, &spec, dconn, graphicsuri, migrate_disks, NULL, migParams, NULL); @@ -5534,7 +5534,7 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver, const char *dconnuri, unsigned int flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, qemuMigrationParams *migParams) { virDomainPtr ddomain = NULL; @@ -5548,9 +5548,9 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver, unsigned long destflags; VIR_DEBUG("driver=%p, sconn=%p, dconn=%p, vm=%p, dconnuri=%s, " - "flags=0x%x, dname=%s, resource=%lu", + "flags=0x%x, dname=%s, bandwidth=%lu", driver, sconn, dconn, vm, NULLSTR(dconnuri), - flags, NULLSTR(dname), resource); + flags, NULLSTR(dname), bandwidth); /* In version 2 of the protocol, the prepare step is slightly * different. We fetch the domain XML of the source domain @@ -5579,14 +5579,14 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver, qemuDomainObjEnterRemote(vm); ret = dconn->driver->domainMigratePrepareTunnel - (dconn, st, destflags, dname, resource, dom_xml); + (dconn, st, destflags, dname, bandwidth, dom_xml); if (qemuDomainObjExitRemote(vm, true) < 0) goto cleanup; } else { qemuDomainObjEnterRemote(vm); ret = dconn->driver->domainMigratePrepare2 (dconn, &cookie, &cookielen, NULL, &uri_out, - destflags, dname, resource, dom_xml); + destflags, dname, bandwidth, dom_xml); if (qemuDomainObjExitRemote(vm, true) < 0) goto cleanup; } @@ -5611,13 +5611,13 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver, if (flags & VIR_MIGRATE_TUNNELLED) ret = qemuMigrationSrcPerformTunnel(driver, vm, st, NULL, NULL, 0, NULL, NULL, - flags, resource, dconn, + flags, bandwidth, dconn, NULL, NULL, migParams); else ret = qemuMigrationSrcPerformNative(driver, vm, NULL, uri_out, cookie, cookielen, NULL, NULL, /* No out cookie with v2 migration */ - flags, resource, dconn, NULL, NULL, + flags, bandwidth, dconn, NULL, NULL, NULL, migParams, NULL); /* Perform failed. Make sure Finish doesn't overwrite the error */ @@ -6075,7 +6075,7 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver, qemuMigrationParams *migParams, unsigned int flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, bool *v3proto) { int ret = -1; @@ -6091,11 +6091,11 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver, VIR_DEBUG("driver=%p, sconn=%p, vm=%p, xmlin=%s, dconnuri=%s, uri=%s, " "graphicsuri=%s, listenAddress=%s, " "migrate_disks=%p, nbdPort=%d, nbdURI=%s, flags=0x%x, " - "dname=%s, resource=%lu", + "dname=%s, bandwidth=%lu", driver, sconn, vm, NULLSTR(xmlin), NULLSTR(dconnuri), NULLSTR(uri), NULLSTR(graphicsuri), NULLSTR(listenAddress), migrate_disks, nbdPort, NULLSTR(nbdURI), - flags, NULLSTR(dname), resource); + flags, NULLSTR(dname), bandwidth); if (flags & VIR_MIGRATE_TUNNELLED && uri) { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", @@ -6195,11 +6195,11 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver, ret = qemuMigrationSrcPerformPeer2Peer3(driver, sconn, dconn, dconnuri, vm, xmlin, persist_xml, dname, uri, graphicsuri, listenAddress, migrate_disks, migrate_disks_detect_zeroes, - nbdPort, nbdURI, migParams, resource, + nbdPort, nbdURI, migParams, bandwidth, !!useParams, flags); } else { ret = qemuMigrationSrcPerformPeer2Peer2(driver, sconn, dconn, vm, - dconnuri, flags, dname, resource, + dconnuri, flags, dname, bandwidth, migParams); } @@ -6241,7 +6241,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver, int *cookieoutlen, unsigned int flags, const char *dname, - unsigned long resource, + unsigned long bandwidth, bool v3proto) { virObjectEvent *event = NULL; @@ -6283,7 +6283,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver, dconnuri, uri, graphicsuri, listenAddress, migrate_disks, migrate_disks_detect_zeroes, nbdPort, nbdURI, - migParams, flags, dname, resource, + migParams, flags, dname, bandwidth, &v3proto); } else { if (qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFORM2) < 0) @@ -6291,7 +6291,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver, ret = qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri, cookiein, cookieinlen, cookieout, cookieoutlen, - flags, resource, NULL, NULL, NULL, NULL, + flags, bandwidth, NULL, NULL, NULL, NULL, migParams, nbdURI); } if (ret < 0) @@ -6365,7 +6365,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver, char **cookieout, int *cookieoutlen, unsigned int flags, - unsigned long resource, + unsigned long bandwidth, const char *nbdURI) { qemuDomainObjPrivate *priv = vm->privateData; @@ -6393,7 +6393,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver, if (qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri, cookiein, cookieinlen, cookieout, cookieoutlen, - flags, resource, NULL, graphicsuri, + flags, bandwidth, NULL, graphicsuri, migrate_disks, migrate_disks_detect_zeroes, migParams, nbdURI) < 0) goto cleanup; -- 2.49.0

From: Michal Privoznik <mprivozn@redhat.com> This patch is useless. Either APIs it don't have 'resource' nor 'bandwidth' argument to begin with, or they serve as a wrapper over different API (changed in previous commits). Nonetheless, in the name of consistency, let's just change those variable names. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/rpc/gendispatch.pl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index dd3362c831..8cb7d7eda2 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -394,15 +394,15 @@ close(PROTOCOL); # hyper to [unsigned] long long my $long_legacy = { DomainGetInfo => { ret => { maxMem => 1, memory => 1 } }, - DomainMigrate => { arg => { flags => 1, resource => 1 } }, - DomainMigrate2 => { arg => { flags => 1, resource => 1 } }, + DomainMigrate => { arg => { flags => 1, bandwidth => 1 } }, + DomainMigrate2 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigrateBegin3 => { arg => { flags => 1, bandwidth => 1 } }, - DomainMigrateConfirm3 => { arg => { flags => 1, resource => 1 } }, - DomainMigrateDirect => { arg => { flags => 1, resource => 1 } }, + DomainMigrateConfirm3 => { arg => { flags => 1, bandwidth => 1 } }, + DomainMigrateDirect => { arg => { flags => 1, bandwidth => 1 } }, DomainMigrateFinish => { arg => { flags => 1 } }, DomainMigrateFinish2 => { arg => { flags => 1 } }, DomainMigrateFinish3 => { arg => { flags => 1 } }, - DomainMigratePeer2Peer => { arg => { flags => 1, resource => 1 } }, + DomainMigratePeer2Peer => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePerform => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePerform3 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepare => { arg => { flags => 1, bandwidth => 1 } }, @@ -410,11 +410,11 @@ my $long_legacy = { DomainMigratePrepare3 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepareTunnel => { arg => { flags => 1, bandwidth => 1 } }, DomainMigratePrepareTunnel3 => { arg => { flags => 1, bandwidth => 1 } }, - DomainMigrateToURI => { arg => { flags => 1, resource => 1 } }, - DomainMigrateToURI2 => { arg => { flags => 1, resource => 1 } }, - DomainMigrateVersion1 => { arg => { flags => 1, resource => 1 } }, - DomainMigrateVersion2 => { arg => { flags => 1, resource => 1 } }, - DomainMigrateVersion3 => { arg => { flags => 1, resource => 1 } }, + DomainMigrateToURI => { arg => { flags => 1, bandwidth => 1 } }, + DomainMigrateToURI2 => { arg => { flags => 1, bandwidth => 1 } }, + DomainMigrateVersion1 => { arg => { flags => 1, bandwidth => 1 } }, + DomainMigrateVersion2 => { arg => { flags => 1, bandwidth => 1 } }, + DomainMigrateVersion3 => { arg => { flags => 1, bandwidth => 1 } }, DomainMigrateSetMaxSpeed => { arg => { bandwidth => 1 } }, DomainSetMaxMemory => { arg => { memory => 1 } }, DomainSetMemory => { arg => { memory => 1 } }, -- 2.49.0

On a Thursday in 2025, Michal Privoznik via Devel wrote:
Some of our APIs have 'bandwidth' argument but then, at internal impl level it's renamed to 'resource', inconsistently. Since it's really describing bandwidth that the migration can use, let's rename it.
Michal Prívozník (10): src: Unify argument name of virDomainMigratePrepare() src: Unify argument name of virDomainMigratePerform() src: Unify argument name of virDomainMigratePrepare2() src: Unify argument name of virDomainMigratePrepareTunnel() src: Unify argument name of virDomainMigratePrepare3() src: Unify argument name of virDomainMigratePrepareTunnel3() src: Unify argument name of virDomainMigrateBegin3() src: Unify argument name of virDomainMigratePerform3() qemu: Finish argument rename gendispatch: Finish rename of the migration argument
src/driver-hypervisor.h | 16 +++---- src/esx/esx_driver.c | 2 +- src/libvirt_internal.h | 16 +++---- src/qemu/qemu_driver.c | 18 ++++---- src/qemu/qemu_migration.c | 72 ++++++++++++++--------------- src/remote/remote_daemon_dispatch.c | 10 ++-- src/remote/remote_driver.c | 24 +++++----- src/remote/remote_protocol.x | 16 +++---- src/remote_protocol-structs | 16 +++---- src/rpc/gendispatch.pl | 36 +++++++-------- 10 files changed, 113 insertions(+), 113 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Michal Privoznik