Skip to contentSkip to conversation

target-i386: Report on error during cpu_x86_register().

PATCH Superseded Don Slutz 3 participants 5 messages Sep 1, 2012 – Sep 11, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Don Slutz

author
#0 lore raw

PATCH 1/1 target-i386: Report on error during cpu_x86_register().

Send it to stderr before free of the details.

---
 target-i386/cpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
target-i386/cpu.c +1 -0
index 57c064f..5c0fef1 100644
@@ -1352,6 +1352,7 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
     }
     object_property_set_str(OBJECT(cpu), def->model_id, "model-id", &error);
     if (error_is_set(&error)) {
+        fprintf(stderr, "%s: %s\n", __FUNCTION__, error_get_pretty(error));
         error_free(error);
         return -1;
     }
Signature · 1 line
1.7.1
#1 lore raw
Quoted 12 lines · Don Slutz

Send it to stderr before free of the details.

---
 target-i386/cpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
target-i386/cpu.c +0 -0
index 57c064f..5c0fef1 100644

target-i386/cpu.c int cpu_x86_register(X86CPU *cpu, const char *cpu_model) · line 1355

Quoted 4 lines
target-i386/cpu.c +1 -0
@@ -1352,6 +1352,7 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
     }
     object_property_set_str(OBJECT(cpu), def->model_id, "model-id", &error);
     if (error_is_set(&error)) {
+        fprintf(stderr, "%s: %s\n", __FUNCTION__, error_get_pretty(error));

__func__ is preferred by checkpatch.pl and also GCC recommends using it:
http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

Quoted 7 lines
target-i386/cpu.c +0 -1
         error_free(error);
         return -1;
     }
--

1.7.1

#2 lore raw
Quoted 9 lines · Blue Swirl
Quoted 7 lines · Don Slutz

Send it to stderr before free of the details.

---
 target-i386/cpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 23 lines

target-i386/cpu.c int cpu_x86_register(X86CPU *cpu, const char *cpu_model) · line 1356

Quoted 10 lines
target-i386/cpu.c +1 -0
index 57c064f..5c0fef1 100644
@@ -1352,6 +1352,7 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
     }
     object_property_set_str(OBJECT(cpu), def->model_id, "model-id", &error);
     if (error_is_set(&error)) {
+        fprintf(stderr, "%s: %s\n", __FUNCTION__, error_get_pretty(error));
 

__func__ is preferred by checkpatch.pl and also GCC recommends using it:
http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

Quoted 8 lines
target-i386/cpu.c +0 -0
         error_free(error);
         return -1;
     }

--
1.7.1

Somehow I forgot to run checkpatch.pl on this. V2 soon.
-Don

author
#3 lore raw

PATCH v2 1/1 target-i386: Report on error during cpu_x86_register().

In reply to Don Slutz

Send it to stderr before free of the details.

---
v2: Change __FUNCTION__ to __func__

 target-i386/cpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
target-i386/cpu.c +1 -0
index 57c064f..760cca4 100644
@@ -1352,6 +1352,7 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
     }
     object_property_set_str(OBJECT(cpu), def->model_id, "model-id", &error);
     if (error_is_set(&error)) {
+        fprintf(stderr, "%s: %s\n", __func__, error_get_pretty(error));
         error_free(error);
         return -1;
     }
Signature · 1 line
1.7.1
author
#4 lore raw
Quoted 14 lines · Don Slutz

Send it to stderr before free of the details.

---
v2: Change __FUNCTION__ to __func__

  target-i386/cpu.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
target-i386/cpu.c +0 -0
index 57c064f..760cca4 100644

target-i386/cpu.c int cpu_x86_register(X86CPU *cpu, const char *cpu_model) · line 1358

Quoted 7 lines
target-i386/cpu.c +1 -0
@@ -1352,6 +1352,7 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
      }
      object_property_set_str(OBJECT(cpu), def->model_id, "model-id", &error);
      if (error_is_set(&error)) {
+        fprintf(stderr, "%s: %s\n", __func__, error_get_pretty(error));
          error_free(error);
          return -1;
      }

The (3) patch set in http://lists.gnu.org/archive/html/qemu-devel/2012-09/msg01400.html includes this change, and so this request is being withdrawn.