SHA256
1
0
forked from pool/libguestfs

Accepting request 805394 from Virtualization

Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/805394
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libguestfs?expand=0&rev=70
This commit is contained in:
Dominique Leuenberger 2020-05-14 21:26:19 +00:00 committed by Git OBS Bridge
commit 24a9dbe5b7
17 changed files with 198 additions and 429 deletions

View File

@ -33,17 +33,15 @@ libvirt URLs.
common/utils/Makefile.am | 2 + common/utils/Makefile.am | 2 +
common/utils/libxml2-utils.c | 178 +++++++++++++++++++++++++++++++++++++++++++ common/utils/libxml2-utils.c | 178 +++++++++++++++++++++++++++++++++++++++++++
common/utils/libxml2-utils.h | 27 +++++++ common/utils/libxml2-utils.h | 27 +++++++
v2v/input_vmx.ml | 8 +-
v2v/virt-v2v.pod | 5 +-
10 files changed, 258 insertions(+), 18 deletions(-) 10 files changed, 258 insertions(+), 18 deletions(-)
create mode 100644 common/utils/libxml2-utils.c create mode 100644 common/utils/libxml2-utils.c
create mode 100644 common/utils/libxml2-utils.h create mode 100644 common/utils/libxml2-utils.h
diff --git a/common/mlxml/Makefile.am b/common/mlxml/Makefile.am Index: libguestfs-1.42.0/common/mlxml/Makefile.am
index 083c7a64b..739b58ae4 100644 ===================================================================
--- a/common/mlxml/Makefile.am --- libguestfs-1.42.0.orig/common/mlxml/Makefile.am
+++ b/common/mlxml/Makefile.am +++ libguestfs-1.42.0/common/mlxml/Makefile.am
@@ -53,6 +53,7 @@ libmlxml_a_CPPFLAGS = \ @@ -54,6 +54,7 @@ libmlxml_a_CPPFLAGS = \
-I. \ -I. \
-I$(top_builddir) \ -I$(top_builddir) \
-I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \ -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib \
@ -51,10 +49,10 @@ index 083c7a64b..739b58ae4 100644
-I$(shell $(OCAMLC) -where) -I$(shell $(OCAMLC) -where)
libmlxml_a_CFLAGS = \ libmlxml_a_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \ $(WARN_CFLAGS) $(WERROR_CFLAGS) \
diff --git a/common/mlxml/xml-c.c b/common/mlxml/xml-c.c Index: libguestfs-1.42.0/common/mlxml/xml-c.c
index 3ebecb25e..6dcdb5ccb 100644 ===================================================================
--- a/common/mlxml/xml-c.c --- libguestfs-1.42.0.orig/common/mlxml/xml-c.c
+++ b/common/mlxml/xml-c.c +++ libguestfs-1.42.0/common/mlxml/xml-c.c
@@ -27,17 +27,21 @@ @@ -27,17 +27,21 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -76,8 +74,8 @@ index 3ebecb25e..6dcdb5ccb 100644
+ +
#pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wmissing-prototypes"
/* xmlDocPtr type */ /* Replacement if caml_alloc_initialized_string is missing, added
@@ -426,16 +430,11 @@ mllib_xml_doc_get_root_element (value docv) @@ -438,16 +442,11 @@ mllib_xml_doc_get_root_element (value do
} }
} }
@ -97,7 +95,7 @@ index 3ebecb25e..6dcdb5ccb 100644
rv = caml_alloc_tuple (9); rv = caml_alloc_tuple (9);
@@ -514,7 +513,37 @@ mllib_xml_parse_uri (value strv) @@ -526,7 +525,37 @@ mllib_xml_parse_uri (value strv)
else ov = Val_int (0); else ov = Val_int (0);
Store_field (rv, 8, ov); Store_field (rv, 8, ov);
@ -135,19 +133,19 @@ index 3ebecb25e..6dcdb5ccb 100644
+ xmlFreeURI (uri); + xmlFreeURI (uri);
CAMLreturn (rv); CAMLreturn (rv);
} }
diff --git a/common/mlxml/xml.ml b/common/mlxml/xml.ml Index: libguestfs-1.42.0/common/mlxml/xml.ml
index 5b5c09c00..faeea35ee 100644 ===================================================================
--- a/common/mlxml/xml.ml --- libguestfs-1.42.0.orig/common/mlxml/xml.ml
+++ b/common/mlxml/xml.ml +++ libguestfs-1.42.0/common/mlxml/xml.ml
@@ -162,3 +162,4 @@ type uri = { @@ -162,3 +162,4 @@ type uri = {
} }
external parse_uri : string -> uri = "mllib_xml_parse_uri" external parse_uri : string -> uri = "mllib_xml_parse_uri"
+external parse_nonstandard_uri : string -> uri = "mllib_xml_parse_nonstandard_uri" +external parse_nonstandard_uri : string -> uri = "mllib_xml_parse_nonstandard_uri"
diff --git a/common/mlxml/xml.mli b/common/mlxml/xml.mli Index: libguestfs-1.42.0/common/mlxml/xml.mli
index f561bd673..73c2fdd4b 100644 ===================================================================
--- a/common/mlxml/xml.mli --- libguestfs-1.42.0.orig/common/mlxml/xml.mli
+++ b/common/mlxml/xml.mli +++ libguestfs-1.42.0/common/mlxml/xml.mli
@@ -115,3 +115,7 @@ val parse_uri : string -> uri @@ -115,3 +115,7 @@ val parse_uri : string -> uri
Note this is different from the {!URI} module which is specialized Note this is different from the {!URI} module which is specialized
for parsing the [-a] parameter on the command line. This function for parsing the [-a] parameter on the command line. This function
@ -156,10 +154,10 @@ index f561bd673..73c2fdd4b 100644
+val parse_nonstandard_uri : string -> uri +val parse_nonstandard_uri : string -> uri
+(** Similar to {!parse_uri} but only for use with our non-standard +(** Similar to {!parse_uri} but only for use with our non-standard
+ URIs. See [guestfs_int_parse_nonstandard_uri] in [common/utils]. *) + URIs. See [guestfs_int_parse_nonstandard_uri] in [common/utils]. *)
diff --git a/common/options/uri.c b/common/options/uri.c Index: libguestfs-1.42.0/common/options/uri.c
index ac36bccb2..88a5f0560 100644 ===================================================================
--- a/common/options/uri.c --- libguestfs-1.42.0.orig/common/options/uri.c
+++ b/common/options/uri.c +++ libguestfs-1.42.0/common/options/uri.c
@@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
#include "guestfs.h" #include "guestfs.h"
@ -168,7 +166,7 @@ index ac36bccb2..88a5f0560 100644
#include "uri.h" #include "uri.h"
static int is_uri (const char *arg); static int is_uri (const char *arg);
@@ -114,9 +115,9 @@ parse (const char *arg, char **path_ret, char **protocol_ret, @@ -114,9 +115,9 @@ parse (const char *arg, char **path_ret,
CLEANUP_FREE char *socket = NULL; CLEANUP_FREE char *socket = NULL;
char *path; char *path;
@ -180,24 +178,23 @@ index ac36bccb2..88a5f0560 100644
getprogname (), arg); getprogname (), arg);
return -1; return -1;
} }
diff --git a/common/utils/Makefile.am b/common/utils/Makefile.am Index: libguestfs-1.42.0/common/utils/Makefile.am
index 143e2c141..1fa98f992 100644 ===================================================================
--- a/common/utils/Makefile.am --- libguestfs-1.42.0.orig/common/utils/Makefile.am
+++ b/common/utils/Makefile.am +++ libguestfs-1.42.0/common/utils/Makefile.am
@@ -26,6 +26,8 @@ libutils_la_SOURCES = \ @@ -28,6 +28,8 @@ libutils_la_SOURCES = \
gnulib-cleanups.c \
guestfs-utils.h \
libxml2-cleanups.c \ libxml2-cleanups.c \
libxml2-writer-macros.h \
stringlists-utils.c \
+ libxml2-utils.c \ + libxml2-utils.c \
+ libxml2-utils.h \ + libxml2-utils.h \
utils.c utils.c
libutils_la_CPPFLAGS = \ libutils_la_CPPFLAGS = \
-DGUESTFS_WARN_DEPRECATED=1 \ -DGUESTFS_NO_DEPRECATED=1 \
diff --git a/common/utils/libxml2-utils.c b/common/utils/libxml2-utils.c Index: libguestfs-1.42.0/common/utils/libxml2-utils.c
new file mode 100644 ===================================================================
index 000000000..8a05aa5b1
--- /dev/null --- /dev/null
+++ b/common/utils/libxml2-utils.c +++ libguestfs-1.42.0/common/utils/libxml2-utils.c
@@ -0,0 +1,178 @@ @@ -0,0 +1,178 @@
+/* libguestfs +/* libguestfs
+ * Copyright (C) 2017 Red Hat Inc. + * Copyright (C) 2017 Red Hat Inc.
@ -347,7 +344,7 @@ index 000000000..8a05aa5b1
+ inp = input; + inp = input;
+ outp = out; + outp = out;
+ +
+ r = iconv (ic, (ICONV_CONST char **) &inp, &inlen, &outp, &outlen); + r = iconv (ic, (char **) &inp, &inlen, &outp, &outlen);
+ if (r == (size_t) -1) { + if (r == (size_t) -1) {
+ if (errno == E2BIG) { + if (errno == E2BIG) {
+ err = errno; + err = errno;
@ -377,11 +374,10 @@ index 000000000..8a05aa5b1
+ +
+ return out; + return out;
+} +}
diff --git a/common/utils/libxml2-utils.h b/common/utils/libxml2-utils.h Index: libguestfs-1.42.0/common/utils/libxml2-utils.h
new file mode 100644 ===================================================================
index 000000000..d9916ea58
--- /dev/null --- /dev/null
+++ b/common/utils/libxml2-utils.h +++ libguestfs-1.42.0/common/utils/libxml2-utils.h
@@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
+/* libguestfs +/* libguestfs
+ * Copyright (C) 2017 Red Hat Inc. + * Copyright (C) 2017 Red Hat Inc.
@ -410,42 +406,3 @@ index 000000000..d9916ea58
+extern xmlURIPtr guestfs_int_parse_nonstandard_uri (const char *uri); +extern xmlURIPtr guestfs_int_parse_nonstandard_uri (const char *uri);
+ +
+#endif /* GUESTFS_LIBXML2_UTILS_H_ */ +#endif /* GUESTFS_LIBXML2_UTILS_H_ */
diff --git a/v2v/input_vmx.ml b/v2v/input_vmx.ml
index a8b33f66f..b97fac700 100644
--- a/v2v/input_vmx.ml
+++ b/v2v/input_vmx.ml
@@ -38,11 +38,11 @@ type vmx_source =
let vmx_source_of_arg input_transport arg =
match input_transport, arg with
| None, arg -> File arg
- | Some `SSH, arg ->
+ | Some `SSH, uri ->
let uri =
- try Xml.parse_uri arg
- with Invalid_argument _ ->
- error (f_"remote vmx %s could not be parsed as a URI") arg in
+ try Xml.parse_nonstandard_uri uri
+ with exn ->
+ error (f_"could not parse URI: %s") (Printexc.to_string exn) in
if uri.Xml.uri_scheme <> None && uri.Xml.uri_scheme <> Some "ssh" then
error (f_"vmx URI start with ssh://...");
if uri.Xml.uri_server = None then
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
index e30cc03fb..c67b67e48 100644
--- a/v2v/virt-v2v.pod
+++ b/v2v/virt-v2v.pod
@@ -1458,10 +1458,7 @@ authorized_keys.
When using the SSH input transport you must specify a remote
C<ssh://...> URI pointing to the VMX file. A typical URI looks like:
- ssh://root@esxi.example.com/vmfs/volumes/datastore1/my%20guest/my%20guest.vmx
-
-Any space must be escaped with C<%20> and other non-ASCII characters
-may also need to be URI-escaped.
+ ssh://root@esxi.example.com/vmfs/volumes/datastore1/my guest/my guest.vmx
The username is not required if it is the same as your local username.
--
2.16.1

View File

@ -13,10 +13,10 @@ guestfs-utils.h as guestfs_int_string_to_utf8()
common/utils/utils.c | 64 ++++++++++++++++++++++++++++++++++++++++ common/utils/utils.c | 64 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 68 deletions(-) 3 files changed, 76 insertions(+), 68 deletions(-)
diff --git a/common/utils/guestfs-utils.h b/common/utils/guestfs-utils.h Index: libguestfs-1.42.0/common/utils/guestfs-utils.h
index 90e7c3dd9..86da693bc 100644 ===================================================================
--- a/common/utils/guestfs-utils.h --- libguestfs-1.42.0.orig/common/utils/guestfs-utils.h
+++ b/common/utils/guestfs-utils.h +++ libguestfs-1.42.0/common/utils/guestfs-utils.h
@@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
#define GUESTFS_UTILS_H_ #define GUESTFS_UTILS_H_
@ -25,10 +25,10 @@ index 90e7c3dd9..86da693bc 100644
#include "guestfs-internal-all.h" #include "guestfs-internal-all.h"
#include "cleanups.h" #include "cleanups.h"
@@ -70,6 +71,16 @@ extern int guestfs_int_is_fifo (int64_t mode); @@ -68,6 +69,17 @@ extern int guestfs_int_is_sock (int64_t
extern int guestfs_int_is_lnk (int64_t mode);
extern int guestfs_int_is_sock (int64_t mode);
extern char *guestfs_int_full_path (const char *dir, const char *name); extern char *guestfs_int_full_path (const char *dir, const char *name);
extern void guestfs_int_hexdump (const void *data, size_t len, FILE *fp);
+extern char *guestfs_int_string_to_utf8 (/* const */ char *input, const char *encoding); +extern char *guestfs_int_string_to_utf8 (/* const */ char *input, const char *encoding);
+ +
+/* Would be const, but the interface to iconv is not const-correct on +/* Would be const, but the interface to iconv is not const-correct on
@ -39,13 +39,14 @@ index 90e7c3dd9..86da693bc 100644
+{ +{
+ return guestfs_int_string_to_utf8 (input, nl_langinfo (CODESET)); + return guestfs_int_string_to_utf8 (input, nl_langinfo (CODESET));
+} +}
+
/* Not all language bindings know how to deal with Pointer arguments. /* Not all language bindings know how to deal with Pointer arguments.
* Those that don't will use this macro which complains noisily and * Those that don't will use this macro which complains noisily and
diff --git a/common/utils/libxml2-utils.c b/common/utils/libxml2-utils.c * returns NULL.
index 8a05aa5b1..a71db30dd 100644 Index: libguestfs-1.42.0/common/utils/libxml2-utils.c
--- a/common/utils/libxml2-utils.c ===================================================================
+++ b/common/utils/libxml2-utils.c --- libguestfs-1.42.0.orig/common/utils/libxml2-utils.c
+++ libguestfs-1.42.0/common/utils/libxml2-utils.c
@@ -30,8 +30,6 @@ @@ -30,8 +30,6 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
@ -64,7 +65,7 @@ index 8a05aa5b1..a71db30dd 100644
/** /**
* This is a wrapper around C<xmlParseURI>. That function cannot * This is a wrapper around C<xmlParseURI>. That function cannot
* handle spaces and some non-ASCII characters found in URIs. This * handle spaces and some non-ASCII characters found in URIs. This
@@ -73,7 +69,7 @@ guestfs_int_parse_nonstandard_uri (const char *arg) @@ -73,7 +69,7 @@ guestfs_int_parse_nonstandard_uri (const
xmlURIPtr ret; xmlURIPtr ret;
/* Convert the string to UTF-8. */ /* Convert the string to UTF-8. */
@ -73,7 +74,7 @@ index 8a05aa5b1..a71db30dd 100644
if (uri == NULL) if (uri == NULL)
return NULL; return NULL;
@@ -113,66 +109,3 @@ guestfs_int_parse_nonstandard_uri (const char *arg) @@ -113,66 +109,3 @@ guestfs_int_parse_nonstandard_uri (const
return ret; return ret;
} }
@ -110,7 +111,7 @@ index 8a05aa5b1..a71db30dd 100644
- inp = input; - inp = input;
- outp = out; - outp = out;
- -
- r = iconv (ic, (ICONV_CONST char **) &inp, &inlen, &outp, &outlen); - r = iconv (ic, (char **) &inp, &inlen, &outp, &outlen);
- if (r == (size_t) -1) { - if (r == (size_t) -1) {
- if (errno == E2BIG) { - if (errno == E2BIG) {
- err = errno; - err = errno;
@ -140,10 +141,10 @@ index 8a05aa5b1..a71db30dd 100644
- -
- return out; - return out;
-} -}
diff --git a/common/utils/utils.c b/common/utils/utils.c Index: libguestfs-1.42.0/common/utils/utils.c
index 22af62b0f..faef7c089 100644 ===================================================================
--- a/common/utils/utils.c --- libguestfs-1.42.0.orig/common/utils/utils.c
+++ b/common/utils/utils.c +++ libguestfs-1.42.0/common/utils/utils.c
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
@ -152,9 +153,9 @@ index 22af62b0f..faef7c089 100644
/* NB: MUST NOT require linking to gnulib, because that will break the /* NB: MUST NOT require linking to gnulib, because that will break the
* Python 'sdist' which includes a copy of this file. It's OK to * Python 'sdist' which includes a copy of this file. It's OK to
@@ -733,3 +734,66 @@ guestfs_int_full_path (const char *dir, const char *name) @@ -641,3 +642,66 @@ guestfs_int_hexdump (const void *data, s
fprintf (fp, "|\n");
return path; }
} }
+ +
+/* Would be const, but the interface to iconv is not const-correct on +/* Would be const, but the interface to iconv is not const-correct on
@ -189,7 +190,7 @@ index 22af62b0f..faef7c089 100644
+ inp = input; + inp = input;
+ outp = out; + outp = out;
+ +
+ r = iconv (ic, (ICONV_CONST char **) &inp, &inlen, &outp, &outlen); + r = iconv (ic, (char **) &inp, &inlen, &outp, &outlen);
+ if (r == (size_t) -1) { + if (r == (size_t) -1) {
+ if (errno == E2BIG) { + if (errno == E2BIG) {
+ err = errno; + err = errno;
@ -219,6 +220,3 @@ index 22af62b0f..faef7c089 100644
+ +
+ return out; + return out;
+} +}
--
2.16.1

View File

@ -14,10 +14,10 @@ fails, try converting it from latin-1.
test-data/phony-guests/fedora-packages.db.txt | 4 ++-- test-data/phony-guests/fedora-packages.db.txt | 4 ++--
3 files changed, 32 insertions(+), 6 deletions(-) 3 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/inspector/expected-fedora.img.xml b/inspector/expected-fedora.img.xml Index: libguestfs-1.42.0/inspector/expected-fedora.img.xml
index df6060a73..c29f9770e 100644 ===================================================================
--- a/inspector/expected-fedora.img.xml --- libguestfs-1.42.0.orig/inspector/expected-fedora.img.xml
+++ b/inspector/expected-fedora.img.xml +++ libguestfs-1.42.0/inspector/expected-fedora.img.xml
@@ -34,12 +34,16 @@ @@ -34,12 +34,16 @@
<version>1.0</version> <version>1.0</version>
<release>1.fc14</release> <release>1.fc14</release>
@ -35,10 +35,10 @@ index df6060a73..c29f9770e 100644
</application> </application>
<application> <application>
<name>test3</name> <name>test3</name>
diff --git a/lib/inspect-apps.c b/lib/inspect-apps.c Index: libguestfs-1.42.0/lib/inspect-apps.c
index f0cf16b38..fdea85188 100644 ===================================================================
--- a/lib/inspect-apps.c --- libguestfs-1.42.0.orig/lib/inspect-apps.c
+++ b/lib/inspect-apps.c +++ libguestfs-1.42.0/lib/inspect-apps.c
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
@ -54,8 +54,8 @@ index f0cf16b38..fdea85188 100644
+#include "guestfs-utils.h" +#include "guestfs-utils.h"
#include "structs-cleanups.h" #include "structs-cleanups.h"
#ifdef DB_DUMP /* Some limits on what the inspection code will read, for safety. */
@@ -251,7 +253,7 @@ get_rpm_header_tag (guestfs_h *g, const unsigned char *header_start, @@ -266,7 +268,7 @@ get_rpm_header_tag (guestfs_h *g, const
/* This function parses the RPM header structure to pull out various /* This function parses the RPM header structure to pull out various
* tag strings (version, release, arch, etc.). For more detail on the * tag strings (version, release, arch, etc.). For more detail on the
* header format, see: * header format, see:
@ -64,7 +64,7 @@ index f0cf16b38..fdea85188 100644
*/ */
/* The minimum header size that makes sense here is 24 bytes. Four /* The minimum header size that makes sense here is 24 bytes. Four
@@ -301,6 +303,20 @@ struct read_package_data { @@ -316,6 +318,20 @@ struct read_package_data {
struct guestfs_application2_list *apps; struct guestfs_application2_list *apps;
}; };
@ -85,7 +85,7 @@ index f0cf16b38..fdea85188 100644
static int static int
read_package (guestfs_h *g, read_package (guestfs_h *g,
const unsigned char *key, size_t keylen, const unsigned char *key, size_t keylen,
@@ -311,7 +327,7 @@ read_package (guestfs_h *g, @@ -326,7 +342,7 @@ read_package (guestfs_h *g,
struct rpm_name nkey, *entry; struct rpm_name nkey, *entry;
CLEANUP_FREE char *version = NULL, *release = NULL, CLEANUP_FREE char *version = NULL, *release = NULL,
*epoch_str = NULL, *arch = NULL, *url = NULL, *summary = NULL, *epoch_str = NULL, *arch = NULL, *url = NULL, *summary = NULL,
@ -94,7 +94,7 @@ index f0cf16b38..fdea85188 100644
int32_t epoch; int32_t epoch;
/* This function reads one (key, value) pair from the Packages /* This function reads one (key, value) pair from the Packages
@@ -342,8 +358,14 @@ read_package (guestfs_h *g, @@ -357,8 +373,14 @@ read_package (guestfs_h *g,
epoch_str = get_rpm_header_tag (g, value, valuelen, RPMTAG_EPOCH, 'i'); epoch_str = get_rpm_header_tag (g, value, valuelen, RPMTAG_EPOCH, 'i');
arch = get_rpm_header_tag (g, value, valuelen, RPMTAG_ARCH, 's'); arch = get_rpm_header_tag (g, value, valuelen, RPMTAG_ARCH, 's');
url = get_rpm_header_tag (g, value, valuelen, RPMTAG_URL, 's'); url = get_rpm_header_tag (g, value, valuelen, RPMTAG_URL, 's');
@ -111,10 +111,10 @@ index f0cf16b38..fdea85188 100644
/* The epoch is stored as big-endian integer. */ /* The epoch is stored as big-endian integer. */
if (epoch_str) if (epoch_str)
diff --git a/test-data/phony-guests/fedora-packages.db.txt b/test-data/phony-guests/fedora-packages.db.txt Index: libguestfs-1.42.0/test-data/phony-guests/fedora-packages.db.txt
index f16a5aa76..927d6eb5f 100644 ===================================================================
--- a/test-data/phony-guests/fedora-packages.db.txt --- libguestfs-1.42.0.orig/test-data/phony-guests/fedora-packages.db.txt
+++ b/test-data/phony-guests/fedora-packages.db.txt +++ libguestfs-1.42.0/test-data/phony-guests/fedora-packages.db.txt
@@ -5,9 +5,9 @@ h_nelem=3 @@ -5,9 +5,9 @@ h_nelem=3
db_pagesize=4096 db_pagesize=4096
HEADER=END HEADER=END
@ -127,6 +127,3 @@ index f16a5aa76..927d6eb5f 100644
\03\00\00\00 \03\00\00\00
\00\00\00\03\00\00\00\11\00\00\03\e9\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\ea\00\00\00\00\00\00\00\04\00\00\00\00\00\00\03\fe\00\00\00\00\00\00\00\0b\00\00\00\003.0\003.fc14\00x86_64\00 \00\00\00\03\00\00\00\11\00\00\03\e9\00\00\00\00\00\00\00\00\00\00\00\00\00\00\03\ea\00\00\00\00\00\00\00\04\00\00\00\00\00\00\03\fe\00\00\00\00\00\00\00\0b\00\00\00\003.0\003.fc14\00x86_64\00
DATA=END DATA=END
--
2.16.1

View File

@ -1,28 +0,0 @@
From 0a55098f661457b3a4e17b8f5cdd7540d53aec32 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Thu, 22 Feb 2018 18:39:37 +0100
Subject: [PATCH] builder-repository: fix compute_short_id for sles X.0
It needs to check for the minor version, not major version.
Fixes commit a442d2c3217f709128f0e377f88649fb6ba90f45.
---
builder/repository_main.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builder/repository_main.ml b/builder/repository_main.ml
index bb440563b..9932fbae4 100644
--- a/builder/repository_main.ml
+++ b/builder/repository_main.ml
@@ -178,7 +178,7 @@ let compute_short_id distro major minor =
sprintf "%s%d" distro major
| ("fedora"|"mageia") ->
sprintf "%s%d" distro major
- | "sles" when major = 0 ->
+ | "sles" when minor = 0 ->
sprintf "%s%d" distro major
| "sles" ->
sprintf "%s%dsp%d" distro major minor
--
2.16.1

View File

@ -1,32 +0,0 @@
From 2e6b8af52042eadc0ca9f8cac3a8c384671e157b Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Fri, 30 Nov 2018 12:41:03 +0100
Subject: [PATCH 2/2] inspect: handle os-release "opensuse-tumbleweed" as
opensuse
Followup of commit 70407cd622dda6f088a0876e1e1ae669e9f8a281 for openSUSE
Thumbleweed.
(cherry picked from commit 28bd06227b1633fa08c073fe8dbe65d013d7dc9e)
Signed-off-by: Larry Dewey <ldewey@suse.com>
---
daemon/inspect_fs_unix.ml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml
index c0c0a75a4..b6a9af707 100644
--- a/daemon/inspect_fs_unix.ml
+++ b/daemon/inspect_fs_unix.ml
@@ -142,7 +142,8 @@ and distro_of_os_release_id = function
| "frugalware" -> Some DISTRO_FRUGALWARE
| "mageia" -> Some DISTRO_MAGEIA
| "neokylin" -> Some DISTRO_NEOKYLIN
- | "opensuse" | "opensuse-leap" -> Some DISTRO_OPENSUSE
+ | "opensuse" -> Some DISTRO_OPENSUSE
+ | s when String.is_prefix s "opensuse-" -> Some DISTRO_OPENSUSE
| "pld" -> Some DISTRO_PLD_LINUX
| "rhel" -> Some DISTRO_RHEL
| "sles" | "sled" -> Some DISTRO_SLES
--
2.21.0

View File

@ -0,0 +1,34 @@
Subject: po: Remove virt-v2v related dependency from POTFILES-ml.
From: Richard W.M. Jones rjones@redhat.com Mon Mar 9 17:31:55 2020 +0000
Date: Mon Mar 9 17:31:55 2020 +0000:
Git: 31e6b187100626cae44bcb505db153088245155c
Causes this error if you compile libguestfs 1.42.0 from the tarball
without invoking the generator:
make[4]: *** No rule to make target '../common/mlv2v/uefi.ml', needed by 'libguestfs.pot'. Stop.
diff --git a/Makefile.am b/Makefile.am
index 27f2c6eed..2f0446d60 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -345,6 +345,7 @@ po/POTFILES-ml: configure.ac
cd $(srcdir); \
find builder common/ml* customize dib get-kernel resize sparsify sysprep -name '*.ml' | \
grep -v '^builder/templates/' | \
+ grep -v '^common/mlv2v/' | \
grep -v -E '.*_tests\.ml$$' | \
LC_ALL=C sort > $@-t
mv $@-t $@
diff --git a/po/POTFILES-ml b/po/POTFILES-ml
index a9b6efdaa..2fbdff03d 100644
--- a/po/POTFILES-ml
+++ b/po/POTFILES-ml
@@ -41,7 +41,6 @@ common/mltools/urandom.ml
common/mltools/xpath_helpers.ml
common/mlutils/c_utils.ml
common/mlutils/unix_utils.ml
-common/mlv2v/uefi.ml
common/mlvisit/visit.ml
common/mlxml/xml.ml
customize/append_line.ml

View File

@ -1,101 +0,0 @@
Subject: v2v: linux: fix kernel detection when split in different packages
From: Pino Toscano ptoscano@redhat.com Tue May 22 10:46:21 2018 +0200
Date: Tue May 22 10:46:21 2018 +0200:
Git: 500acb15f8f777e9fe99a60c4216daf84a92aae3
The current detection code for Linux kernels assumes that a kernel
package contains everything in it, i.e. the kernel itself, its modules,
and its configuration. However, since recent Ubuntu versions (e.g.
starting from 18.04) modules & config (with few more files) are split in
an own package, thus not detecting the modpath from installed vmlinuz
files.
To overcome this situation, rework this detection a bit:
1) find the vmlinuz file as before, but then immediately make sure it
exists by stat'ing it
2) find the modules path from the package as before:
2a) if found, extract the version in the same step
2b) if not found, get the kernel version from the vmlinuz filename,
and use it to detect the modules path
3) check that the modules path exists
The detection done in (2b) is based on the current packaging scheme
found in the most important Linux distributions (Fedora, RHEL, CentOS,
Debian, Ubuntu, openSUSE, AltLinux, and possibly more). The notable
exception is Arch Linux.
As additional change, do not assume the config file is in the same
package as vmlinuz, but directly look into the filesystem using the
version we already have.
diff --git a/v2v/linux_kernels.ml b/v2v/linux_kernels.ml
index c047d6deb..24f61429d 100644
--- a/v2v/linux_kernels.ml
+++ b/v2v/linux_kernels.ml
@@ -103,27 +103,42 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
None
)
else (
- (* Which of these is the kernel itself? *)
+ (* Which of these is the kernel itself? Also, make sure to check
+ * it exists by stat'ing it.
+ *)
let vmlinuz = List.find (
fun filename -> String.is_prefix filename "/boot/vmlinuz-"
) files in
- (* Which of these is the modpath? *)
- let modpath = List.find (
- fun filename ->
- String.length filename >= 14 &&
- String.is_prefix filename "/lib/modules/"
- ) files in
-
- (* Check vmlinuz & modpath exist. *)
- if not (g#is_dir ~followsymlinks:true modpath) then
- raise Not_found;
let vmlinuz_stat =
try g#statns vmlinuz with G.Error _ -> raise Not_found in
- (* Get/construct the version. XXX Read this from kernel file. *)
- let version =
- let prefix_len = String.length "/lib/modules/" in
- String.sub modpath prefix_len (String.length modpath - prefix_len) in
+ (* Determine the modpath from the package, falling back to the
+ * version in the vmlinuz file name.
+ *)
+ let modpath, version =
+ let prefix = "/lib/modules/" in
+ try
+ let prefix_len = String.length prefix in
+ List.find_map (
+ fun filename ->
+ let filename_len = String.length filename in
+ if filename_len > prefix_len &&
+ String.is_prefix filename prefix then (
+ let version = String.sub filename prefix_len
+ (filename_len - prefix_len) in
+ Some (filename, version)
+ ) else
+ None
+ ) files
+ with Not_found ->
+ let version =
+ String.sub vmlinuz 14 (String.length vmlinuz - 14) in
+ let modpath = prefix ^ version in
+ modpath, version in
+
+ (* Check that the modpath exists. *)
+ if not (g#is_dir ~followsymlinks:true modpath) then
+ raise Not_found;
(* Find the initramfs which corresponds to the kernel.
* Since the initramfs is built at runtime, and doesn't have
@@ -188,7 +203,7 @@ let detect_kernels (g : G.guestfs) inspect family bootloader =
let config_file =
let cfg = "/boot/config-" ^ version in
- if List.mem cfg files then Some cfg
+ if g#is_file ~followsymlinks:true cfg then Some cfg
else None in
let kernel_supports what kconf =

View File

@ -1,28 +0,0 @@
From d22e678ba961b0b23376db2b290340700e1c2c9c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Mon, 1 Oct 2018 09:51:15 +0100
Subject: [PATCH 1/2] inspection: Parse os-release "opensuse-leap" as opensuse
(RHBZ#1634248).
(cherry picked from commit 70407cd622dda6f088a0876e1e1ae669e9f8a281)
Signed-off-by: Larry Dewey <ldewey@suse.com>
---
daemon/inspect_fs_unix.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/inspect_fs_unix.ml b/daemon/inspect_fs_unix.ml
index d0323af3f..c0c0a75a4 100644
--- a/daemon/inspect_fs_unix.ml
+++ b/daemon/inspect_fs_unix.ml
@@ -142,7 +142,7 @@ and distro_of_os_release_id = function
| "frugalware" -> Some DISTRO_FRUGALWARE
| "mageia" -> Some DISTRO_MAGEIA
| "neokylin" -> Some DISTRO_NEOKYLIN
- | "opensuse" -> Some DISTRO_OPENSUSE
+ | "opensuse" | "opensuse-leap" -> Some DISTRO_OPENSUSE
| "pld" -> Some DISTRO_PLD_LINUX
| "rhel" -> Some DISTRO_RHEL
| "sles" | "sled" -> Some DISTRO_SLES
--
2.21.0

View File

@ -0,0 +1,19 @@
Subject: lib: remove extra @LIBS@ from pkg-config file
From: Pino Toscano ptoscano@redhat.com Wed Mar 11 13:19:31 2020 +0100
Date: Thu Mar 12 11:45:30 2020 +0100:
Git: 7265f08ce99e592a63a9470afad2da95167a800c
At the moment it is empty, so probably it does not exist. Remove it to
avoid adding spurious content to the pkg-config file in case that
variable will get a value in the future.
diff --git a/lib/libguestfs.pc.in b/lib/libguestfs.pc.in
index 679ed7eba..013bf0f28 100644
--- a/lib/libguestfs.pc.in
+++ b/lib/libguestfs.pc.in
@@ -8,4 +8,4 @@ Version: @VERSION@
Description: libguestfs library for accessing and modifying VM images
Requires:
Cflags:
-Libs: -lguestfs @LIBS@
+Libs: -lguestfs

View File

@ -1,8 +1,8 @@
Index: libguestfs-1.38.0/appliance/init Index: libguestfs-1.42.0/appliance/init
=================================================================== ===================================================================
--- libguestfs-1.38.0.orig/appliance/init --- libguestfs-1.42.0.orig/appliance/init
+++ libguestfs-1.38.0/appliance/init +++ libguestfs-1.42.0/appliance/init
@@ -234,7 +234,8 @@ else @@ -245,7 +245,8 @@ else
echo "Note: The contents of / (root) are the rescue appliance." echo "Note: The contents of / (root) are the rescue appliance."
if ! test -d "/sysroot/dev"; then if ! test -d "/sysroot/dev"; then
echo "You have to mount the guests partitions under /sysroot" echo "You have to mount the guests partitions under /sysroot"

View File

@ -1,30 +0,0 @@
From d0e5a819e8b16b38c22cb7309e88bf49a6fdcc4a Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 9 Feb 2018 15:55:38 +0000
Subject: [PATCH] python: Fix missing & additional backslashes which broke
python sdist.
Fixes commit e6c89f96316c3eda6049d0c3ed4de4cda6f4f973.
---
python/Makefile.am | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/Makefile.am b/python/Makefile.am
index 5d2716e20..ef500d65d 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -101,9 +101,9 @@ stamp-extra-files: \
cleanups.h \
config.h \
guestfs-internal-all.h \
- guestfs-utils.h
+ guestfs-utils.h \
ignore-value.h \
- utils.c \
+ utils.c
touch $@
config.h:
--
2.15.1

View File

@ -1,31 +0,0 @@
From a4f65bf89d955f585f141fd3402e51eec53ba562 Mon Sep 17 00:00:00 2001
From: Sebastian Meyer <meyer@b1-systems.de>
Date: Thu, 23 Aug 2018 16:45:27 +0200
Subject: [PATCH 1/1] Fix error with --uninstall option on SUSE
The `-l` option for some `zypper` subcommands is short for
`--auto-agree-with-licenses` and not available on the `zypper rm` command.
(cherry picked from commit fd43730e2bfff17a365ffcf768b6c8db3089b524)
[BSC#1131342]
Signed-off-by: Larry Dewey <ldewey@suse.com>
---
customize/customize_run.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
index f92e9a199..3eacdaca0 100644
--- a/customize/customize_run.ml
+++ b/customize/customize_run.ml
@@ -181,7 +181,7 @@ exec >>%s 2>&1
| "urpmi" -> sprintf "urpme %s" quoted_args
| "xbps" -> sprintf "xbps-remove -Sy %s" quoted_args
| "yum" -> sprintf "yum -y remove %s" quoted_args
- | "zypper" -> sprintf "zypper -n rm -l %s" quoted_args
+ | "zypper" -> sprintf "zypper -n rm %s" quoted_args
| "unknown" ->
error_unknown_package_manager (s_"--uninstall")
--
2.21.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a31a1ab256ca3565569e31d7576e487b8d67a130b89e042a7faff4d154bcea31
size 23898136

3
libguestfs-1.42.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4fee192cf3aaa597f142afb21fa2d7f380fdabcf34d054e37090163e4a74f024
size 23614321

View File

@ -1,3 +1,49 @@
-------------------------------------------------------------------
Wed Apr 22 14:23:36 MDT 2020 - carnold@suse.com
- Update to version 1.42.0
* virt-v2v is moved out from libguestfs into its own package
* virt-p2v is moved out from libguestfs into its own package
* Add support for the Vala language
* Add support for the Rust language
* Reproducible builds
* Advanced Format disks (which use 4K sectors) can now be
processed by libguestfs. Use the new optional blocksize
parameter to guestfs_add_drive_opts, and the --blocksize option
added to several tools
* Windows CompactOS (NTFS file compression) is now supported.
* Advanced machine readable output in various virt tools now
supports JSON output, and writing logs to a numbered file
descriptor
* virt-filesystems tool now more accurately reports filesystem
total size, in the case where for example the filesystem does
not occupy the whole of its containing device
* Python ≥ 2.7 is required.
* Python bindings are now more extensively tested
* Python bindings should now work with Python ≥ 3.8.
* Multiple fixes to avoid crashes in the Python bindings
* OCaml bindings are compiled with -DCAML_NAME_SPACE to ensure no
non-caml_-namespaced symbols are used
* OCaml bindings should now work with OCaml 4.09 and 4.10.
* Fix compatibility with newer cgo for Go bindings
* Go API error handling is now more idiomatic
* Update documentation about how to handle boolean parameters in
Ruby bindings
* Libguestfs can now extract icons for Gentoo, newer SUSE and
OpenMandriva guests. Improved extraction of RHEL icons.
* Inspection returns the osinfo IDs of newer Windows versions,
and rolling Linux distros
- Added patches
31e6b187-po-Remove-virt-v2v-related-dependency-from-POTFILES-ml..patch
7265f08c-lib-remove-extra-LIBS-from-pkg-config-file.patch
- Patches dropped
0a55098f-builder-repository-fix-compute_short_id-for-sles-X.0.patch
28bd06227b-inspect-handle-os-release-opensuse-tumbleweed-as-ope.patch
500acb15-v2v-linux-fix-kernel-detection-when-split-in-different-packages.patch
70407cd622-inspection-Parse-os-release-opensuse-leap-as-opensus.patch
d0e5a819-python-Fix-missing-additional-backslashes.patch
fd43730e-error-with-uninstall-option-on-SUSE.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Mar 19 10:25:01 MDT 2020 - carnold@suse.com Thu Mar 19 10:25:01 MDT 2020 - carnold@suse.com

View File

@ -18,7 +18,7 @@
# needsbinariesforbuild # needsbinariesforbuild
Version: 1.38.0 Version: 1.42.0
Release: 0 Release: 0
%{ocaml_preserve_bytecode} %{ocaml_preserve_bytecode}
@ -99,6 +99,7 @@ BuildRequires: perl(Module::Build)
%endif %endif
BuildRequires: db48-utils BuildRequires: db48-utils
BuildRequires: dhcp-client BuildRequires: dhcp-client
BuildRequires: libjansson-devel
BuildRequires: pcre-devel BuildRequires: pcre-devel
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: qemu-tools BuildRequires: qemu-tools
@ -142,12 +143,8 @@ Summary: Compatibility package for guestfs-tools
# Upstream patches # Upstream patches
License: GPL-2.0-only License: GPL-2.0-only
Group: System/Filesystems Group: System/Filesystems
Patch0: d0e5a819-python-Fix-missing-additional-backslashes.patch Patch1: 31e6b187-po-Remove-virt-v2v-related-dependency-from-POTFILES-ml..patch
Patch1: 0a55098f-builder-repository-fix-compute_short_id-for-sles-X.0.patch Patch2: 7265f08c-lib-remove-extra-LIBS-from-pkg-config-file.patch
Patch2: fd43730e-error-with-uninstall-option-on-SUSE.patch
Patch3: 70407cd622-inspection-Parse-os-release-opensuse-leap-as-opensus.patch
Patch4: 28bd06227b-inspect-handle-os-release-opensuse-tumbleweed-as-ope.patch
Patch5: 500acb15-v2v-linux-fix-kernel-detection-when-split-in-different-packages.patch
# Pending upstram review # Pending upstram review
Patch50: 0001-Introduce-a-wrapper-around-xmlParseURI.patch Patch50: 0001-Introduce-a-wrapper-around-xmlParseURI.patch
@ -157,8 +154,8 @@ Patch52: 0003-inspector-rpm-summary-and-description-may-not-be-utf.patch
Patch100: appliance.patch Patch100: appliance.patch
Patch101: netconfig.patch Patch101: netconfig.patch
Source0: http://download.libguestfs.org/1.38-stable/libguestfs-%{version}.tar.gz Source0: http://download.libguestfs.org/1.42-stable/libguestfs-%{version}.tar.gz
Source1: libguestfs.rpmlintrc Source3: libguestfs.rpmlintrc
Source100: mount-rootfs-and-chroot.sh Source100: mount-rootfs-and-chroot.sh
Source101: README Source101: README
Source789653: Pod-Simple-3.23.tar.xz Source789653: Pod-Simple-3.23.tar.xz
@ -563,12 +560,8 @@ It can import a variety of guest operating systems from libvirt-managed hosts.
%prep %prep
: _ignore_exclusive_arch '%{?_ignore_exclusive_arch}' : _ignore_exclusive_arch '%{?_ignore_exclusive_arch}'
%setup -q -a 789653 %setup -q -a 789653
%patch0 -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch50 -p1 %patch50 -p1
%patch51 -p1 %patch51 -p1
%patch52 -p1 %patch52 -p1
@ -843,40 +836,14 @@ rm %{buildroot}/%{_datadir}/virt-p2v/p2v.ks.in
%license COPYING %license COPYING
%{_sbindir}/libguestfs-make-fixed-appliance %{_sbindir}/libguestfs-make-fixed-appliance
%{_bindir}/* %{_bindir}/*
%exclude %{_bindir}/virt-v2v
%if %{with p2v}
%exclude %{_bindir}/virt-p2v-*
%endif
/etc/virt-builder /etc/virt-builder
%dir /etc/xdg/virt-builder %dir /etc/xdg/virt-builder
%dir /etc/xdg/virt-builder/repos.d %dir /etc/xdg/virt-builder/repos.d
%config /etc/xdg/virt-builder/repos.d/* %config /etc/xdg/virt-builder/repos.d/*
%if %{with bash_completion} %if %{with bash_completion}
%{_datadir}/bash-completion %{_datadir}/bash-completion
%exclude %{_datadir}/bash-completion/*/virt-v2v
%endif %endif
%{_mandir}/man1/* %{_mandir}/man1/*
%exclude %{_mandir}/man1/virt-v2v.*
%if %{with p2v}
%exclude %{_mandir}/man1/virt-p2v*
%endif
%{_mandir}/man5/* %{_mandir}/man5/*
%files -n virt-v2v
%defattr(-,root,root)
%{_bindir}/virt-v2v
%{_datadir}/bash-completion/*/virt-v2v
%{_mandir}/man1/virt-v2v.*
%if %{with p2v}
%files -n virt-p2v
%defattr(-,root,root)
%{_libdir}/virt-p2v
%{_datadir}/virt-p2v
%{_bindir}/virt-p2v-make-kiwi
%{_bindir}/virt-p2v-make-disk
%{_mandir}/man1/virt-p2v-make-kiwi*
%{_mandir}/man1/virt-p2v-make-disk*
%endif
%changelog %changelog

View File

@ -1,7 +1,8 @@
diff -up ./appliance/packagelist.in.netconfig ./appliance/packagelist.in Index: libguestfs-1.42.0/appliance/packagelist.in
--- ./appliance/packagelist.in.netconfig 2019-08-28 19:26:50.290462768 +0100 ===================================================================
+++ ./appliance/packagelist.in 2019-08-28 19:27:05.530462557 +0100 --- libguestfs-1.42.0.orig/appliance/packagelist.in
@@ -161,6 +161,7 @@ ifelse(SUSE,1, +++ libguestfs-1.42.0/appliance/packagelist.in
@@ -164,6 +164,7 @@ ifelse(SUSE,1,
ntfs-3g ntfs-3g
reiserfs reiserfs
squashfs squashfs