forked from pool/libguestfs
- update virtio-blk patch to force vda in libguestfs-test-tool
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libguestfs?expand=0&rev=107
This commit is contained in:
parent
8e758de87e
commit
68246d27ec
@ -1,4 +1,4 @@
|
||||
From e823035a30944ba71b9d8e60b30a650425dc9711 Mon Sep 17 00:00:00 2001
|
||||
From 04b36384e91cf0e6242be9daa1d06d269cb9cf3d Mon Sep 17 00:00:00 2001
|
||||
From: Olaf Hering <olaf@aepfle.de>
|
||||
Date: Mon, 3 Sep 2012 19:50:44 +0200
|
||||
Subject: [PATCH] force virtio_blk in old guest kernel
|
||||
@ -6,13 +6,14 @@ Subject: [PATCH] force virtio_blk in old guest kernel
|
||||
Signed-off-by: Olaf Hering <olaf@aepfle.de>
|
||||
---
|
||||
src/launch-appliance.c | 24 ++++++++++++++++++++++++
|
||||
1 Datei geändert, 24 Zeilen hinzugefügt(+)
|
||||
test-tool/test-tool.c | 15 ++++++++++-----
|
||||
2 files changed, 34 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/launch-appliance.c b/src/launch-appliance.c
|
||||
index 328cd19..796c268 100644
|
||||
index e353e05..f037d15 100644
|
||||
--- a/src/launch-appliance.c
|
||||
+++ b/src/launch-appliance.c
|
||||
@@ -881,6 +881,28 @@ is_openable (guestfs_h *g, const char *path, int flags)
|
||||
@@ -869,6 +869,28 @@ is_openable (guestfs_h *g, const char *path, int flags)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -41,7 +42,7 @@ index 328cd19..796c268 100644
|
||||
/* Returns 1 = use virtio-scsi, or 0 = use virtio-blk. */
|
||||
static int
|
||||
qemu_supports_virtio_scsi (guestfs_h *g)
|
||||
@@ -903,6 +925,8 @@ qemu_supports_virtio_scsi (guestfs_h *g)
|
||||
@@ -891,6 +913,8 @@ qemu_supports_virtio_scsi (guestfs_h *g)
|
||||
g->app.virtio_scsi = 3;
|
||||
}
|
||||
|
||||
@ -50,6 +51,57 @@ index 328cd19..796c268 100644
|
||||
return g->app.virtio_scsi == 1;
|
||||
}
|
||||
|
||||
diff --git a/test-tool/test-tool.c b/test-tool/test-tool.c
|
||||
index 4b764ee..2ba9977 100644
|
||||
--- a/test-tool/test-tool.c
|
||||
+++ b/test-tool/test-tool.c
|
||||
@@ -35,6 +35,11 @@
|
||||
|
||||
#include <guestfs.h>
|
||||
|
||||
+#ifdef GUESTFS_QEMU_NO_VIRTIO_BLK
|
||||
+#define VDISK_KERNEL_NAME "vda"
|
||||
+#else
|
||||
+#define VDISK_KERNEL_NAME "sda"
|
||||
+#endif
|
||||
#define _(str) dgettext(PACKAGE, (str))
|
||||
//#define N_(str) dgettext(PACKAGE, (str))
|
||||
|
||||
@@ -55,7 +60,7 @@
|
||||
#define DEFAULT_TIMEOUT 600
|
||||
|
||||
static int timeout = DEFAULT_TIMEOUT;
|
||||
-static char tmpf[] = P_tmpdir "/libguestfs-test-tool-sda-XXXXXX";
|
||||
+static char tmpf[] = P_tmpdir "/libguestfs-test-tool-" VDISK_KERNEL_NAME "-XXXXXX";
|
||||
static guestfs_h *g;
|
||||
|
||||
static void make_files (void);
|
||||
@@ -240,21 +245,21 @@ main (int argc, char *argv[])
|
||||
fflush (stdout);
|
||||
|
||||
/* Create the filesystem and mount everything. */
|
||||
- if (guestfs_part_disk (g, "/dev/sda", "mbr") == -1) {
|
||||
+ if (guestfs_part_disk (g, "/dev/" VDISK_KERNEL_NAME "", "mbr") == -1) {
|
||||
fprintf (stderr,
|
||||
_("libguestfs-test-tool: failed to run part-disk\n"));
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
- if (guestfs_mkfs (g, "ext2", "/dev/sda1") == -1) {
|
||||
+ if (guestfs_mkfs (g, "ext2", "/dev/" VDISK_KERNEL_NAME "1") == -1) {
|
||||
fprintf (stderr,
|
||||
_("libguestfs-test-tool: failed to mkfs.ext2\n"));
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
- if (guestfs_mount (g, "/dev/sda1", "/") == -1) {
|
||||
+ if (guestfs_mount (g, "/dev/" VDISK_KERNEL_NAME "1", "/") == -1) {
|
||||
fprintf (stderr,
|
||||
- _("libguestfs-test-tool: failed to mount /dev/sda1 on /\n"));
|
||||
+ _("libguestfs-test-tool: failed to mount /dev/" VDISK_KERNEL_NAME "1 on /\n"));
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
--
|
||||
1.7.11.5
|
||||
1.7.12
|
||||
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 24 14:55:51 CEST 2012 - ohering@suse.de
|
||||
|
||||
- update virtio-blk patch to force vda in libguestfs-test-tool
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 24 11:01:57 CEST 2012 - ohering@suse.de
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user