ANNOUNCE: supermin & libguestfs CI on ci.centos.org
by Pino Toscano
Hi,
I'm proud to say that now we've got a CI for supermin and libguestfs
available:
https://ci.centos.org/view/libguestfs/
We have three jobs that currently runs every night:
- supermin: builds supermin from git master, and runs the test suite
- libguestfs: builds libguestfs from git master using the supermin
built earlier, and runs the test suite; this is only triggered
if the supermin job is successful (as the libguestfs tests would
fail otherwise)
- libguestfs-dist: runs make dist && make maintainer-check-extra-dist
on the built libguestfs
Every job is built on few slaves representing different Linux
distributions, so we can ensure our development version can work with
newer releases and it doesn't break old ones. At the moment, the slaves
are:
- Fedora 22 (stable)
- CentOS 7 (stable)
- Debian sid (development)
- openSUSE 13.2 (stable)
- Mageia 5 (stable)
There are a few tests failures right now, mostly due to either network
not being setup properly with the libvirt backend, or failures with
newer xfstools versions.
Of course, more jobs can be added for different kind of build/testing,
so I'm open to more ideas about that.
All of this is possible thanks to the resources kindly offered by the
CentOS project, and the amazing work done to help me in setting up
this CI. Thanks again!
--
Pino Toscano
9 years, 4 months
[PATCH 0/2 v2] RFC: builder: support for Simple Streams metadata
by Pino Toscano
Hi,
this series adds a basic support for Simple Streams v1.0 metadata
files. This makes it possible to create a repository .conf files with
[cirros]
uri=http://download.cirros-cloud.net
format=simplestreams
to read the latest version of each CirrOS image.
TODO items:
- check the pasted metadata: listing and creating images works,
so most of the current metadata is correct
- possibly wait for normalization patches:
https://www.redhat.com/archives/libguestfs/2015-August/msg00058.html
Thanks,
Pino Toscano (2):
builder: add non-int revisions
builder: support Simple Streams v1.0 as index metadata
builder/Makefile.am | 13 ++-
builder/builder.ml | 11 +-
builder/cache.ml | 2 +-
builder/cache.mli | 6 +-
builder/downloader.mli | 2 +-
builder/index.ml | 4 +-
builder/index.mli | 2 +-
builder/index_parser.ml | 4 +-
builder/simplestreams_parser.ml | 213 +++++++++++++++++++++++++++++++++++++++
builder/simplestreams_parser.mli | 19 ++++
builder/sources.ml | 9 ++
builder/sources.mli | 1 +
builder/utils.ml | 7 ++
builder/virt-builder.pod | 7 ++
builder/yajl-c.c | 143 ++++++++++++++++++++++++++
builder/yajl.ml | 30 ++++++
builder/yajl.mli | 33 ++++++
po/POTFILES | 1 +
po/POTFILES-ml | 2 +
19 files changed, 495 insertions(+), 14 deletions(-)
create mode 100644 builder/simplestreams_parser.ml
create mode 100644 builder/simplestreams_parser.mli
create mode 100644 builder/yajl-c.c
create mode 100644 builder/yajl.ml
create mode 100644 builder/yajl.mli
--
2.1.0
9 years, 4 months
[PATCH 1/2] mllib: add normalize_arch helper
by Pino Toscano
Small helper to normalize an architecture string, so it is easier to
compare them and check for compatibilities.
Make use of it in guest_arch_compatible, simplifying it.
---
mllib/common_utils.ml | 12 ++++++++++--
mllib/common_utils.mli | 5 +++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
index f9e8996..ca6d470 100644
--- a/mllib/common_utils.ml
+++ b/mllib/common_utils.ml
@@ -730,13 +730,21 @@ let rec mkdir_p path permissions =
mkdir_p (Filename.dirname path) permissions;
Unix.mkdir path permissions
+let normalize_arch = function
+ | "i386" | "i486" | "i586" | "i686" -> "i386"
+ | "amd64" | "x86_64" -> "x86_64"
+ | "powerpc" | "ppc" -> "ppc"
+ | arch -> arch
+
(* Are guest arch and host_cpu compatible, in terms of being able
* to run commands in the libguestfs appliance?
*)
let guest_arch_compatible guest_arch =
- match Config.host_cpu, guest_arch with
+ let own = normalize_arch Config.host_cpu in
+ let guest_arch = normalize_arch guest_arch in
+ match own, guest_arch with
| x, y when x = y -> true
- | "x86_64", ("i386"|"i486"|"i586"|"i686") -> true
+ | "x86_64", "i386" -> true
| _ -> false
(** Return the last part of a string, after the specified separator. *)
diff --git a/mllib/common_utils.mli b/mllib/common_utils.mli
index 16834f7..ac232af 100644
--- a/mllib/common_utils.mli
+++ b/mllib/common_utils.mli
@@ -175,6 +175,11 @@ val qemu_input_filename : string -> string
val mkdir_p : string -> int -> unit
(** Creates a directory, and its parents if missing. *)
+val normalize_arch : string -> string
+(** Normalize the architecture name, i.e. maps it into a defined
+ identifier for it -- e.g. i386, i486, i586, and i686 are
+ normalized as i386. *)
+
val guest_arch_compatible : string -> bool
(** Are guest arch and host_cpu compatible, in terms of being able
to run commands in the libguestfs appliance? *)
--
2.1.0
9 years, 4 months
[PATCH 1/2] disk-create: Allow preallocation off/metadata/full.
by Richard W.M. Jones
For raw, this allows "off" as a synonym for "sparse" (to make it
consistent with qcow2).
For qcow2, this allows "sparse" as a synonym for "off".
It also adds qcow2 "full" preallocation, which is actually mapped to
the qemu option "falloc" (see arguments about this on the qemu-devel
mailing list, which we lost).
This also updates the test.
---
generator/actions.ml | 13 +++++++------
src/create.c | 16 ++++++++++++----
tests/create/test-disk-create.sh | 3 +++
3 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/generator/actions.ml b/generator/actions.ml
index d0d6a21..1c22f9f 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -3174,13 +3174,14 @@ The other optional parameters are:
=item C<preallocation>
-If format is C<raw>, then this can be either C<sparse> or C<full>
-to create a sparse or fully allocated file respectively. The default
-is C<sparse>.
+If format is C<raw>, then this can be either C<off> (or C<sparse>)
+or C<full> to create a sparse or fully allocated file respectively.
+The default is C<off>.
-If format is C<qcow2>, then this can be either C<off> or
-C<metadata>. Preallocating metadata can be faster when doing lots
-of writes, but uses more space. The default is C<off>.
+If format is C<qcow2>, then this can be C<off> (or C<sparse>),
+C<metadata> or C<full>. Preallocating metadata can be faster
+when doing lots of writes, but uses more space.
+The default is C<off>.
=item C<compat>
diff --git a/src/create.c b/src/create.c
index 46bee7c..e9bac95 100644
--- a/src/create.c
+++ b/src/create.c
@@ -1,5 +1,5 @@
/* libguestfs
- * Copyright (C) 2012 Red Hat Inc.
+ * Copyright (C) 2012-2015 Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -140,7 +140,8 @@ disk_create_raw (guestfs_h *g, const char *filename, int64_t size,
return -1;
}
if (optargs->bitmask & GUESTFS_DISK_CREATE_PREALLOCATION_BITMASK) {
- if (STREQ (optargs->preallocation, "sparse"))
+ if (STREQ (optargs->preallocation, "off") ||
+ STREQ (optargs->preallocation, "sparse"))
allocated = 0;
else if (STREQ (optargs->preallocation, "full"))
allocated = 1;
@@ -273,8 +274,15 @@ disk_create_qcow2 (guestfs_h *g, const char *orig_filename, int64_t size,
}
}
if (optargs->bitmask & GUESTFS_DISK_CREATE_PREALLOCATION_BITMASK) {
- preallocation = optargs->preallocation;
- if (STRNEQ (preallocation, "off") && STRNEQ (preallocation, "metadata")) {
+ if (STREQ (optargs->preallocation, "off") ||
+ STREQ (optargs->preallocation, "sparse"))
+ preallocation = "off";
+ else if (STREQ (optargs->preallocation, "metadata"))
+ preallocation = "metadata";
+ else if (STREQ (optargs->preallocation, "full"))
+ /* Ugh: https://lists.gnu.org/archive/html/qemu-devel/2014-08/msg03863.html */
+ preallocation = "falloc";
+ else {
error (g, _("invalid value for preallocation parameter '%s'"),
preallocation);
return -1;
diff --git a/tests/create/test-disk-create.sh b/tests/create/test-disk-create.sh
index 93dc706..e18d6da 100755
--- a/tests/create/test-disk-create.sh
+++ b/tests/create/test-disk-create.sh
@@ -27,11 +27,14 @@ rm -f disk*.img file:*.img
guestfish <<EOF
disk-create disk1.img raw 256K
+ disk-create disk2.img raw 256K preallocation:off
disk-create disk2.img raw 256K preallocation:sparse
disk-create disk3.img raw 256K preallocation:full
disk-create disk4.img qcow2 256K
disk-create disk5.img qcow2 256K preallocation:off
+ disk-create disk5.img qcow2 256K preallocation:sparse
disk-create disk6.img qcow2 256K preallocation:metadata
+ disk-create disk6.img qcow2 256K preallocation:full
disk-create disk7.img qcow2 256K compat:1.1
disk-create disk8.img qcow2 256K clustersize:128K
disk-create disk9.img qcow2 -1 backingfile:disk1.img compat:1.1
--
2.5.0
9 years, 4 months
[PATCH 0/1] dib: handle unsetting functions in environment
by John Eckersberg
This fixes this error I'm hitting when trying to run virt-dib:
$ ./run virt-dib -v -x -B ~/git/diskimage-builder/lib/ --element-path ~/git/diskimage-builder/elements/ fedora-minimal
[ 0.0] Elements: base fedora-minimal
[ 0.0] Expanded elements: base dib-init-system dib-run-parts fedora-minimal install-types package-installs pkg-map redhat-common rpm-distro yum yum-minimal
[ 0.0] Carried environment variables:
[ 0.0] Preparing auxiliary data
[ 0.2] Running: extra-data.d/10-create-pkg-map-dir
/tmp/dib.hfC3qu/aux/fake-bin/sudo: line 39: unset: `BASH_FUNC_module()': not a valid identifier
virt-dib: error: external command ''/tmp/dib.hfC3qu/run-part-extra.sh'
'/tmp/dib.hfC3qu/aux/hooks/extra-data.d' '10-create-pkg-map-dir'' exited
with error 1
9 years, 4 months
[PATCH 1/2] inspect: recognize the Alpine Linux distribution
by Pino Toscano
Just basic identification, name and version.
---
generator/actions.ml | 4 ++++
src/guestfs-internal.h | 1 +
src/inspect-fs-unix.c | 10 ++++++++++
src/inspect-fs.c | 2 ++
src/inspect-icon.c | 1 +
src/inspect.c | 1 +
6 files changed, 19 insertions(+)
diff --git a/generator/actions.ml b/generator/actions.ml
index 35af981..26cc0da 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -1055,6 +1055,10 @@ Currently defined distros are:
=over 4
+=item \"alpinelinux\"
+
+Alpine Linux.
+
=item \"archlinux\"
Arch Linux.
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index bbd7fb4..0cd7f74 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -552,6 +552,7 @@ enum inspect_os_distro {
OS_DISTRO_FREEBSD,
OS_DISTRO_NETBSD,
OS_DISTRO_COREOS,
+ OS_DISTRO_ALPINE_LINUX,
};
enum inspect_os_package_format {
diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index c9bbad9..abfa527 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -601,6 +601,16 @@ guestfs_int_check_linux_root (guestfs_h *g, struct inspect_fs *fs)
if (guestfs_int_parse_major_minor (g, fs) == -1)
return -1;
}
+ else if (guestfs_is_file_opts (g, "/etc/alpine-release",
+ GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) {
+ fs->distro = OS_DISTRO_ALPINE_LINUX;
+
+ if (parse_release_file (g, fs, "/etc/alpine-release") == -1)
+ return -1;
+
+ if (guestfs_int_parse_major_minor (g, fs) == -1)
+ return -1;
+ }
skip_release_checks:;
diff --git a/src/inspect-fs.c b/src/inspect-fs.c
index 073ae57..94c5bb9 100644
--- a/src/inspect-fs.c
+++ b/src/inspect-fs.c
@@ -494,6 +494,7 @@ guestfs_int_check_package_format (guestfs_h *g, struct inspect_fs *fs)
case OS_DISTRO_FREEBSD:
case OS_DISTRO_NETBSD:
case OS_DISTRO_OPENBSD:
+ case OS_DISTRO_ALPINE_LINUX:
case OS_DISTRO_UNKNOWN:
fs->package_format = OS_PACKAGE_FORMAT_UNKNOWN;
break;
@@ -565,6 +566,7 @@ guestfs_int_check_package_management (guestfs_h *g, struct inspect_fs *fs)
case OS_DISTRO_FREEBSD:
case OS_DISTRO_NETBSD:
case OS_DISTRO_OPENBSD:
+ case OS_DISTRO_ALPINE_LINUX:
case OS_DISTRO_UNKNOWN:
fs->package_management = OS_PACKAGE_MANAGEMENT_UNKNOWN;
break;
diff --git a/src/inspect-icon.c b/src/inspect-icon.c
index ab730b5..77256a3 100644
--- a/src/inspect-icon.c
+++ b/src/inspect-icon.c
@@ -182,6 +182,7 @@ guestfs_impl_inspect_get_icon (guestfs_h *g, const char *root, size_t *size_r,
case OS_DISTRO_FREEBSD:
case OS_DISTRO_NETBSD:
case OS_DISTRO_OPENBSD:
+ case OS_DISTRO_ALPINE_LINUX:
case OS_DISTRO_UNKNOWN:
; /* nothing */
}
diff --git a/src/inspect.c b/src/inspect.c
index abe9087..79f674c 100644
--- a/src/inspect.c
+++ b/src/inspect.c
@@ -255,6 +255,7 @@ guestfs_impl_inspect_get_distro (guestfs_h *g, const char *root)
return NULL;
switch (fs->distro) {
+ case OS_DISTRO_ALPINE_LINUX: ret = safe_strdup (g, "alpinelinux"); break;
case OS_DISTRO_ARCHLINUX: ret = safe_strdup (g, "archlinux"); break;
case OS_DISTRO_BUILDROOT: ret = safe_strdup (g, "buildroot"); break;
case OS_DISTRO_CENTOS: ret = safe_strdup (g, "centos"); break;
--
2.1.0
9 years, 4 months
FC22: virt-p2v-make-kickstart/livecd-creator doesn't build
by Martin Breault
Hello,
I am trying to make a .iso to p2v some old windows servers, and I
installed a brand new FC22 server to build my images
I run
virt-p2v-make-kickstart fedora
livecd-creator p2v.ks
and I get the following error:
Installing: grubby ##################### [435/436]
Installing: uboot-tools ##################### [436/436]
Installing: b43-fwcutter ##################### [437/436]
947 blocks
No '/dev/log' or 'logger' included for syslog logging
dracut module 'dmsquash-live' depends on 'img-lib', which can't be installed
dracut module 'dmsquash-live' cannot be found or installed.
mkinitrd failed
warning: %posttrans(kernel-core-4.0.4-301.fc22.i686) scriptlet failed,
exit status 1
getsebool: SELinux is disabled
success
The .iso builds however the boot menu just returns to itself and I never
get to the p2v menu. What am I doing incorrectly to build the ISO?
Thanks ,
Marty
9 years, 4 months
virt-v2v conversion of Windows > 7 (was: Re: virt-v2v-1.28.1-1.49.el7.x86_64)
by Richard W.M. Jones
On Thu, Aug 06, 2015 at 05:52:57PM -0400, Chris Conn wrote:
> Hello,
>
> I am following
> https://www.redhat.com/archives/libguestfs/2015-April/msg00038.html
> and have added this repo to my Centos7 server:
>
> [libguestfs-RHEL-7.1-preview]
> name=libguestfs RHEL 7.1 preview - x86_64
> baseurl=http://people.redhat.com/~rjones/libguestfs-RHEL-7.2-preview/
> enabled=1
> gpgcheck=0
>
> Is this the correct repo location as when I convert using virt-v2vb
> a Win2012R2 server I still get the error that > win7 cannot be
> converted:
Yes, this is correct.
> [ 91.0] Converting Windows Server 2012 R2 Standard to run on KVM
> virt-v2v: error: virt-v2v cannot be used to convert Windows > 7 / 2008R2
> (see https://bugzilla.redhat.com/1190669)
>
> If reporting bugs, run virt-v2v with debugging enabled and include the
> complete output:
>
>
> How is this possible if I am using the preview packages?
No, it's not possible. See the bug that is linked in the output.
It is possible with virt-v2v from Fedora 22; however it may not
be reliable. It's something we hope to get working properly
for RHEL 7.3.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
9 years, 4 months