[PATCH libvirt v1 3/3] Improve `virsh create --console` behavior
Michal Prívozník
mprivozn at redhat.com
Tue Oct 24 12:12:31 UTC 2023
On 9/28/23 17:37, Marc Hartmayer wrote:
> When starting a guest via libvirt (`virsh create --console`), early
> console output was missed because the guest was started first and then
> the console was attached. This patch changes this to the following
> sequence:
>
> 1. create a paused transient guest
> 2. attach the console
> 3. resume the guest
>
> Reviewed-by: Boris Fiuczynski <fiuczy at linux.ibm.com>
> Signed-off-by: Marc Hartmayer <mhartmay at linux.ibm.com>
> ---
> tools/virsh-domain.c | 34 ++++++++++++++++++++++++++++------
> 1 file changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
> index 36670039444c..2f055df0d97d 100644
> --- a/tools/virsh-domain.c
> +++ b/tools/virsh-domain.c
> @@ -8212,6 +8212,13 @@ static const vshCmdOptDef opts_create[] = {
> {.name = NULL}
> };
>
> +
> +static virshDomain *virDomainCreateXMLHelper(virConnectPtr conn, const char *xmlDesc, unsigned int nfds, int *fds, unsigned int flags) {
> + if (nfds)
> + return virDomainCreateXMLWithFiles(conn, xmlDesc, nfds, fds, flags);
> + return virDomainCreateXML(conn, xmlDesc, flags);
> +}
> +
s/virDomainCreate/virshDomainCreate/
Michal
More information about the libvir-list
mailing list