View | Details | Raw Unified | Return to bug 260023
Collapse All | Expand All

(-)b/emulators/qemu-guest-agent/Makefile (+1 lines)
Lines 2-7 Link Here
2
2
3
PORTNAME=	qemu
3
PORTNAME=	qemu
4
DISTVERSION=	5.0.1
4
DISTVERSION=	5.0.1
5
PORTREVISION=	1
5
CATEGORIES=	emulators
6
CATEGORIES=	emulators
6
MASTER_SITES=	https://download.qemu.org/
7
MASTER_SITES=	https://download.qemu.org/
7
PKGNAMESUFFIX=	-guest-agent
8
PKGNAMESUFFIX=	-guest-agent
(-)b/emulators/qemu-guest-agent/files/patch-qga_commands-posix.c (-22 / +22 lines)
Lines 528-567 Link Here
528
+{
528
+{
529
+    FsMount *mount;
529
+    FsMount *mount;
530
+    char const *dfcmd = "/bin/df -hT";
530
+    char const *dfcmd = "/bin/df -hT";
531
+    //char buf[BUFSIZE];
532
+
531
+
533
+    FILE *fp;
532
+    FILE *fp;
534
+    char *line = NULL;
533
+    char *line = NULL;
535
+    //, *dash;
536
+    size_t n;
534
+    size_t n;
537
+    int ret;
535
+    int ret;
538
+    //, dir_s, dir_e, type_s, type_e, dev_s, dev_e;
536
+    int status;
539
+    char dev_name[30], fstype[10], size[10], used[10], free[10], load[10], mounted[30];
537
+    char dev_name[30], fstype[10], size[10], used[10], frees[10], load[10], mounted[30];
540
+    //int dev_name, fstype, size, used, free, load, mounted;
541
+
538
+
542
+    if ((fp = popen(dfcmd, "r")) == NULL) {
539
+    if ((fp = popen(dfcmd, "r")) == NULL) {
543
+    	g_debug("Cannot open '%s'!!\n", dfcmd);
540
+        g_debug("Cannot open '%s'!!\n", dfcmd);
544
+        return;
541
+        return;
545
+    }
542
+    }
546
+	while (getline(&line, &n, fp) != -1) {
543
+        while (getline(&line, &n, fp) != -1) {
547
+		//g_debug("line '%s'", line);
544
+                ret = sscanf(line, "%s%s%s%s%s%s%s",
548
+		ret = sscanf(line, "%s%s%s%s%s%s%s",
545
+                     dev_name, fstype, size, used, frees, load, mounted);
549
+                     dev_name, fstype, size, used, free, load, mounted);
546
+                if (g_str_equal(dev_name, "Filesystem")
550
+		if (g_str_equal(dev_name, "Filesystem")
547
+                                ||g_str_equal(fstype,"devfs")
551
+				||g_str_equal(fstype,"devfs")
548
+                                ||g_str_equal(fstype,"procfs")
552
+				||g_str_equal(fstype,"procfs")
549
+                                ||g_str_equal(fstype,"fdescfs")) {
553
+				||g_str_equal(fstype,"fdescfs")) {
550
+                        continue;
554
+			continue;
551
+                }
555
+		}
552
+
556
+		//g_debug("ret '%d'", ret);
553
+                if (ret < 7) {
557
+
558
+		if (ret < 7) {
559
+            continue;
554
+            continue;
560
+        }
555
+        }
561
+        mount = g_new0(FsMount, 1);
556
+        mount = g_new0(FsMount, 1);
562
+        mount->dirname = g_strdup(dev_name);
557
+        mount->dirname = g_strdup(dev_name);
563
+        mount->devtype = g_strdup(fstype);
558
+        mount->devtype = g_strdup(fstype);
564
+        mount->free = g_strdup(free);
559
+        mount->free = g_strdup(frees);
565
+        mount->load = g_strdup(load);
560
+        mount->load = g_strdup(load);
566
+        mount->size = g_strdup(size);
561
+        mount->size = g_strdup(size);
567
+        mount->used = g_strdup(used);
562
+        mount->used = g_strdup(used);
Lines 571-579 Link Here
571
+
566
+
572
+        QTAILQ_INSERT_TAIL(mounts, mount, next);
567
+        QTAILQ_INSERT_TAIL(mounts, mount, next);
573
+    }
568
+    }
574
+    //free(line);
569
+    free(line);
570
+
571
+    status = pclose(fp);
572
+    if (status == -1) {
573
+        g_debug("Cannot close '%s'!!\n", dfcmd);
574
+        return;
575
+    }
575
+
576
+
576
+    fclose(fp);
577
+}
577
+}
578
+
578
+
579
+/* ======================================================= */
579
+/* ======================================================= */

Return to bug 260023