diff mbox

vl: trivial: use error_report for max-cpu error

Message ID 1445868373-8113-1-git-send-email-drjones@redhat.com
State New
Headers show

Commit Message

Andrew Jones Oct. 26, 2015, 2:06 p.m. UTC
Signed-off-by: Andrew Jones <drjones@redhat.com>
---

There are plenty of fprintf's left in vl.c, but here's another baby
step...

 vl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Eric Blake Oct. 26, 2015, 5 p.m. UTC | #1
On 10/26/2015 08:06 AM, Andrew Jones wrote:
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
> 
> There are plenty of fprintf's left in vl.c, but here's another baby
> step...
> 
>  vl.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
Eduardo Habkost Oct. 26, 2015, 5:15 p.m. UTC | #2
On Mon, Oct 26, 2015 at 11:00:02AM -0600, Eric Blake wrote:
> On 10/26/2015 08:06 AM, Andrew Jones wrote:
> > Signed-off-by: Andrew Jones <drjones@redhat.com>
> > ---
> > 
> > There are plenty of fprintf's left in vl.c, but here's another baby
> > step...
> > 
> >  vl.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>

I just sent a patch changing all fprintf(stderr) calls in vl.c. If this
patch is appropriate post-soft-freeze (I am not sure it is), we could
simply change all fprintf() calls in vl.c in a single step.
diff mbox

Patch

diff --git a/vl.c b/vl.c
index 9a64b75ebbd24..549c6675fe8df 100644
--- a/vl.c
+++ b/vl.c
@@ -4080,9 +4080,9 @@  int main(int argc, char **argv, char **envp)
 
     machine_class->max_cpus = machine_class->max_cpus ?: 1; /* Default to UP */
     if (max_cpus > machine_class->max_cpus) {
-        fprintf(stderr, "Number of SMP CPUs requested (%d) exceeds max CPUs "
-                "supported by machine '%s' (%d)\n", max_cpus,
-                machine_class->name, machine_class->max_cpus);
+        error_report("Number of SMP CPUs requested (%d) exceeds max CPUs "
+                     "supported by machine '%s' (%d)", max_cpus,
+                     machine_class->name, machine_class->max_cpus);
         exit(1);
     }