Re: [PATCH v3 2/2] Use virProcessGetStat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On a Tuesday in 2021, Martin Kletzander wrote:
This eliminates one incorrect parsing implementation which relied on the
command field not having a closing bracket.  This possibility is already
tested against in the virProcessGetStat() tests.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---
src/qemu/qemu_driver.c | 34 ++++++------------------------
src/util/virprocess.c  | 48 ++++++------------------------------------
2 files changed, 13 insertions(+), 69 deletions(-)


[..]

-    tokens = g_strsplit(tmp, " ", 0);

-    if (!tokens ||
-        g_strv_length(tokens) < 20) {
+    if (virStrToLong_ull(proc_stat[21], NULL, 10, timestamp) < 0) {

VIR_PROCESS_STAT_STARTTIME

        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Cannot find start time in %s"),
-                       filename);
+                       _("Cannot parse start time %s for pid %d"),
+                       proc_stat[21], (int)pid);
        return -1;
    }

Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux