]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Revert "qemu: Adapt to new log format"
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 2 Jan 2013 10:52:18 +0000 (11:52 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 2 Jan 2013 10:52:18 +0000 (11:52 +0100)
This reverts commit 28224c4d2a2d623b9a0a714bc0454d47de5d7a35
which shouldn't be needed at all because with current qemu
we obtain all paths from 'query-chardev' output. We ought
not parse log output at all anymore.

src/qemu/qemu_process.c

index 9ecad51489a1aa08e56c15a4c27a986b00462255..eac6553bc872d14b90c149cc269092aaeb1865a5 100644 (file)
@@ -1431,45 +1431,22 @@ cleanup:
  *
  * char device redirected to /dev/pts/3
  *
- * However, since 1.4 the line we are looking for has changed to:
- *
- * char device <alias> redirected to /some/path
- *
  * Returns -1 for error, 0 success, 1 continue reading
  */
 static int
 qemuProcessExtractTTYPath(const char *haystack,
                           size_t *offset,
-                          const char *alias,
                           char **path)
 {
-    static const char *needle[] = {"char device", "redirected to"};
-    const char *tmp, *dev;
+    static const char needle[] = "char device redirected to";
+    char *tmp, *dev;
 
     VIR_FREE(*path);
     /* First look for our magic string */
-    if (!(tmp = strstr(haystack + *offset, needle[0])))
+    if (!(tmp = strstr(haystack + *offset, needle))) {
         return 1;
-
-    tmp += strlen(needle[0]);
-    virSkipSpaces(&tmp);
-
-    /* We prepend character devices IDs with 'char' prefix,
-     * hence full device ID is 'charalias0' */
-    if (STRPREFIX(tmp, "char")) {
-        /* we are dealing with new style */
-        tmp += strlen("char");
-        if (!STRPREFIX(tmp, alias))
-            return 1;
-
-        tmp += strlen(alias);
-        virSkipSpaces(&tmp);
     }
-
-    if (!STRPREFIX(tmp, needle[1]))
-        return 1;
-
-    tmp += strlen(needle[1]);
+    tmp += sizeof(needle);
     dev = tmp;
 
     /*
@@ -1592,7 +1569,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
         virDomainChrDefPtr chr = vm->def->serials[i];
         if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
             if ((ret = qemuProcessExtractTTYPath(output, &offset,
-                                                 chr->info.alias,
                                                  &chr->source.data.file.path)) != 0)
                 return ret;
         }
@@ -1603,7 +1579,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
         virDomainChrDefPtr chr = vm->def->parallels[i];
         if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
             if ((ret = qemuProcessExtractTTYPath(output, &offset,
-                                                 chr->info.alias,
                                                  &chr->source.data.file.path)) != 0)
                 return ret;
         }
@@ -1614,7 +1589,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
         virDomainChrDefPtr chr = vm->def->channels[i];
         if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
             if ((ret = qemuProcessExtractTTYPath(output, &offset,
-                                                 chr->info.alias,
                                                  &chr->source.data.file.path)) != 0)
                 return ret;
         }
@@ -1634,7 +1608,6 @@ qemuProcessFindCharDevicePTYs(virDomainObjPtr vm,
             if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY &&
                 chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) {
                 if ((ret = qemuProcessExtractTTYPath(output, &offset,
-                                                     chr->info.alias,
                                                      &chr->source.data.file.path)) != 0)
                     return ret;
             }