[libvirt] [PATCH 0/5] Deprecate obsolete architectures

libvirt supports way too many architectures, including a bunch which are no longer relevant these days. As a result, developers spend a lot of their time focusing on bugs and features that only affect legacy architectures such as x86 rather than on improving support for reasonable, modern architectures such as ppc64 and aarch64. This series starts deprecating obsolete architectures so we can drop support for them and retarget our efforts down the line. The initial list of deprecated architectures is fairly conservative, only including those which are clearly obsolete such as x86; on the other hand, dropping just those would already allow us to get rid of a lot of complex and probably fairly buggy code, so I think it's a good first step. I'd suggest dropping the support for architectures we're deprecating with this series completely with version 4.0.0, due on January of next year, but I could be persuaded to proceed earlier. Andrea Bolognani (5): configure: Deprecate obsolete architectures daemon: Log warning when running on a deprecated architecture virsh: Emit warning when running on a deprecated architecture qemu: Taint guests emulating a deprecated architecture news: Document architecture deprecation configure.ac | 15 +++++++++++++++ daemon/libvirtd.c | 5 +++++ docs/news.xml | 13 +++++++++++++ src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/qemu/qemu_domain.c | 3 +++ src/util/virarch.h | 3 +++ tools/virsh.c | 6 ++++++ 8 files changed, 48 insertions(+), 1 deletion(-) -- 2.7.4

The build will fail early unless the appropriate flag has been passed to configure. This will make sure users who compile libvirt from source, as well as downstream maintainers, are aware of the fact that support for these architectures will be dropped in the future. --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 08051d5..e08d85b 100644 --- a/configure.ac +++ b/configure.ac @@ -43,6 +43,21 @@ m4_ifndef([AM_SILENT_RULES], AC_CANONICAL_HOST +LIBVIRT_ARG_ENABLE([DEPRECATED_ARCHITECTURES], + [enable/disable support for deprecated architectures], [no]) +case "$host" in + *x86*) + if test "$enable_deprecated_architectures" = "yes"; then + AC_DEFINE_UNQUOTED([ENABLE_DEPRECATED_ARCHITECTURES], 1, + [whether deprecated architectures are supported]) + else + AC_MSG_ERROR([You're trying to build libvirt for a deprecated architecture. +Support for this architecture will be dropped in the future, but for the time being \ +you can still build libvirt by passing --enable-deprecated-architectures to configure]) + fi + ;; +esac + # First extract pieces from the version number string LIBVIRT_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'` LIBVIRT_MINOR_VERSION=`echo $VERSION | awk -F. '{print $2}'` -- 2.7.4

Having this in the log will make it easier for developer to downgrade the priority of bugs that only affect deprecated architectures and focus their efforts where it matters. --- daemon/libvirtd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 891238b..bf64800 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -1259,6 +1259,11 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } +#if ENABLE_DEPRECATED_ARCHITECTURES + VIR_WARN("libvirtd is running on a deprecated architecture"); + VIR_WARN("Support for this architecture will be dropped in the future"); +#endif + daemonSetupNetDevOpenvswitch(config); if (daemonSetupAccessManager(config) < 0) { -- 2.7.4

This will make even users who don't compile libvirt themselves, eg. because they're using binary packages provided by their distribution of choice, aware of the fact that support for the architecture they're running on will be dropped in the future. --- tools/virsh.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/virsh.c b/tools/virsh.c index 7eb51ab..b24686c 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -957,6 +957,12 @@ main(int argc, char **argv) ctl->connname = vshStrdup(ctl, virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")); +#if ENABLE_DEPRECATED_ARCHITECTURES + vshPrint(ctl, "%s", + _("Warning: virsh is running on a deprecated architecture\n" + " Support for this architecture will be dropped in the future\n\n")); +#endif + if (!ctl->imode) { ret = vshCommandRun(ctl, ctl->cmd); } else { -- 2.7.4

Having this in the log will make it easier for developer to downgrade the priority of bugs that only affect deprecated architectures and focus their efforts where it matters. --- src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/qemu/qemu_domain.c | 3 +++ src/util/virarch.h | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1b0a55b..b290dcd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -93,7 +93,8 @@ VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST, "host-cpu", "hook-script", "cdrom-passthrough", - "custom-dtb"); + "custom-dtb", + "deprecated-architecture"); VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST, "none", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 47eaace..f2c54fe 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2374,6 +2374,7 @@ typedef enum { VIR_DOMAIN_TAINT_HOOK, /* Domain (possibly) changed via hook script */ VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,/* CDROM passthrough */ VIR_DOMAIN_TAINT_CUSTOM_DTB, /* Custom device tree blob was specified */ + VIR_DOMAIN_TAINT_DEPRECATED_ARCH, /* Deprecated architecture */ VIR_DOMAIN_TAINT_LAST } virDomainTaintFlags; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 589eb18..0e9b8db 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4222,6 +4222,9 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver, if (obj->def->os.dtb) qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CUSTOM_DTB, logCtxt); + if (ARCH_IS_DEPRECATED(obj->def->os.arch)) + qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_DEPRECATED_ARCH, logCtxt); + virObjectUnref(cfg); } diff --git a/src/util/virarch.h b/src/util/virarch.h index af5ff83..80b3534 100644 --- a/src/util/virarch.h +++ b/src/util/virarch.h @@ -90,6 +90,9 @@ typedef enum { # define ARCH_IS_S390(arch) ((arch) == VIR_ARCH_S390 ||\ (arch) == VIR_ARCH_S390X) +# define ARCH_IS_DEPRECATED(arch) ((arch) == VIR_ARCH_X86_64 || \ + (arch) == VIR_ARCH_I686) + typedef enum { VIR_ARCH_LITTLE_ENDIAN, VIR_ARCH_BIG_ENDIAN, -- 2.7.4

--- docs/news.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 3a536c6..0c90dc8 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -165,6 +165,19 @@ debugging. </description> </change> + <change> + <summary> + Start deprecating obsolete architectures + </summary> + <description> + Architectures are only deprecated for now, which means it's still + possible to build libvirt on them by passing + <code>--enable-deprecated-architectures</code> to + <code>configure</code>, but warnings are emitted to the appropriate + channels and guests are tainted to make it clear that support will + be dropped soon. + </description> + </change> </section> <section title="Bug fixes"> <change> -- 2.7.4
participants (1)
-
Andrea Bolognani