diff mbox series

[04/29] vl: remove bogus check

Message ID 20201027182144.3315885-5-pbonzini@redhat.com
State New
Headers show
Series cleanup qemu_init and make sense of command line processing | expand

Commit Message

Paolo Bonzini Oct. 27, 2020, 6:21 p.m. UTC
There is no reason to prevent -preconfig -daemonize.  Of course if
no monitor is defined there will be no way to start the VM,
but that is a user error.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 softmmu/vl.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Igor Mammedov Oct. 28, 2020, 4:48 p.m. UTC | #1
On Tue, 27 Oct 2020 14:21:19 -0400
Paolo Bonzini <pbonzini@redhat.com> wrote:

> There is no reason to prevent -preconfig -daemonize.  Of course if
> no monitor is defined there will be no way to start the VM,
> but that is a user error.

it was related to how libvirt starts QEMU but I don't recall why anymore,
CCing Daniel

> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  softmmu/vl.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 7f39ebdfee..dbb72e621e 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -4027,12 +4027,6 @@ void qemu_init(int argc, char **argv, char **envp)
>      }
>  
>      if (is_daemonized()) {
> -        if (!preconfig_exit_requested) {
> -            error_report("'preconfig' and 'daemonize' options are "
> -                         "mutually exclusive");
> -            exit(EXIT_FAILURE);
> -        }
> -
>          /* According to documentation and historically, -nographic redirects
>           * serial port, parallel port and monitor to stdio, which does not work
>           * with -daemonize.  We can redirect these to null instead, but since
Daniel P. Berrangé Oct. 28, 2020, 4:55 p.m. UTC | #2
On Wed, Oct 28, 2020 at 05:48:57PM +0100, Igor Mammedov wrote:
> On Tue, 27 Oct 2020 14:21:19 -0400
> Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
> > There is no reason to prevent -preconfig -daemonize.  Of course if
> > no monitor is defined there will be no way to start the VM,
> > but that is a user error.
> 
> it was related to how libvirt starts QEMU but I don't recall why anymore,
> CCing Daniel

Libvirt didn't request this to best of my knowledge.

We don't even use -daemonize, so have no reason to ask to forbid
-preconfig with -daemonize.

> 
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >  softmmu/vl.c | 6 ------
> >  1 file changed, 6 deletions(-)
> > 
> > diff --git a/softmmu/vl.c b/softmmu/vl.c
> > index 7f39ebdfee..dbb72e621e 100644
> > --- a/softmmu/vl.c
> > +++ b/softmmu/vl.c
> > @@ -4027,12 +4027,6 @@ void qemu_init(int argc, char **argv, char **envp)
> >      }
> >  
> >      if (is_daemonized()) {
> > -        if (!preconfig_exit_requested) {
> > -            error_report("'preconfig' and 'daemonize' options are "
> > -                         "mutually exclusive");
> > -            exit(EXIT_FAILURE);
> > -        }
> > -
> >          /* According to documentation and historically, -nographic redirects
> >           * serial port, parallel port and monitor to stdio, which does not work
> >           * with -daemonize.  We can redirect these to null instead, but since
> 

Regards,
Daniel
Igor Mammedov Oct. 28, 2020, 7:32 p.m. UTC | #3
On Tue, 27 Oct 2020 14:21:19 -0400
Paolo Bonzini <pbonzini@redhat.com> wrote:

> There is no reason to prevent -preconfig -daemonize.  Of course if
> no monitor is defined there will be no way to start the VM,
> but that is a user error.

looking some more at the current code, this piece is currently
somewhat broken, so it would indeed exit but 'after' fork
and output error message to nowhere. It happens since
os_daemonize() where moved before it later on, given no
one actually complained since then we probably do not care about it.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  softmmu/vl.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index 7f39ebdfee..dbb72e621e 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -4027,12 +4027,6 @@ void qemu_init(int argc, char **argv, char **envp)
>      }
>  
>      if (is_daemonized()) {
> -        if (!preconfig_exit_requested) {
> -            error_report("'preconfig' and 'daemonize' options are "
> -                         "mutually exclusive");
> -            exit(EXIT_FAILURE);
> -        }
> -
>          /* According to documentation and historically, -nographic redirects
>           * serial port, parallel port and monitor to stdio, which does not work
>           * with -daemonize.  We can redirect these to null instead, but since
diff mbox series

Patch

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 7f39ebdfee..dbb72e621e 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -4027,12 +4027,6 @@  void qemu_init(int argc, char **argv, char **envp)
     }
 
     if (is_daemonized()) {
-        if (!preconfig_exit_requested) {
-            error_report("'preconfig' and 'daemonize' options are "
-                         "mutually exclusive");
-            exit(EXIT_FAILURE);
-        }
-
         /* According to documentation and historically, -nographic redirects
          * serial port, parallel port and monitor to stdio, which does not work
          * with -daemonize.  We can redirect these to null instead, but since