]> xenbits.xensource.com Git - libvirt.git/commitdiff
Clean redundant code about VCPU string checking
authorLi Zhang <zhlcindy@linux.vnet.ibm.com>
Mon, 18 Mar 2013 09:57:14 +0000 (17:57 +0800)
committerEric Blake <eblake@redhat.com>
Wed, 20 Mar 2013 22:06:20 +0000 (16:06 -0600)
Now that VCPU number are removed from qemu_monitor_text.c
(commit cc78d7ba), VCPU string checking also should be removed.

Report-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
src/qemu/qemu_monitor_text.c

index 1b6efba95d5579d8d9880f9ad66b9ba2e41f4be2..25c82b6ef6f2960d91aaea3168c58ff85d4c4941 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * qemu_monitor_text.c: interaction with QEMU monitor console
  *
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
  * Copyright (C) 2006 Daniel P. Berrange
  *
  * This library is free software; you can redistribute it and/or
@@ -527,17 +527,10 @@ int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
      */
     line = qemucpus;
     do {
-        char *offset = strchr(line, '#');
+        char *offset = NULL;
         char *end = NULL;
         int tid = 0;
 
-        /* See if we're all done */
-        if (offset == NULL)
-            break;
-
-        if (end == NULL || *end != ':')
-            goto error;
-
         /* Extract host Thread ID */
         if ((offset = strstr(line, "thread_id=")) == NULL)
             goto error;
@@ -550,7 +543,7 @@ int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
         if (VIR_REALLOC_N(cpupids, ncpupids+1) < 0)
             goto error;
 
-        VIR_DEBUG("pid=%d", tid);
+        VIR_DEBUG("tid=%d", tid);
         cpupids[ncpupids++] = tid;
 
         /* Skip to next data line */