[PATCH 0/2] Autostart docs fixes

Peter Krempa (2): API: Clarify behaviour of autostart vs autostart once docs: man: Document '--once' for 'virsh autostart' docs/manpages/virsh.rst | 10 +++++++--- src/libvirt-domain.c | 26 ++++++++++++++++---------- 2 files changed, 23 insertions(+), 13 deletions(-) -- 2.49.0

From: Peter Krempa <pkrempa@redhat.com> If either of the autostart settings is enabled the VM will be autostarted. Attempt to clarify that. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/libvirt-domain.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index f788fa9a58..738a0e9d85 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -7322,9 +7322,8 @@ virDomainCreateWithFiles(virDomainPtr domain, unsigned int nfiles, * @domain: a domain object * @autostart: the value returned * - * Provides a boolean value indicating whether the domain - * configured to be automatically started when the host - * machine boots. + * Provides a boolean value indicating whether the domain is configured to be + * automatically started each time when the host machine boots. * * Returns -1 in case of error, 0 in case of success * @@ -7366,8 +7365,8 @@ virDomainGetAutostart(virDomainPtr domain, * @domain: a domain object * @autostart: whether the domain should be automatically started 0 or 1 * - * Configure the domain to be automatically started - * when the host machine boots. + * Configure the domain to be automatically started eacth time when the host + * machine boots. * * Returns -1 in case of error, 0 in case of success * @@ -7409,9 +7408,12 @@ virDomainSetAutostart(virDomainPtr domain, * @domain: a domain object * @autostart: the value returned * - * Provides a boolean value indicating whether the domain - * is configured to be automatically started the next time - * the host machine boots only. + * Provides a boolean value indicating whether the domain is configured to be + * automatically started next time when the host machine boots. + * + * Note that autostart configured via the virDomain[Set|Get]AutostartOnce APIs + * is independent from the autostart configured via virDomain[Set|Get]Autostart. + * Enabling either of them will cause the VM to be started on the next boot. * * Returns -1 in case of error, 0 in case of success * @@ -7453,8 +7455,12 @@ virDomainGetAutostartOnce(virDomainPtr domain, * @domain: a domain object * @autostart: whether the domain should be automatically started 0 or 1 * - * Configure the domain to be automatically started - * the next time the host machine boots only. + * Configure the domain to be automatically started eacth time when the host + * machine boots. + * + * Note that autostart configured via the virDomain[Set|Get]AutostartOnce APIs + * is independent from the autostart configured via virDomain[Set|Get]Autostart. + * Enabling either of them will cause the VM to be started on the next boot. * * Returns -1 in case of error, 0 in case of success * -- 2.49.0

On a Monday in 2025, Peter Krempa via Devel wrote:
From: Peter Krempa <pkrempa@redhat.com>
If either of the autostart settings is enabled the VM will be autostarted. Attempt to clarify that.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/libvirt-domain.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index f788fa9a58..738a0e9d85 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -7366,8 +7365,8 @@ virDomainGetAutostart(virDomainPtr domain, * @domain: a domain object * @autostart: whether the domain should be automatically started 0 or 1 * - * Configure the domain to be automatically started - * when the host machine boots. + * Configure the domain to be automatically started eacth time when the host
*each
+ * machine boots. * * Returns -1 in case of error, 0 in case of success * @@ -7409,9 +7408,12 @@ virDomainSetAutostart(virDomainPtr domain, * @domain: a domain object * @autostart: the value returned * - * Provides a boolean value indicating whether the domain - * is configured to be automatically started the next time - * the host machine boots only. + * Provides a boolean value indicating whether the domain is configured to be + * automatically started next time when the host machine boots. + * + * Note that autostart configured via the virDomain[Set|Get]AutostartOnce APIs + * is independent from the autostart configured via virDomain[Set|Get]Autostart. + * Enabling either of them will cause the VM to be started on the next boot. * * Returns -1 in case of error, 0 in case of success * @@ -7453,8 +7455,12 @@ virDomainGetAutostartOnce(virDomainPtr domain, * @domain: a domain object * @autostart: whether the domain should be automatically started 0 or 1 * - * Configure the domain to be automatically started - * the next time the host machine boots only. + * Configure the domain to be automatically started eacth time when the host + * machine boots. + *
*the next time this is the comment virDomainSetAutostartOnce, if my eyes serve me well.
+ * Note that autostart configured via the virDomain[Set|Get]AutostartOnce APIs + * is independent from the autostart configured via virDomain[Set|Get]Autostart. + * Enabling either of them will cause the VM to be started on the next boot. * * Returns -1 in case of error, 0 in case of success *
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

From: Peter Krempa <pkrempa@redhat.com> Document the '--once' option and how it combines with the setting without '--once'. Resolves: https://issues.redhat.com/browse/RHEL-89414 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/manpages/virsh.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index cef9959f16..7fa3725a59 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -1088,12 +1088,16 @@ autostart :: - autostart [--disable] domain + autostart [--disable] [--once] domain -Configure a domain to be automatically started at boot. +Configure a domain to be automatically started at each boot of the host. The +*--once* option configures the domain to be started on the next boot of the host. -The option *--disable* disables autostarting. +The option *--disable* disables the corresponding autostarting. + +Note that the domain will be automatically started when either of the settings +is enabled. blkdeviotune -- 2.49.0

On a Monday in 2025, Peter Krempa via Devel wrote:
From: Peter Krempa <pkrempa@redhat.com>
Document the '--once' option and how it combines with the setting without '--once'.
Resolves: https://issues.redhat.com/browse/RHEL-89414 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/manpages/virsh.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index cef9959f16..7fa3725a59 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -1088,12 +1088,16 @@ autostart
::
- autostart [--disable] domain + autostart [--disable] [--once] domain
-Configure a domain to be automatically started at boot. +Configure a domain to be automatically started at each boot of the host. The +*--once* option configures the domain to be started on the next boot of the host.
-The option *--disable* disables autostarting. +The option *--disable* disables the corresponding autostarting. +
+Note that the domain will be automatically started when either of the settings +is enabled.
I don't think this clarifies anything. The paragraph you added to the virDomainSetAutostartOnce API was IMO clearer, i.e.: Note that autostart configured via the --once option is independent from the autostart configured without it. Enabling either of them will cause the VM to be started on the next boot. Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Peter Krempa