Skip to content

Commit a2de8b5

Browse files
Upgrade virt-top version to 1.1.1. (microsoft#13001)
1 parent 3683af9 commit a2de8b5

10 files changed

+252
-268
lines changed

SPECS-EXTENDED/virt-top/0001-libvirt-Handle-VIR_DOMAIN_PMSUSPENDED-state.patch

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
From 4b15ee2440b0e70e3c1eb5e164ded493e2d8f0c8 Mon Sep 17 00:00:00 2001
2+
From: Yuya Higashi <[email protected]>
3+
Date: Tue, 15 Nov 2022 13:56:21 +0900
4+
Subject: [PATCH 1/3] virt-top: fix to explicitly disconnect from libvirtd
5+
6+
To prevent libvirtd from printing virNetSocketReadWire I/O errors when
7+
the virt-top command exits, explicitly disconnect from libvirtd.
8+
9+
Signed-off-by: Yuya Higashi <[email protected]>
10+
---
11+
src/top.ml | 5 +++--
12+
1 file changed, 3 insertions(+), 2 deletions(-)
13+
14+
diff --git a/src/top.ml b/src/top.ml
15+
index 75fbcb9..cbe655a 100644
16+
--- a/src/top.ml
17+
+++ b/src/top.ml
18+
@@ -306,7 +306,7 @@ let get_string maxlen =
19+
)
20+
21+
(* Main loop. *)
22+
-let rec main_loop ((_, batch_mode, script_mode, csv_enabled, stream_mode, _, _, _)
23+
+let rec main_loop ((conn, batch_mode, script_mode, csv_enabled, stream_mode, _, _, _)
24+
as setup) =
25+
let csv_flags = !csv_cpu, !csv_mem, !csv_block, !csv_net in
26+
27+
@@ -372,7 +372,8 @@ let rec main_loop ((_, batch_mode, script_mode, csv_enabled, stream_mode, _, _,
28+
if not !quit || !end_time <> None then
29+
millisleep delay
30+
)
31+
- done
32+
+ done;
33+
+ C.close conn
34+
35+
and get_key_press setup delay =
36+
(* Read the next key, waiting up to 'delay' milliseconds. *)
37+
--
38+
2.42.0
39+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From 1d04fdfce6edea685596fbb18920799c70f1d7fa Mon Sep 17 00:00:00 2001
2+
From: Yuya Higashi <[email protected]>
3+
Date: Mon, 26 Dec 2022 09:18:15 +0900
4+
Subject: [PATCH 2/3] virt-top: fix to parse init-file correctly
5+
6+
This fixes the following runtime error when parsing init-file.
7+
8+
$ virt-top --init-file <(echo "sort id")
9+
Error: Invalid_argument("String.sub / Bytes.sub")
10+
Raised at Stdlib.invalid_arg in file "stdlib.ml", line 30, characters 20-45
11+
Called from Stdlib__String.sub in file "string.ml" (inlined), line 50, characters 2-23
12+
Called from Utils.split in file "utils.ml", line 82, characters 24-68
13+
Called from Utils.read_config_file.(fun) in file "utils.ml", line 114, characters 23-37
14+
Called from Stdlib__List.map in file "list.ml", line 92, characters 20-23
15+
Called from Top.start_up.try_to_read_init_file in file "top.ml", line 153, characters 17-42
16+
Called from Main.script_mode in file "main.ml", line 37, characters 6-17
17+
18+
Signed-off-by: Yuya Higashi <[email protected]>
19+
---
20+
src/utils.ml | 2 +-
21+
1 file changed, 1 insertion(+), 1 deletion(-)
22+
23+
diff --git a/src/utils.ml b/src/utils.ml
24+
index 1f00803..8dfb255 100644
25+
--- a/src/utils.ml
26+
+++ b/src/utils.ml
27+
@@ -79,7 +79,7 @@ let trim ?(test = isspace) str =
28+
let split str sep =
29+
try
30+
let i = String.index str sep in
31+
- String.sub str 0 i, String.sub str (i+1) (String.length str - 1)
32+
+ String.sub str 0 i, String.sub str (i+1) (String.length str - i - 1)
33+
with
34+
Not_found -> str, ""
35+
36+
--
37+
2.42.0
38+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From dd205eeae9fb06ac113884e4c9e9f3a90eef7554 Mon Sep 17 00:00:00 2001
2+
From: "Richard W.M. Jones" <[email protected]>
3+
Date: Mon, 27 Nov 2023 14:09:04 +0000
4+
Subject: [PATCH 3/3] src: Include <libxml/parser.h>
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
libxml2 2.12.1 failed with this error:
10+
11+
xml-c.c:92:9: warning: implicit declaration of function ‘xmlReadMemory’; did you mean ‘xmlInitMemory’? [-Wimplicit-function-declaration]
12+
92 | doc = xmlReadMemory (String_val (xmlv), caml_string_length (xmlv),
13+
| ^~~~~~~~~~~~~
14+
| xmlInitMemory
15+
---
16+
src/xml-c.c | 1 +
17+
1 file changed, 1 insertion(+)
18+
19+
diff --git a/src/xml-c.c b/src/xml-c.c
20+
index 72042bf..6c546b9 100644
21+
--- a/src/xml-c.c
22+
+++ b/src/xml-c.c
23+
@@ -28,6 +28,7 @@
24+
#include <caml/memory.h>
25+
#include <caml/mlvalues.h>
26+
27+
+#include <libxml/parser.h>
28+
#include <libxml/xpath.h>
29+
#include <libxml/xpathInternals.h>
30+
31+
--
32+
2.42.0
33+

SPECS-EXTENDED/virt-top/processcsv.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

SPECS-EXTENDED/virt-top/processcsv.py.pod

Lines changed: 0 additions & 64 deletions
This file was deleted.

SPECS-EXTENDED/virt-top/virt-top-1.0.4-processcsv-documentation.patch

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"Signatures": {
3-
"processcsv.py": "2176eb136d0c9fa60369a563767d69c1de5e4e22f72465fb42f8279d375dd34e",
4-
"processcsv.py.pod": "d8c6be480cfb20cab5f0c4e8390b0093cc8e08aec5a8328260aa7728a5914dd0",
5-
"virt-top-1.0.9.tar.gz": "d615e63821cbf0bd5e4cdc1c315450dcd32cf188ee36a30fd52e85df3b7cb491"
3+
"virt-top-1.1.1.tar.gz": "6cdd98d2334f4061f8dac5d157178102f9dd8a929fadf87e85d773235044042a"
64
}
7-
}
5+
}

0 commit comments

Comments
 (0)