Re: [Libguestfs] [PATCH v2] v2v: docs: VDSM location of virt-v2v log file.

2017-07-07 Thread Richard W.M. Jones

Ignore this one, v3 just sent.

-- 
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

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


Re: [Libguestfs] [PATCH v7 2/9] lib: extract osinfo DB traversing API

2017-07-07 Thread Pino Toscano
On Monday, 19 June 2017 10:48:30 CEST Cédric Bosdonnat wrote:
> Split lib/osinfo.c to provide an API for other pieces of code (namely
> mllib) to reuse it. The ISO-related processing is thus moved into a
> lib/osinfo-iso.c file.
> ---

This (and patch #3) conflict with Rich's patch to deprecate the
inspection of ISO images. So we should decide what is the fate of this
code:
a) move the C code as-is to virt-builder
b) apply this (and following) patch to make it a bit more general
c) write the osinfo-db code in OCaml, directly in virt-builder
d) any other solution I missed above

-- 
Pino Toscano

signature.asc
Description: This is a digitally signed message part.
___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH v2] v2v: docs: VDSM location of virt-v2v log file.

2017-07-07 Thread Richard W.M. Jones
See this bug for background information:
https://bugzilla.redhat.com/show_bug.cgi?id=1350465

Thanks: Tomáš Golembiovský
---
 v2v/virt-v2v.pod | 38 ++
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
index e68d75cf8..0943bf305 100644
--- a/v2v/virt-v2v.pod
+++ b/v2v/virt-v2v.pod
@@ -1909,18 +1909,32 @@ that guest through the RHV-M UI, you may encounter an 
import failure.
 Diagnosing these failures is infuriatingly difficult as the UI
 generally hides the true reason for the failure.
 
-There are two log files of interest.  The first is stored on the
-RHV-M server itself, and is called
-F
-
-The second file, which is the most useful, is found on the SPM host
-(SPM stands for "Storage Pool Manager").  This is a RHV node that is
-elected to do all metadata modifications in the data center, such as
-image or snapshot creation.  You can find out which host is the
-current SPM from the "Hosts" tab "Spm Status" column.  Once you have
-located the SPM, log into it and grab the file
-F which will contain detailed error messages
-from low-level commands.
+There are three log files of interest:
+
+=over 4
+
+=item F
+
+In oVirt E 4.1.0, vdsm preserves the virt-v2v log file for
+30 days in this directory.
+
+This directory is found on the host which performed the conversion.
+The host can be selected in the import dialog, or can be found under
+the C tab in oVirt administration.
+
+=item F
+
+As above, this file is present on the host which performed the
+conversion.  It contains detailed error messages from low-level
+operations executed by VDSM, and is useful if the error was not caused
+by virt-v2v, but by VDSM.
+
+=item F
+
+This log file is stored on the RHV-M server.  It contains more detail
+for any errors caused by the oVirt GUI.
+
+=back
 
 =head1 MINIMAL XML FOR -i libvirtxml OPTION
 
-- 
2.13.2

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] v2v: docs: VDSM location of virt-v2v log file.

2017-07-07 Thread Tomáš Golembiovský
Hi,

On Fri,  7 Jul 2017 13:00:22 +0100
"Richard W.M. Jones"  wrote:

> See this bug for background information:
> https://bugzilla.redhat.com/show_bug.cgi?id=1350465
> ---
>  v2v/virt-v2v.pod | 39 +++
>  1 file changed, 27 insertions(+), 12 deletions(-)
> 
> diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
> index e68d75cf8..93d1a9ecd 100644
> --- a/v2v/virt-v2v.pod
> +++ b/v2v/virt-v2v.pod
> @@ -1909,18 +1909,33 @@ that guest through the RHV-M UI, you may encounter an 
> import failure.
>  Diagnosing these failures is infuriatingly difficult as the UI
>  generally hides the true reason for the failure.
>  
> -There are two log files of interest.  The first is stored on the
> -RHV-M server itself, and is called
> -F
> -
> -The second file, which is the most useful, is found on the SPM host
> -(SPM stands for "Storage Pool Manager").  This is a RHV node that is
> -elected to do all metadata modifications in the data center, such as
> -image or snapshot creation.  You can find out which host is the
> -current SPM from the "Hosts" tab "Spm Status" column.  Once you have
> -located the SPM, log into it and grab the file
> -F which will contain detailed error messages
> -from low-level commands.
> +There are three log files of interest:
> +
> +=over 4
> +
> +=item F
> +
> +In oVirt E 4.1.0, vdsm preserves the virt-v2v log file for
> +30 days in this directory.
> +
> +This directory is found on the SPM host (SPM stands for "Storage Pool
> +Manager").  This is a RHV node that is elected to do all metadata
> +modifications in the data center, such as image or snapshot creation.
> +You can find out which host is the current SPM from the "Hosts" tab
> +"Spm Status" column.

This is not correct. The logs are stored on the host performing the
conversion. This is completely unrelated to the SPM role and which host
it is can be even specified by the user in the import dialog. Maybe the
default host (unless changed by the user) is the same as the SPM host,
but that would have to be checked and even than I would refrain from
mentioning it in the docs. Which host is performing the conversion can
be checked under 'Events' tab in the oVirt administration.


> +=item F
> +
> +As above, this file is present on the SPM host.  It contains detailed
> +error messages from low-level operations executed by VDSM, and is
> +useful if the error was not caused by virt-v2v, but by VDSM or the

Same as above. These two logs are on the same machine.

Actually it can get little bit complex and two VDSM hosts can be
involved. But I don't think we should complicate the matters here.


> +oVirt GUI.

These errors would be in the engine.log mentioned below.

Tomas

> +
> +=item F
> +
> +This log file is stored on the RHV-M server.
> +
> +=back
>  
>  =head1 MINIMAL XML FOR -i libvirtxml OPTION
>  
> -- 
> 2.13.2
> 
> ___
> Libguestfs mailing list
> Libguestfs@redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs


-- 
Tomáš Golembiovský 

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] v2v: docs: VDSM location of virt-v2v log file.

2017-07-07 Thread Pino Toscano
On Friday, 7 July 2017 14:00:22 CEST Richard W.M. Jones wrote:
> See this bug for background information:
> https://bugzilla.redhat.com/show_bug.cgi?id=1350465
> ---
>  v2v/virt-v2v.pod | 39 +++
>  1 file changed, 27 insertions(+), 12 deletions(-)
> 
> diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
> index e68d75cf8..93d1a9ecd 100644
> --- a/v2v/virt-v2v.pod
> +++ b/v2v/virt-v2v.pod
> @@ -1909,18 +1909,33 @@ that guest through the RHV-M UI, you may encounter an 
> import failure.
>  Diagnosing these failures is infuriatingly difficult as the UI
>  generally hides the true reason for the failure.
>  
> -There are two log files of interest.  The first is stored on the
> -RHV-M server itself, and is called
> -F
> -
> -The second file, which is the most useful, is found on the SPM host
> -(SPM stands for "Storage Pool Manager").  This is a RHV node that is
> -elected to do all metadata modifications in the data center, such as
> -image or snapshot creation.  You can find out which host is the
> -current SPM from the "Hosts" tab "Spm Status" column.  Once you have
> -located the SPM, log into it and grab the file
> -F which will contain detailed error messages
> -from low-level commands.
> +There are three log files of interest:

Since the first is actually a directory with logs, what about something
like "there are different log files of interest"? (so there is no need
to change the number, in case more files/places are added later on)

> +
> +=over 4
> +
> +=item F
> +
> +In oVirt E 4.1.0, vdsm preserves the virt-v2v log file for
> +30 days in this directory.

s/vdsm/VDSM/?

> +
> +This directory is found on the SPM host (SPM stands for "Storage Pool
> +Manager").  This is a RHV node that is elected to do all metadata
> +modifications in the data center, such as image or snapshot creation.
> +You can find out which host is the current SPM from the "Hosts" tab
> +"Spm Status" column.

Hmm, "in the "Host" tab, "Spm Status" column"?

LGTM otherwise.

Thanks,
-- 
Pino Toscano

signature.asc
Description: This is a digitally signed message part.
___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

2017-07-07 Thread Tomáš Golembiovský
Hi,

this is different from the original problem. The original description
had "" whereas the BZ addresses "" which is not supported at all.

Tomas

On Fri, 7 Jul 2017 13:02:45 +0100
"Richard W.M. Jones"  wrote:

> On Fri, Jul 07, 2017 at 01:31:38PM +0200, Tomáš Golembiovský wrote:
> > Hi,
> > 
> > yes it is an issue in VDSM. We count on the disks being in storage pool
> > (except for block devices).
> > 
> > Can you open a BZ bug for that please.  
> 
> Is this the same thing?
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1468509
> 
> 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


-- 
Tomáš Golembiovský 

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

2017-07-07 Thread Richard W.M. Jones
On Fri, Jul 07, 2017 at 01:31:38PM +0200, Tomáš Golembiovský wrote:
> Hi,
> 
> yes it is an issue in VDSM. We count on the disks being in storage pool
> (except for block devices).
> 
> Can you open a BZ bug for that please.

Is this the same thing?

https://bugzilla.redhat.com/show_bug.cgi?id=1468509

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

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH] v2v: docs: VDSM location of virt-v2v log file.

2017-07-07 Thread Richard W.M. Jones
See this bug for background information:
https://bugzilla.redhat.com/show_bug.cgi?id=1350465
---
 v2v/virt-v2v.pod | 39 +++
 1 file changed, 27 insertions(+), 12 deletions(-)

diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
index e68d75cf8..93d1a9ecd 100644
--- a/v2v/virt-v2v.pod
+++ b/v2v/virt-v2v.pod
@@ -1909,18 +1909,33 @@ that guest through the RHV-M UI, you may encounter an 
import failure.
 Diagnosing these failures is infuriatingly difficult as the UI
 generally hides the true reason for the failure.
 
-There are two log files of interest.  The first is stored on the
-RHV-M server itself, and is called
-F
-
-The second file, which is the most useful, is found on the SPM host
-(SPM stands for "Storage Pool Manager").  This is a RHV node that is
-elected to do all metadata modifications in the data center, such as
-image or snapshot creation.  You can find out which host is the
-current SPM from the "Hosts" tab "Spm Status" column.  Once you have
-located the SPM, log into it and grab the file
-F which will contain detailed error messages
-from low-level commands.
+There are three log files of interest:
+
+=over 4
+
+=item F
+
+In oVirt E 4.1.0, vdsm preserves the virt-v2v log file for
+30 days in this directory.
+
+This directory is found on the SPM host (SPM stands for "Storage Pool
+Manager").  This is a RHV node that is elected to do all metadata
+modifications in the data center, such as image or snapshot creation.
+You can find out which host is the current SPM from the "Hosts" tab
+"Spm Status" column.
+
+=item F
+
+As above, this file is present on the SPM host.  It contains detailed
+error messages from low-level operations executed by VDSM, and is
+useful if the error was not caused by virt-v2v, but by VDSM or the
+oVirt GUI.
+
+=item F
+
+This log file is stored on the RHV-M server.
+
+=back
 
 =head1 MINIMAL XML FOR -i libvirtxml OPTION
 
-- 
2.13.2

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

2017-07-07 Thread Matthias Leopold

thanks for caring about this.

Ming Xie, are you opening this BZ bug?

thanks
matthias

Am 2017-07-07 um 13:31 schrieb Tomáš Golembiovský:

Hi,

yes it is an issue in VDSM. We count on the disks being in storage pool
(except for block devices).

Can you open a BZ bug for that please.

Thanks,

 Tomas


On Fri, 7 Jul 2017 02:52:26 -0400 (EDT)
Ming Xie  wrote:


I could reproduce customer's problem

Packages:
rhv:4.1.3-0.1.el7
vdsm-4.19.20-1.el7ev.x86_64
virt-v2v-1.36.3-6.el7.x86_64
libguestfs-1.36.3-6.el7.x86_64

Steps:
1.Prepare a guest which is not listed storage pool
# virsh dumpxml avocado-vt-vm1


   
   
   
   
 
.
2.Try to import this guest in rhv4.1 from KVM host but failed to import the 
guest as screenshot and get error info from vdsm.log

2017-07-07 14:41:22,176+0800 ERROR (jsonrpc/6) [root] Error getting disk size 
(v2v:1089)
Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1078, in 
_get_disk_info
 vol = conn.storageVolLookupByPath(disk['alias'])
   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4555, in 
storageVolLookupByPath
 if ret is None:raise libvirtError('virStorageVolLookupByPath() failed', 
conn=self)
libvirtError: Storage volume not found: no storage vol with matching path 
'/root/RHEL-7.3-x86_64-latest.qcow2'



3.Try to convert this guest to rhv by virt-v2v on v2v conversion server,could 
import the guest from export domain to data domain on rhv4.1 after finishing 
conversion
# virt-v2v avocado-vt-vm1 -o rhv -os 10.73.131.93:/home/nfs_export
[   0.0] Opening the source -i libvirt avocado-vt-vm1
[   0.0] Creating an overlay to protect the source from being modified
[   0.4] Initializing the target -o rhv -os 10.73.131.93:/home/nfs_export
[   0.7] Opening the overlay
[   6.1] Inspecting the overlay
[  13.8] Checking for sufficient free disk space in the guest
[  13.8] Estimating space required on target for each disk
[  13.8] Converting Red Hat Enterprise Linux Server 7.3 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  52.2] Mapping filesystem data to avoid copying unused and blank areas
[  52.4] Closing the overlay
[  52.7] Checking if the guest needs BIOS or UEFI to boot
[  52.7] Assigning disks to buses
[  52.7] Copying disk 1/1 to 
/tmp/v2v.Zzc4KD/c9cfeba7-73f8-428a-aa77-9a2a1acf0063/images/c8eb039e-3007-4e08-9580-c49da8b73d55/f76d16ea-5e66-4987-a496-8f378b127986
 (qcow2)
 (100.00/100%)
[ 152.4] Creating output metadata
[ 152.6] Finishing off


Result:
So this problem is caused by vdsm or ovirt

Regards
Ming Xie

- Original Message -
From: "Richard W.M. Jones" 
To: "Matthias Leopold" 
Cc: us...@ovirt.org, libguestfs@redhat.com
Sent: Wednesday, July 5, 2017 9:15:16 PM
Subject: Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

On Wed, Jul 05, 2017 at 11:14:09AM +0200, Matthias Leopold wrote:

hi,

i'm trying to import a VM in oVirt from a KVM host that doesn't use
storage pools. this fails with the following message in
/var/log/vdsm/vdsm.log:

2017-07-05 09:34:20,513+0200 ERROR (jsonrpc/5) [root] Error getting
disk size (v2v:1089)
Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1078, in
_get_disk_info
 vol = conn.storageVolLookupByPath(disk['alias'])
   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4770,
in storageVolLookupByPath
 if ret is None:raise libvirtError('virStorageVolLookupByPath()
failed', conn=self)
libvirtError: Storage volume not found: no storage vol with matching path

the disks in the origin VM are defined as

 
   
   

 
   
   

is this a virt-v2v or oVirt problem?


Well the stack trace is in the oVirt code, so I guess it's an oVirt
problem.  Adding ovirt-users mailing list.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs





--
Matthias Leopold
IT Systems & Communications
Medizinische Universität Wien
Spitalgasse 23 / BT 88 /Ebene 00
A-1090 Wien
Tel: +43 1 40160-21241
Fax: +43 1 40160-921200

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH v6 2/3] gobject: Remove gtk-doc (RHBZ#1465665).

2017-07-07 Thread Richard W.M. Jones
The gobject bindings are adequately covered in the usual manual pages:
guestfs(3).  There is no need for separate generation of gtk-doc.
Also generating gtk documentation is the slowest part of the build,
and the tooling around gtk-doc is broken
(https://bugzilla.redhat.com/show_bug.cgi?id=1465665).

Note this removes the configure ‘--enable-gtk-doc’ option.  Using this
option now gives a warning, but is otherwise ignored:

  configure: WARNING: unrecognized options: --enable-gtk-doc
---
 Makefile.am   |   2 +-
 configure.ac  |   2 -
 generator/GObject.ml  |  18 ---
 generator/GObject.mli |   1 -
 generator/main.ml |   2 -
 gobject/Makefile.am   |   3 -
 gobject/docs/.gitignore   |  26 
 gobject/docs/Makefile.am  | 115 
 gobject/docs/gtk-doc.make | 280 --
 gobject/docs/guestfs-docs.sgml.in |  34 -
 m4/gtk-doc.m4 |  67 -
 m4/guestfs_gobject.m4 |   7 -
 12 files changed, 1 insertion(+), 556 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fb77c9e9d..2dc704500 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -332,7 +332,7 @@ po/POTFILES: configure.ac
rm -f $@ $@-t
cd $(srcdir); \
find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
-   grep -v -E 
'^(examples|gnulib|gobject/docs|perl/(blib|examples)|po-docs|tests|test-data)/' 
| \
+   grep -v -E 
'^(examples|gnulib|perl/(blib|examples)|po-docs|tests|test-data)/' | \
grep -v -E '/((guestfs|rc)_protocol\.c)$$' | \
grep -v -E '^python/utils\.c$$' | \
grep -v -E '^perl/lib/Sys/Guestfs\.c$$' | \
diff --git a/configure.ac b/configure.ac
index 293e0d3ec..dd2a4d7f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,8 +224,6 @@ AC_CONFIG_FILES([Makefile
  gnulib/tests/Makefile
  gobject/libguestfs-gobject-1.0.pc
  gobject/Makefile
- gobject/docs/Makefile
- gobject/docs/guestfs-docs.sgml
  golang/Makefile
  golang/examples/Makefile
  haskell/Makefile
diff --git a/generator/GObject.ml b/generator/GObject.ml
index bb95b170c..b2d67d926 100644
--- a/generator/GObject.ml
+++ b/generator/GObject.ml
@@ -185,24 +185,6 @@ let generate_gobject_header () =
 (function f -> pr "#include \n" f)
 filenames
 
-let generate_gobject_doc_title () =
-  pr
-"
-http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\;
-[
-  http://www.w3.org/2003/XInclude'\">
-]>
-
-  Libguestfs GObject Bindings
-";
-
-  List.iter (
-function n -> pr "  \n" n
-  ) filenames;
-
-  pr "\n"
-
 let generate_gobject_struct_header filename typ cols () =
   header_start filename;
 
diff --git a/generator/GObject.mli b/generator/GObject.mli
index b4d0ea696..a23a4b6ad 100644
--- a/generator/GObject.mli
+++ b/generator/GObject.mli
@@ -16,7 +16,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *)
 
-val generate_gobject_doc_title : unit -> unit
 val generate_gobject_header : unit -> unit
 val generate_gobject_makefile : unit -> unit
 val generate_gobject_optargs_header : string -> string -> Types.action -> unit 
-> unit
diff --git a/generator/main.ml b/generator/main.ml
index d4316c085..cfea3f55a 100644
--- a/generator/main.ml
+++ b/generator/main.ml
@@ -283,8 +283,6 @@ Run it from the top source directory using the command
 GObject.generate_gobject_makefile;
   output_to "gobject/include/guestfs-gobject.h"
 GObject.generate_gobject_header;
-  output_to "gobject/docs/guestfs-title.sgml"
-GObject.generate_gobject_doc_title;
   List.iter (
 fun { s_name = typ; s_cols = cols } ->
   let short = sprintf "struct-%s" typ in
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 1c7750cb1..677d7a3d2 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -15,8 +15,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-SUBDIRS = . docs
-
 include $(top_srcdir)/subdir-rules.mk
 
 include $(srcdir)/Makefile.inc
@@ -33,7 +31,6 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
-   docs/.gitignore \
tests-misc.js \
run-tests \
run-tests-retvalues \
diff --git a/gobject/docs/.gitignore b/gobject/docs/.gitignore
deleted file mode 100644
index e91957f54..0
--- a/gobject/docs/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-/guestfs.args
-/guestfs-decl-list.txt
-/guestfs-decl.txt
-/guestfs-docs.sgml
-/guestfs.hierarchy
-/guestfs.interfaces
-/guestfs-overrides.txt
-/guestfs.prerequisites
-/guestfs-sections.txt
-/guestfs.signals
-/guestfs-title.sgml
-/guestfs.types
-/guestfs-undeclared.txt
-/guestfs-undocumented.txt
-/guestfs-unused.txt
-/html/

[Libguestfs] [PATCH v6 0/3] gobject: Remove gtk-doc (RHBZ#1465665).

2017-07-07 Thread Richard W.M. Jones
Hopefully this time ...

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v6 3/3] gobject: Add outline guestfs-gobject(3) manual page.

2017-07-07 Thread Richard W.M. Jones
Since we removed gtk doc, we might as well replace it with a
manual page explaining the basics of how to run gjs.
---
 .gitignore |  2 ++
 docs/guestfs-recipes.pod   |  1 +
 erlang/examples/guestfs-erlang.pod |  1 +
 gobject/Makefile.am| 19 +++
 gobject/guestfs-gobject.pod| 64 ++
 golang/examples/guestfs-golang.pod |  1 +
 java/examples/guestfs-java.pod |  1 +
 lib/guestfs.pod|  5 ++-
 lua/examples/guestfs-lua.pod   |  1 +
 ocaml/examples/guestfs-ocaml.pod   |  1 +
 perl/examples/guestfs-perl.pod |  1 +
 python/examples/guestfs-python.pod |  1 +
 ruby/examples/guestfs-ruby.pod |  1 +
 13 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 7ccc928bb..774043501 100644
--- a/.gitignore
+++ b/.gitignore
@@ -283,6 +283,8 @@ Makefile.in
 /gobject/bindtests.js
 /gobject/Guestfs-1.0.gir
 /gobject/Guestfs-1.0.typelib
+/gobject/guestfs-gobject.3
+/gobject/stamp-guestfs-gobject.pod
 /golang/bindtests.go
 /golang/examples/guestfs-golang.3
 /golang/examples/stamp-guestfs-golang.pod
diff --git a/docs/guestfs-recipes.pod b/docs/guestfs-recipes.pod
index 7d772b8f2..11eb96ad7 100644
--- a/docs/guestfs-recipes.pod
+++ b/docs/guestfs-recipes.pod
@@ -722,6 +722,7 @@ L,
 L,
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/erlang/examples/guestfs-erlang.pod 
b/erlang/examples/guestfs-erlang.pod
index 89cbda15b..2f03b8281 100644
--- a/erlang/examples/guestfs-erlang.pod
+++ b/erlang/examples/guestfs-erlang.pod
@@ -96,6 +96,7 @@ C is the name of the unknown argument.
 
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 677d7a3d2..ddedd5b51 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -31,6 +31,7 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
+   guestfs-gobject.pod \
tests-misc.js \
run-tests \
run-tests-retvalues \
@@ -88,6 +89,8 @@ gir_DATA = $(INTROSPECTION_GIRS)
 typelibdir = $(libdir)/girepository-1.0
 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
+# Tests.
+
 TESTS = \
run-tests \
run-tests-retvalues
@@ -103,3 +106,19 @@ $(TESTS): $(typelib_DATA)
 CLEANFILES += $(gir_DATA) $(typelib_DATA)
 
 endif HAVE_INTROSPECTION
+
+# Documentation.
+
+man_MANS = guestfs-gobject.3
+noinst_DATA = $(top_builddir)/website/guestfs-gobject.3.html
+
+guestfs-gobject.3 $(top_builddir)/website/guestfs-gobject.3.html: 
stamp-guestfs-gobject.pod
+
+stamp-guestfs-gobject.pod: guestfs-gobject.pod
+   $(PODWRAPPER) \
+ --section 3 \
+ --man guestfs-gobject.3 \
+ --html $(top_builddir)/website/guestfs-gobject.3.html \
+ --license examples \
+ $<
+   touch $@
diff --git a/gobject/guestfs-gobject.pod b/gobject/guestfs-gobject.pod
new file mode 100644
index 0..c0c6839fb
--- /dev/null
+++ b/gobject/guestfs-gobject.pod
@@ -0,0 +1,64 @@
+=head1 NAME
+
+guestfs-gobject - How to use libguestfs with the GObject bindings
+
+=head1 SYNOPSIS
+
+From Javascript using gjs:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+=head1 DESCRIPTION
+
+This manual page documents how to call libguestfs using GObject
+bindings, especially from Javascript.
+
+Note that the GObject bindings have problems handling 64 bit values.
+You should not use the GObject bindings if there are native bindings
+for your language.  For example, to use libguestfs from Python you are
+strongly advised to use the Python native bindings instead (see
+L).
+
+This page just documents the differences from the C API and gives some
+examples.  If you are not familiar with using libguestfs, you also
+need to read L.
+
+=head1 JAVASCRIPT
+
+Using gjs, you can write a C<.js> file containing:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+and then run it using:
+
+ gjs program.js
+
+=head1 SEE ALSO
+
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L.
+
+=head1 AUTHORS
+
+Richard W.M. Jones (C)
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012-2017 Red Hat Inc.
diff --git a/golang/examples/guestfs-golang.pod 
b/golang/examples/guestfs-golang.pod
index c2de45ece..7b9c80ab4 100644
--- a/golang/examples/guestfs-golang.pod
+++ b/golang/examples/guestfs-golang.pod
@@ -78,6 +78,7 @@ UUIDs are not returned in structures.
 

Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

2017-07-07 Thread Tomáš Golembiovský
Hi,

yes it is an issue in VDSM. We count on the disks being in storage pool
(except for block devices).

Can you open a BZ bug for that please.

Thanks,

Tomas


On Fri, 7 Jul 2017 02:52:26 -0400 (EDT)
Ming Xie  wrote:

> I could reproduce customer's problem
> 
> Packages:
> rhv:4.1.3-0.1.el7
> vdsm-4.19.20-1.el7ev.x86_64
> virt-v2v-1.36.3-6.el7.x86_64
> libguestfs-1.36.3-6.el7.x86_64
> 
> Steps:
> 1.Prepare a guest which is not listed storage pool
> # virsh dumpxml avocado-vt-vm1
> 
>
>   
>   
>   
>function='0x0'/>
> 
> .
> 2.Try to import this guest in rhv4.1 from KVM host but failed to import the 
> guest as screenshot and get error info from vdsm.log
> 
> 2017-07-07 14:41:22,176+0800 ERROR (jsonrpc/6) [root] Error getting disk size 
> (v2v:1089)
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1078, in 
> _get_disk_info
> vol = conn.storageVolLookupByPath(disk['alias'])
>   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4555, in 
> storageVolLookupByPath
> if ret is None:raise libvirtError('virStorageVolLookupByPath() failed', 
> conn=self)
> libvirtError: Storage volume not found: no storage vol with matching path 
> '/root/RHEL-7.3-x86_64-latest.qcow2'
> 
> 
> 
> 3.Try to convert this guest to rhv by virt-v2v on v2v conversion server,could 
> import the guest from export domain to data domain on rhv4.1 after finishing 
> conversion
> # virt-v2v avocado-vt-vm1 -o rhv -os 10.73.131.93:/home/nfs_export
> [   0.0] Opening the source -i libvirt avocado-vt-vm1
> [   0.0] Creating an overlay to protect the source from being modified
> [   0.4] Initializing the target -o rhv -os 10.73.131.93:/home/nfs_export
> [   0.7] Opening the overlay
> [   6.1] Inspecting the overlay
> [  13.8] Checking for sufficient free disk space in the guest
> [  13.8] Estimating space required on target for each disk
> [  13.8] Converting Red Hat Enterprise Linux Server 7.3 (Maipo) to run on KVM
> virt-v2v: This guest has virtio drivers installed.
> [  52.2] Mapping filesystem data to avoid copying unused and blank areas
> [  52.4] Closing the overlay
> [  52.7] Checking if the guest needs BIOS or UEFI to boot
> [  52.7] Assigning disks to buses
> [  52.7] Copying disk 1/1 to 
> /tmp/v2v.Zzc4KD/c9cfeba7-73f8-428a-aa77-9a2a1acf0063/images/c8eb039e-3007-4e08-9580-c49da8b73d55/f76d16ea-5e66-4987-a496-8f378b127986
>  (qcow2)
> (100.00/100%)
> [ 152.4] Creating output metadata
> [ 152.6] Finishing off
> 
> 
> Result:
> So this problem is caused by vdsm or ovirt
> 
> Regards
> Ming Xie
> 
> - Original Message -
> From: "Richard W.M. Jones" 
> To: "Matthias Leopold" 
> Cc: us...@ovirt.org, libguestfs@redhat.com
> Sent: Wednesday, July 5, 2017 9:15:16 PM
> Subject: Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?
> 
> On Wed, Jul 05, 2017 at 11:14:09AM +0200, Matthias Leopold wrote:
> > hi,
> > 
> > i'm trying to import a VM in oVirt from a KVM host that doesn't use
> > storage pools. this fails with the following message in
> > /var/log/vdsm/vdsm.log:
> > 
> > 2017-07-05 09:34:20,513+0200 ERROR (jsonrpc/5) [root] Error getting
> > disk size (v2v:1089)
> > Traceback (most recent call last):
> >   File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1078, in
> > _get_disk_info
> > vol = conn.storageVolLookupByPath(disk['alias'])
> >   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4770,
> > in storageVolLookupByPath
> > if ret is None:raise libvirtError('virStorageVolLookupByPath()
> > failed', conn=self)
> > libvirtError: Storage volume not found: no storage vol with matching path
> > 
> > the disks in the origin VM are defined as
> > 
> > 
> >   
> >   
> > 
> > 
> >   
> >   
> > 
> > is this a virt-v2v or oVirt problem?  
> 
> Well the stack trace is in the oVirt code, so I guess it's an oVirt
> problem.  Adding ovirt-users mailing list.
> 
> Rich.
> 
> -- 
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> virt-df lists disk usage of guests without needing to install any
> software inside the virtual machine.  Supports Linux and Windows.
> http://people.redhat.com/~rjones/virt-df/
> 
> ___
> Libguestfs mailing list
> Libguestfs@redhat.com
> https://www.redhat.com/mailman/listinfo/libguestfs


-- 
Tomáš Golembiovský 

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH v5 2/3] gobject: Remove gtk-doc (RHBZ#1465665).

2017-07-07 Thread Richard W.M. Jones
The gobject bindings are adequately covered in the usual manual pages:
guestfs(3).  There is no need for separate generation of gtk-doc.
Also generating gtk documentation is the slowest part of the build,
and the tooling around gtk-doc is broken
(https://bugzilla.redhat.com/show_bug.cgi?id=1465665).

Note this removes the configure ‘--enable-gtk-doc’ option.  Using this
option now gives a warning, but is otherwise ignored:

  configure: WARNING: unrecognized options: --enable-gtk-doc
---
 Makefile.am   |   2 +-
 configure.ac  |   2 -
 generator/GObject.ml  |  18 ---
 generator/GObject.mli |   1 -
 generator/main.ml |   2 -
 gobject/Makefile.am   |   3 -
 gobject/docs/.gitignore   |  26 
 gobject/docs/Makefile.am  | 115 
 gobject/docs/gtk-doc.make | 280 --
 gobject/docs/guestfs-docs.sgml.in |  34 -
 m4/gtk-doc.m4 |  67 -
 m4/guestfs_gobject.m4 |   7 -
 12 files changed, 1 insertion(+), 556 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fb77c9e9d..2dc704500 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -332,7 +332,7 @@ po/POTFILES: configure.ac
rm -f $@ $@-t
cd $(srcdir); \
find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
-   grep -v -E 
'^(examples|gnulib|gobject/docs|perl/(blib|examples)|po-docs|tests|test-data)/' 
| \
+   grep -v -E 
'^(examples|gnulib|perl/(blib|examples)|po-docs|tests|test-data)/' | \
grep -v -E '/((guestfs|rc)_protocol\.c)$$' | \
grep -v -E '^python/utils\.c$$' | \
grep -v -E '^perl/lib/Sys/Guestfs\.c$$' | \
diff --git a/configure.ac b/configure.ac
index 293e0d3ec..dd2a4d7f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,8 +224,6 @@ AC_CONFIG_FILES([Makefile
  gnulib/tests/Makefile
  gobject/libguestfs-gobject-1.0.pc
  gobject/Makefile
- gobject/docs/Makefile
- gobject/docs/guestfs-docs.sgml
  golang/Makefile
  golang/examples/Makefile
  haskell/Makefile
diff --git a/generator/GObject.ml b/generator/GObject.ml
index bb95b170c..b2d67d926 100644
--- a/generator/GObject.ml
+++ b/generator/GObject.ml
@@ -185,24 +185,6 @@ let generate_gobject_header () =
 (function f -> pr "#include \n" f)
 filenames
 
-let generate_gobject_doc_title () =
-  pr
-"
-http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\;
-[
-  http://www.w3.org/2003/XInclude'\">
-]>
-
-  Libguestfs GObject Bindings
-";
-
-  List.iter (
-function n -> pr "  \n" n
-  ) filenames;
-
-  pr "\n"
-
 let generate_gobject_struct_header filename typ cols () =
   header_start filename;
 
diff --git a/generator/GObject.mli b/generator/GObject.mli
index b4d0ea696..a23a4b6ad 100644
--- a/generator/GObject.mli
+++ b/generator/GObject.mli
@@ -16,7 +16,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *)
 
-val generate_gobject_doc_title : unit -> unit
 val generate_gobject_header : unit -> unit
 val generate_gobject_makefile : unit -> unit
 val generate_gobject_optargs_header : string -> string -> Types.action -> unit 
-> unit
diff --git a/generator/main.ml b/generator/main.ml
index d4316c085..cfea3f55a 100644
--- a/generator/main.ml
+++ b/generator/main.ml
@@ -283,8 +283,6 @@ Run it from the top source directory using the command
 GObject.generate_gobject_makefile;
   output_to "gobject/include/guestfs-gobject.h"
 GObject.generate_gobject_header;
-  output_to "gobject/docs/guestfs-title.sgml"
-GObject.generate_gobject_doc_title;
   List.iter (
 fun { s_name = typ; s_cols = cols } ->
   let short = sprintf "struct-%s" typ in
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 1c7750cb1..677d7a3d2 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -15,8 +15,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-SUBDIRS = . docs
-
 include $(top_srcdir)/subdir-rules.mk
 
 include $(srcdir)/Makefile.inc
@@ -33,7 +31,6 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
-   docs/.gitignore \
tests-misc.js \
run-tests \
run-tests-retvalues \
diff --git a/gobject/docs/.gitignore b/gobject/docs/.gitignore
deleted file mode 100644
index e91957f54..0
--- a/gobject/docs/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-/guestfs.args
-/guestfs-decl-list.txt
-/guestfs-decl.txt
-/guestfs-docs.sgml
-/guestfs.hierarchy
-/guestfs.interfaces
-/guestfs-overrides.txt
-/guestfs.prerequisites
-/guestfs-sections.txt
-/guestfs.signals
-/guestfs-title.sgml
-/guestfs.types
-/guestfs-undeclared.txt
-/guestfs-undocumented.txt
-/guestfs-unused.txt
-/html/

[Libguestfs] [PATCH v5 0/3] gobject: Remove gtk-doc (RHBZ#1465665).

2017-07-07 Thread Richard W.M. Jones
After enabling procmail debugging ...

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v5 1/3] gobject: Use TEST_FUNCTIONS framework in tests.

2017-07-07 Thread Richard W.M. Jones
---
 gobject/run-live-tests  |  8 
 gobject/run-tests   | 11 +--
 gobject/run-tests-retvalues |  7 +++
 tests/test-functions.sh | 16 
 4 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/gobject/run-live-tests b/gobject/run-live-tests
index 2d93de2ca..5bedb2309 100755
--- a/gobject/run-live-tests
+++ b/gobject/run-live-tests
@@ -18,9 +18,9 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
+skip_unless_phony_guest fedora.img
 
 $GJS $srcdir/tests-misc.js
diff --git a/gobject/run-tests b/gobject/run-tests
index 7393e7339..28e38d955 100755
--- a/gobject/run-tests
+++ b/gobject/run-tests
@@ -18,13 +18,12 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
 
-echo "GObject bind tests skipped: Int64, OInt64 and OStringList are all broken"
-exit 77
+# This test is disabled until we fix 64 bit support.
+skip_because "Int64, OInt64 and OStringList are all broken"
 
 rm -f bindtests.tmp
 
diff --git a/gobject/run-tests-retvalues b/gobject/run-tests-retvalues
index e20321ea2..569040de4 100755
--- a/gobject/run-tests-retvalues
+++ b/gobject/run-tests-retvalues
@@ -18,9 +18,8 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
 
 $GJS $srcdir/bindtests-retvalues.js 2>/dev/null
diff --git a/tests/test-functions.sh b/tests/test-functions.sh
index e5e824681..44ccd37b9 100755
--- a/tests/test-functions.sh
+++ b/tests/test-functions.sh
@@ -211,6 +211,15 @@ skip_unless_libvirt_minimum_version ()
 fi
 }
 
+# Skip unless the environment variable named is set to a non-empty value.
+skip_unless_environment_variable_set ()
+{
+if [ -z "${!1}" ]; then
+echo "$(basename $0): test skipped because \$$1 is not set"
+exit 77
+fi
+}
+
 # Run an external command and skip if the command fails.  This can be
 # used to test if a command exists.  Normally you should use
 # `cmd --help' or `cmd --version' or similar.
@@ -222,6 +231,13 @@ skip_unless ()
 fi
 }
 
+# Use this if a test is broken.  "$1" should contain the reason.
+skip_because ()
+{
+echo "$(basename $0): test skipped because: $1"
+exit 77
+}
+
 # Skip if the user is trying to run a test as root.
 # Tests shouldn't be run as root, but a few are especially dangerous.
 skip_if_root ()
-- 
2.13.2

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v5 3/3] gobject: Add outline guestfs-gobject(3) manual page.

2017-07-07 Thread Richard W.M. Jones
Since we removed gtk doc, we might as well replace it with a
manual page explaining the basics of how to run gjs.
---
 .gitignore |  2 ++
 docs/guestfs-recipes.pod   |  1 +
 erlang/examples/guestfs-erlang.pod |  1 +
 gobject/Makefile.am| 19 +++
 gobject/guestfs-gobject.pod| 64 ++
 golang/examples/guestfs-golang.pod |  1 +
 java/examples/guestfs-java.pod |  1 +
 lib/guestfs.pod|  5 ++-
 lua/examples/guestfs-lua.pod   |  1 +
 ocaml/examples/guestfs-ocaml.pod   |  1 +
 perl/examples/guestfs-perl.pod |  1 +
 python/examples/guestfs-python.pod |  1 +
 ruby/examples/guestfs-ruby.pod |  1 +
 13 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 7ccc928bb..774043501 100644
--- a/.gitignore
+++ b/.gitignore
@@ -283,6 +283,8 @@ Makefile.in
 /gobject/bindtests.js
 /gobject/Guestfs-1.0.gir
 /gobject/Guestfs-1.0.typelib
+/gobject/guestfs-gobject.3
+/gobject/stamp-guestfs-gobject.pod
 /golang/bindtests.go
 /golang/examples/guestfs-golang.3
 /golang/examples/stamp-guestfs-golang.pod
diff --git a/docs/guestfs-recipes.pod b/docs/guestfs-recipes.pod
index 7d772b8f2..11eb96ad7 100644
--- a/docs/guestfs-recipes.pod
+++ b/docs/guestfs-recipes.pod
@@ -722,6 +722,7 @@ L,
 L,
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/erlang/examples/guestfs-erlang.pod 
b/erlang/examples/guestfs-erlang.pod
index 89cbda15b..2f03b8281 100644
--- a/erlang/examples/guestfs-erlang.pod
+++ b/erlang/examples/guestfs-erlang.pod
@@ -96,6 +96,7 @@ C is the name of the unknown argument.
 
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 677d7a3d2..ddedd5b51 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -31,6 +31,7 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
+   guestfs-gobject.pod \
tests-misc.js \
run-tests \
run-tests-retvalues \
@@ -88,6 +89,8 @@ gir_DATA = $(INTROSPECTION_GIRS)
 typelibdir = $(libdir)/girepository-1.0
 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
+# Tests.
+
 TESTS = \
run-tests \
run-tests-retvalues
@@ -103,3 +106,19 @@ $(TESTS): $(typelib_DATA)
 CLEANFILES += $(gir_DATA) $(typelib_DATA)
 
 endif HAVE_INTROSPECTION
+
+# Documentation.
+
+man_MANS = guestfs-gobject.3
+noinst_DATA = $(top_builddir)/website/guestfs-gobject.3.html
+
+guestfs-gobject.3 $(top_builddir)/website/guestfs-gobject.3.html: 
stamp-guestfs-gobject.pod
+
+stamp-guestfs-gobject.pod: guestfs-gobject.pod
+   $(PODWRAPPER) \
+ --section 3 \
+ --man guestfs-gobject.3 \
+ --html $(top_builddir)/website/guestfs-gobject.3.html \
+ --license examples \
+ $<
+   touch $@
diff --git a/gobject/guestfs-gobject.pod b/gobject/guestfs-gobject.pod
new file mode 100644
index 0..c0c6839fb
--- /dev/null
+++ b/gobject/guestfs-gobject.pod
@@ -0,0 +1,64 @@
+=head1 NAME
+
+guestfs-gobject - How to use libguestfs with the GObject bindings
+
+=head1 SYNOPSIS
+
+From Javascript using gjs:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+=head1 DESCRIPTION
+
+This manual page documents how to call libguestfs using GObject
+bindings, especially from Javascript.
+
+Note that the GObject bindings have problems handling 64 bit values.
+You should not use the GObject bindings if there are native bindings
+for your language.  For example, to use libguestfs from Python you are
+strongly advised to use the Python native bindings instead (see
+L).
+
+This page just documents the differences from the C API and gives some
+examples.  If you are not familiar with using libguestfs, you also
+need to read L.
+
+=head1 JAVASCRIPT
+
+Using gjs, you can write a C<.js> file containing:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+and then run it using:
+
+ gjs program.js
+
+=head1 SEE ALSO
+
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L.
+
+=head1 AUTHORS
+
+Richard W.M. Jones (C)
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012-2017 Red Hat Inc.
diff --git a/golang/examples/guestfs-golang.pod 
b/golang/examples/guestfs-golang.pod
index c2de45ece..7b9c80ab4 100644
--- a/golang/examples/guestfs-golang.pod
+++ b/golang/examples/guestfs-golang.pod
@@ -78,6 +78,7 @@ UUIDs are not returned in structures.
 

[Libguestfs] [PATCH v4 1/3] gobject: Use TEST_FUNCTIONS framework in tests.

2017-07-07 Thread Richard W.M. Jones
---
 gobject/run-live-tests  |  8 
 gobject/run-tests   | 11 +--
 gobject/run-tests-retvalues |  7 +++
 tests/test-functions.sh | 16 
 4 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/gobject/run-live-tests b/gobject/run-live-tests
index 2d93de2ca..5bedb2309 100755
--- a/gobject/run-live-tests
+++ b/gobject/run-live-tests
@@ -18,9 +18,9 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
+skip_unless_phony_guest fedora.img
 
 $GJS $srcdir/tests-misc.js
diff --git a/gobject/run-tests b/gobject/run-tests
index 7393e7339..28e38d955 100755
--- a/gobject/run-tests
+++ b/gobject/run-tests
@@ -18,13 +18,12 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
 
-echo "GObject bind tests skipped: Int64, OInt64 and OStringList are all broken"
-exit 77
+# This test is disabled until we fix 64 bit support.
+skip_because "Int64, OInt64 and OStringList are all broken"
 
 rm -f bindtests.tmp
 
diff --git a/gobject/run-tests-retvalues b/gobject/run-tests-retvalues
index e20321ea2..569040de4 100755
--- a/gobject/run-tests-retvalues
+++ b/gobject/run-tests-retvalues
@@ -18,9 +18,8 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
 
 $GJS $srcdir/bindtests-retvalues.js 2>/dev/null
diff --git a/tests/test-functions.sh b/tests/test-functions.sh
index e5e824681..44ccd37b9 100755
--- a/tests/test-functions.sh
+++ b/tests/test-functions.sh
@@ -211,6 +211,15 @@ skip_unless_libvirt_minimum_version ()
 fi
 }
 
+# Skip unless the environment variable named is set to a non-empty value.
+skip_unless_environment_variable_set ()
+{
+if [ -z "${!1}" ]; then
+echo "$(basename $0): test skipped because \$$1 is not set"
+exit 77
+fi
+}
+
 # Run an external command and skip if the command fails.  This can be
 # used to test if a command exists.  Normally you should use
 # `cmd --help' or `cmd --version' or similar.
@@ -222,6 +231,13 @@ skip_unless ()
 fi
 }
 
+# Use this if a test is broken.  "$1" should contain the reason.
+skip_because ()
+{
+echo "$(basename $0): test skipped because: $1"
+exit 77
+}
+
 # Skip if the user is trying to run a test as root.
 # Tests shouldn't be run as root, but a few are especially dangerous.
 skip_if_root ()
-- 
2.13.2

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v4 3/3] gobject: Add outline guestfs-gobject(3) manual page.

2017-07-07 Thread Richard W.M. Jones
Since we removed gtk doc, we might as well replace it with a
manual page explaining the basics of how to run gjs.
---
 .gitignore |  2 ++
 docs/guestfs-recipes.pod   |  1 +
 erlang/examples/guestfs-erlang.pod |  1 +
 gobject/Makefile.am| 19 +++
 gobject/guestfs-gobject.pod| 64 ++
 golang/examples/guestfs-golang.pod |  1 +
 java/examples/guestfs-java.pod |  1 +
 lib/guestfs.pod|  5 ++-
 lua/examples/guestfs-lua.pod   |  1 +
 ocaml/examples/guestfs-ocaml.pod   |  1 +
 perl/examples/guestfs-perl.pod |  1 +
 python/examples/guestfs-python.pod |  1 +
 ruby/examples/guestfs-ruby.pod |  1 +
 13 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 7ccc928bb..774043501 100644
--- a/.gitignore
+++ b/.gitignore
@@ -283,6 +283,8 @@ Makefile.in
 /gobject/bindtests.js
 /gobject/Guestfs-1.0.gir
 /gobject/Guestfs-1.0.typelib
+/gobject/guestfs-gobject.3
+/gobject/stamp-guestfs-gobject.pod
 /golang/bindtests.go
 /golang/examples/guestfs-golang.3
 /golang/examples/stamp-guestfs-golang.pod
diff --git a/docs/guestfs-recipes.pod b/docs/guestfs-recipes.pod
index 7d772b8f2..11eb96ad7 100644
--- a/docs/guestfs-recipes.pod
+++ b/docs/guestfs-recipes.pod
@@ -722,6 +722,7 @@ L,
 L,
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/erlang/examples/guestfs-erlang.pod 
b/erlang/examples/guestfs-erlang.pod
index 89cbda15b..2f03b8281 100644
--- a/erlang/examples/guestfs-erlang.pod
+++ b/erlang/examples/guestfs-erlang.pod
@@ -96,6 +96,7 @@ C is the name of the unknown argument.
 
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 677d7a3d2..ddedd5b51 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -31,6 +31,7 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
+   guestfs-gobject.pod \
tests-misc.js \
run-tests \
run-tests-retvalues \
@@ -88,6 +89,8 @@ gir_DATA = $(INTROSPECTION_GIRS)
 typelibdir = $(libdir)/girepository-1.0
 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
+# Tests.
+
 TESTS = \
run-tests \
run-tests-retvalues
@@ -103,3 +106,19 @@ $(TESTS): $(typelib_DATA)
 CLEANFILES += $(gir_DATA) $(typelib_DATA)
 
 endif HAVE_INTROSPECTION
+
+# Documentation.
+
+man_MANS = guestfs-gobject.3
+noinst_DATA = $(top_builddir)/website/guestfs-gobject.3.html
+
+guestfs-gobject.3 $(top_builddir)/website/guestfs-gobject.3.html: 
stamp-guestfs-gobject.pod
+
+stamp-guestfs-gobject.pod: guestfs-gobject.pod
+   $(PODWRAPPER) \
+ --section 3 \
+ --man guestfs-gobject.3 \
+ --html $(top_builddir)/website/guestfs-gobject.3.html \
+ --license examples \
+ $<
+   touch $@
diff --git a/gobject/guestfs-gobject.pod b/gobject/guestfs-gobject.pod
new file mode 100644
index 0..c0c6839fb
--- /dev/null
+++ b/gobject/guestfs-gobject.pod
@@ -0,0 +1,64 @@
+=head1 NAME
+
+guestfs-gobject - How to use libguestfs with the GObject bindings
+
+=head1 SYNOPSIS
+
+From Javascript using gjs:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+=head1 DESCRIPTION
+
+This manual page documents how to call libguestfs using GObject
+bindings, especially from Javascript.
+
+Note that the GObject bindings have problems handling 64 bit values.
+You should not use the GObject bindings if there are native bindings
+for your language.  For example, to use libguestfs from Python you are
+strongly advised to use the Python native bindings instead (see
+L).
+
+This page just documents the differences from the C API and gives some
+examples.  If you are not familiar with using libguestfs, you also
+need to read L.
+
+=head1 JAVASCRIPT
+
+Using gjs, you can write a C<.js> file containing:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+and then run it using:
+
+ gjs program.js
+
+=head1 SEE ALSO
+
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L.
+
+=head1 AUTHORS
+
+Richard W.M. Jones (C)
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012-2017 Red Hat Inc.
diff --git a/golang/examples/guestfs-golang.pod 
b/golang/examples/guestfs-golang.pod
index c2de45ece..7b9c80ab4 100644
--- a/golang/examples/guestfs-golang.pod
+++ b/golang/examples/guestfs-golang.pod
@@ -78,6 +78,7 @@ UUIDs are not returned in structures.
 

[Libguestfs] [PATCH v4 2/3] gobject: Remove gtk-doc (RHBZ#1465665).

2017-07-07 Thread Richard W.M. Jones
The gobject bindings are adequately covered in the usual manual pages:
guestfs(3).  There is no need for separate generation of gtk-doc.
Also generating gtk documentation is the slowest part of the build,
and the tooling around gtk-doc is broken
(https://bugzilla.redhat.com/show_bug.cgi?id=1465665).

Note this removes the configure ‘--enable-gtk-doc’ option.  Using this
option now gives a warning, but is otherwise ignored:

  configure: WARNING: unrecognized options: --enable-gtk-doc
---
 Makefile.am   |   2 +-
 configure.ac  |   2 -
 generator/GObject.ml  |  18 ---
 generator/GObject.mli |   1 -
 generator/main.ml |   2 -
 gobject/Makefile.am   |   3 -
 gobject/docs/.gitignore   |  26 
 gobject/docs/Makefile.am  | 115 
 gobject/docs/gtk-doc.make | 280 --
 gobject/docs/guestfs-docs.sgml.in |  34 -
 m4/gtk-doc.m4 |  67 -
 m4/guestfs_gobject.m4 |   7 -
 12 files changed, 1 insertion(+), 556 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fb77c9e9d..2dc704500 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -332,7 +332,7 @@ po/POTFILES: configure.ac
rm -f $@ $@-t
cd $(srcdir); \
find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
-   grep -v -E 
'^(examples|gnulib|gobject/docs|perl/(blib|examples)|po-docs|tests|test-data)/' 
| \
+   grep -v -E 
'^(examples|gnulib|perl/(blib|examples)|po-docs|tests|test-data)/' | \
grep -v -E '/((guestfs|rc)_protocol\.c)$$' | \
grep -v -E '^python/utils\.c$$' | \
grep -v -E '^perl/lib/Sys/Guestfs\.c$$' | \
diff --git a/configure.ac b/configure.ac
index 293e0d3ec..dd2a4d7f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,8 +224,6 @@ AC_CONFIG_FILES([Makefile
  gnulib/tests/Makefile
  gobject/libguestfs-gobject-1.0.pc
  gobject/Makefile
- gobject/docs/Makefile
- gobject/docs/guestfs-docs.sgml
  golang/Makefile
  golang/examples/Makefile
  haskell/Makefile
diff --git a/generator/GObject.ml b/generator/GObject.ml
index bb95b170c..b2d67d926 100644
--- a/generator/GObject.ml
+++ b/generator/GObject.ml
@@ -185,24 +185,6 @@ let generate_gobject_header () =
 (function f -> pr "#include \n" f)
 filenames
 
-let generate_gobject_doc_title () =
-  pr
-"
-http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\;
-[
-  http://www.w3.org/2003/XInclude'\">
-]>
-
-  Libguestfs GObject Bindings
-";
-
-  List.iter (
-function n -> pr "  \n" n
-  ) filenames;
-
-  pr "\n"
-
 let generate_gobject_struct_header filename typ cols () =
   header_start filename;
 
diff --git a/generator/GObject.mli b/generator/GObject.mli
index b4d0ea696..a23a4b6ad 100644
--- a/generator/GObject.mli
+++ b/generator/GObject.mli
@@ -16,7 +16,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *)
 
-val generate_gobject_doc_title : unit -> unit
 val generate_gobject_header : unit -> unit
 val generate_gobject_makefile : unit -> unit
 val generate_gobject_optargs_header : string -> string -> Types.action -> unit 
-> unit
diff --git a/generator/main.ml b/generator/main.ml
index d4316c085..cfea3f55a 100644
--- a/generator/main.ml
+++ b/generator/main.ml
@@ -283,8 +283,6 @@ Run it from the top source directory using the command
 GObject.generate_gobject_makefile;
   output_to "gobject/include/guestfs-gobject.h"
 GObject.generate_gobject_header;
-  output_to "gobject/docs/guestfs-title.sgml"
-GObject.generate_gobject_doc_title;
   List.iter (
 fun { s_name = typ; s_cols = cols } ->
   let short = sprintf "struct-%s" typ in
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 1c7750cb1..677d7a3d2 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -15,8 +15,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-SUBDIRS = . docs
-
 include $(top_srcdir)/subdir-rules.mk
 
 include $(srcdir)/Makefile.inc
@@ -33,7 +31,6 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
-   docs/.gitignore \
tests-misc.js \
run-tests \
run-tests-retvalues \
diff --git a/gobject/docs/.gitignore b/gobject/docs/.gitignore
deleted file mode 100644
index e91957f54..0
--- a/gobject/docs/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-/guestfs.args
-/guestfs-decl-list.txt
-/guestfs-decl.txt
-/guestfs-docs.sgml
-/guestfs.hierarchy
-/guestfs.interfaces
-/guestfs-overrides.txt
-/guestfs.prerequisites
-/guestfs-sections.txt
-/guestfs.signals
-/guestfs-title.sgml
-/guestfs.types
-/guestfs-undeclared.txt
-/guestfs-undocumented.txt
-/guestfs-unused.txt
-/html/

[Libguestfs] [PATCH v4 0/3] gobject: Remove gtk-doc (RHBZ#1465665).

2017-07-07 Thread Richard W.M. Jones
Best of .. 4?

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v3 2/3] gobject: Remove gtk-doc (RHBZ#1465665).

2017-07-07 Thread Richard W.M. Jones
The gobject bindings are adequately covered in the usual manual pages:
guestfs(3).  There is no need for separate generation of gtk-doc.
Also generating gtk documentation is the slowest part of the build,
and the tooling around gtk-doc is broken
(https://bugzilla.redhat.com/show_bug.cgi?id=1465665).

Note this removes the configure ‘--enable-gtk-doc’ option.  Using this
option now gives a warning, but is otherwise ignored:

  configure: WARNING: unrecognized options: --enable-gtk-doc
---
 Makefile.am   |   2 +-
 configure.ac  |   2 -
 generator/GObject.ml  |  18 ---
 generator/GObject.mli |   1 -
 generator/main.ml |   2 -
 gobject/Makefile.am   |   3 -
 gobject/docs/.gitignore   |  26 
 gobject/docs/Makefile.am  | 115 
 gobject/docs/gtk-doc.make | 280 --
 gobject/docs/guestfs-docs.sgml.in |  34 -
 m4/gtk-doc.m4 |  67 -
 m4/guestfs_gobject.m4 |   7 -
 12 files changed, 1 insertion(+), 556 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fb77c9e9d..2dc704500 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -332,7 +332,7 @@ po/POTFILES: configure.ac
rm -f $@ $@-t
cd $(srcdir); \
find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
-   grep -v -E 
'^(examples|gnulib|gobject/docs|perl/(blib|examples)|po-docs|tests|test-data)/' 
| \
+   grep -v -E 
'^(examples|gnulib|perl/(blib|examples)|po-docs|tests|test-data)/' | \
grep -v -E '/((guestfs|rc)_protocol\.c)$$' | \
grep -v -E '^python/utils\.c$$' | \
grep -v -E '^perl/lib/Sys/Guestfs\.c$$' | \
diff --git a/configure.ac b/configure.ac
index 293e0d3ec..dd2a4d7f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,8 +224,6 @@ AC_CONFIG_FILES([Makefile
  gnulib/tests/Makefile
  gobject/libguestfs-gobject-1.0.pc
  gobject/Makefile
- gobject/docs/Makefile
- gobject/docs/guestfs-docs.sgml
  golang/Makefile
  golang/examples/Makefile
  haskell/Makefile
diff --git a/generator/GObject.ml b/generator/GObject.ml
index bb95b170c..b2d67d926 100644
--- a/generator/GObject.ml
+++ b/generator/GObject.ml
@@ -185,24 +185,6 @@ let generate_gobject_header () =
 (function f -> pr "#include \n" f)
 filenames
 
-let generate_gobject_doc_title () =
-  pr
-"
-http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\;
-[
-  http://www.w3.org/2003/XInclude'\">
-]>
-
-  Libguestfs GObject Bindings
-";
-
-  List.iter (
-function n -> pr "  \n" n
-  ) filenames;
-
-  pr "\n"
-
 let generate_gobject_struct_header filename typ cols () =
   header_start filename;
 
diff --git a/generator/GObject.mli b/generator/GObject.mli
index b4d0ea696..a23a4b6ad 100644
--- a/generator/GObject.mli
+++ b/generator/GObject.mli
@@ -16,7 +16,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *)
 
-val generate_gobject_doc_title : unit -> unit
 val generate_gobject_header : unit -> unit
 val generate_gobject_makefile : unit -> unit
 val generate_gobject_optargs_header : string -> string -> Types.action -> unit 
-> unit
diff --git a/generator/main.ml b/generator/main.ml
index d4316c085..cfea3f55a 100644
--- a/generator/main.ml
+++ b/generator/main.ml
@@ -283,8 +283,6 @@ Run it from the top source directory using the command
 GObject.generate_gobject_makefile;
   output_to "gobject/include/guestfs-gobject.h"
 GObject.generate_gobject_header;
-  output_to "gobject/docs/guestfs-title.sgml"
-GObject.generate_gobject_doc_title;
   List.iter (
 fun { s_name = typ; s_cols = cols } ->
   let short = sprintf "struct-%s" typ in
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 1c7750cb1..677d7a3d2 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -15,8 +15,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-SUBDIRS = . docs
-
 include $(top_srcdir)/subdir-rules.mk
 
 include $(srcdir)/Makefile.inc
@@ -33,7 +31,6 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
-   docs/.gitignore \
tests-misc.js \
run-tests \
run-tests-retvalues \
diff --git a/gobject/docs/.gitignore b/gobject/docs/.gitignore
deleted file mode 100644
index e91957f54..0
--- a/gobject/docs/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-/guestfs.args
-/guestfs-decl-list.txt
-/guestfs-decl.txt
-/guestfs-docs.sgml
-/guestfs.hierarchy
-/guestfs.interfaces
-/guestfs-overrides.txt
-/guestfs.prerequisites
-/guestfs-sections.txt
-/guestfs.signals
-/guestfs-title.sgml
-/guestfs.types
-/guestfs-undeclared.txt
-/guestfs-undocumented.txt
-/guestfs-unused.txt
-/html/

[Libguestfs] [PATCH v3 0/3] gobject: Remove gtk-doc.

2017-07-07 Thread Richard W.M. Jones
Another test, the same as before.

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v3 3/3] gobject: Add outline guestfs-gobject(3) manual page.

2017-07-07 Thread Richard W.M. Jones
Since we removed gtk doc, we might as well replace it with a
manual page explaining the basics of how to run gjs.
---
 .gitignore |  2 ++
 docs/guestfs-recipes.pod   |  1 +
 erlang/examples/guestfs-erlang.pod |  1 +
 gobject/Makefile.am| 19 +++
 gobject/guestfs-gobject.pod| 64 ++
 golang/examples/guestfs-golang.pod |  1 +
 java/examples/guestfs-java.pod |  1 +
 lib/guestfs.pod|  5 ++-
 lua/examples/guestfs-lua.pod   |  1 +
 ocaml/examples/guestfs-ocaml.pod   |  1 +
 perl/examples/guestfs-perl.pod |  1 +
 python/examples/guestfs-python.pod |  1 +
 ruby/examples/guestfs-ruby.pod |  1 +
 13 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 7ccc928bb..774043501 100644
--- a/.gitignore
+++ b/.gitignore
@@ -283,6 +283,8 @@ Makefile.in
 /gobject/bindtests.js
 /gobject/Guestfs-1.0.gir
 /gobject/Guestfs-1.0.typelib
+/gobject/guestfs-gobject.3
+/gobject/stamp-guestfs-gobject.pod
 /golang/bindtests.go
 /golang/examples/guestfs-golang.3
 /golang/examples/stamp-guestfs-golang.pod
diff --git a/docs/guestfs-recipes.pod b/docs/guestfs-recipes.pod
index 7d772b8f2..11eb96ad7 100644
--- a/docs/guestfs-recipes.pod
+++ b/docs/guestfs-recipes.pod
@@ -722,6 +722,7 @@ L,
 L,
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/erlang/examples/guestfs-erlang.pod 
b/erlang/examples/guestfs-erlang.pod
index 89cbda15b..2f03b8281 100644
--- a/erlang/examples/guestfs-erlang.pod
+++ b/erlang/examples/guestfs-erlang.pod
@@ -96,6 +96,7 @@ C is the name of the unknown argument.
 
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 677d7a3d2..ddedd5b51 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -31,6 +31,7 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
+   guestfs-gobject.pod \
tests-misc.js \
run-tests \
run-tests-retvalues \
@@ -88,6 +89,8 @@ gir_DATA = $(INTROSPECTION_GIRS)
 typelibdir = $(libdir)/girepository-1.0
 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
+# Tests.
+
 TESTS = \
run-tests \
run-tests-retvalues
@@ -103,3 +106,19 @@ $(TESTS): $(typelib_DATA)
 CLEANFILES += $(gir_DATA) $(typelib_DATA)
 
 endif HAVE_INTROSPECTION
+
+# Documentation.
+
+man_MANS = guestfs-gobject.3
+noinst_DATA = $(top_builddir)/website/guestfs-gobject.3.html
+
+guestfs-gobject.3 $(top_builddir)/website/guestfs-gobject.3.html: 
stamp-guestfs-gobject.pod
+
+stamp-guestfs-gobject.pod: guestfs-gobject.pod
+   $(PODWRAPPER) \
+ --section 3 \
+ --man guestfs-gobject.3 \
+ --html $(top_builddir)/website/guestfs-gobject.3.html \
+ --license examples \
+ $<
+   touch $@
diff --git a/gobject/guestfs-gobject.pod b/gobject/guestfs-gobject.pod
new file mode 100644
index 0..c0c6839fb
--- /dev/null
+++ b/gobject/guestfs-gobject.pod
@@ -0,0 +1,64 @@
+=head1 NAME
+
+guestfs-gobject - How to use libguestfs with the GObject bindings
+
+=head1 SYNOPSIS
+
+From Javascript using gjs:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+=head1 DESCRIPTION
+
+This manual page documents how to call libguestfs using GObject
+bindings, especially from Javascript.
+
+Note that the GObject bindings have problems handling 64 bit values.
+You should not use the GObject bindings if there are native bindings
+for your language.  For example, to use libguestfs from Python you are
+strongly advised to use the Python native bindings instead (see
+L).
+
+This page just documents the differences from the C API and gives some
+examples.  If you are not familiar with using libguestfs, you also
+need to read L.
+
+=head1 JAVASCRIPT
+
+Using gjs, you can write a C<.js> file containing:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+and then run it using:
+
+ gjs program.js
+
+=head1 SEE ALSO
+
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L.
+
+=head1 AUTHORS
+
+Richard W.M. Jones (C)
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012-2017 Red Hat Inc.
diff --git a/golang/examples/guestfs-golang.pod 
b/golang/examples/guestfs-golang.pod
index c2de45ece..7b9c80ab4 100644
--- a/golang/examples/guestfs-golang.pod
+++ b/golang/examples/guestfs-golang.pod
@@ -78,6 +78,7 @@ UUIDs are not returned in structures.
 

[Libguestfs] [PATCH v3 1/3] gobject: Use TEST_FUNCTIONS framework in tests.

2017-07-07 Thread Richard W.M. Jones
---
 gobject/run-live-tests  |  8 
 gobject/run-tests   | 11 +--
 gobject/run-tests-retvalues |  7 +++
 tests/test-functions.sh | 16 
 4 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/gobject/run-live-tests b/gobject/run-live-tests
index 2d93de2ca..5bedb2309 100755
--- a/gobject/run-live-tests
+++ b/gobject/run-live-tests
@@ -18,9 +18,9 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
+skip_unless_phony_guest fedora.img
 
 $GJS $srcdir/tests-misc.js
diff --git a/gobject/run-tests b/gobject/run-tests
index 7393e7339..28e38d955 100755
--- a/gobject/run-tests
+++ b/gobject/run-tests
@@ -18,13 +18,12 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
 
-echo "GObject bind tests skipped: Int64, OInt64 and OStringList are all broken"
-exit 77
+# This test is disabled until we fix 64 bit support.
+skip_because "Int64, OInt64 and OStringList are all broken"
 
 rm -f bindtests.tmp
 
diff --git a/gobject/run-tests-retvalues b/gobject/run-tests-retvalues
index e20321ea2..569040de4 100755
--- a/gobject/run-tests-retvalues
+++ b/gobject/run-tests-retvalues
@@ -18,9 +18,8 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
 
 $GJS $srcdir/bindtests-retvalues.js 2>/dev/null
diff --git a/tests/test-functions.sh b/tests/test-functions.sh
index e5e824681..44ccd37b9 100755
--- a/tests/test-functions.sh
+++ b/tests/test-functions.sh
@@ -211,6 +211,15 @@ skip_unless_libvirt_minimum_version ()
 fi
 }
 
+# Skip unless the environment variable named is set to a non-empty value.
+skip_unless_environment_variable_set ()
+{
+if [ -z "${!1}" ]; then
+echo "$(basename $0): test skipped because \$$1 is not set"
+exit 77
+fi
+}
+
 # Run an external command and skip if the command fails.  This can be
 # used to test if a command exists.  Normally you should use
 # `cmd --help' or `cmd --version' or similar.
@@ -222,6 +231,13 @@ skip_unless ()
 fi
 }
 
+# Use this if a test is broken.  "$1" should contain the reason.
+skip_because ()
+{
+echo "$(basename $0): test skipped because: $1"
+exit 77
+}
+
 # Skip if the user is trying to run a test as root.
 # Tests shouldn't be run as root, but a few are especially dangerous.
 skip_if_root ()
-- 
2.13.2

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v2 1/3] gobject: Use TEST_FUNCTIONS framework in tests.

2017-07-07 Thread Richard W.M. Jones
---
 gobject/run-live-tests  |  8 
 gobject/run-tests   | 11 +--
 gobject/run-tests-retvalues |  7 +++
 tests/test-functions.sh | 16 
 4 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/gobject/run-live-tests b/gobject/run-live-tests
index 2d93de2ca..5bedb2309 100755
--- a/gobject/run-live-tests
+++ b/gobject/run-live-tests
@@ -18,9 +18,9 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
+skip_unless_phony_guest fedora.img
 
 $GJS $srcdir/tests-misc.js
diff --git a/gobject/run-tests b/gobject/run-tests
index 7393e7339..28e38d955 100755
--- a/gobject/run-tests
+++ b/gobject/run-tests
@@ -18,13 +18,12 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
 
-echo "GObject bind tests skipped: Int64, OInt64 and OStringList are all broken"
-exit 77
+# This test is disabled until we fix 64 bit support.
+skip_because "Int64, OInt64 and OStringList are all broken"
 
 rm -f bindtests.tmp
 
diff --git a/gobject/run-tests-retvalues b/gobject/run-tests-retvalues
index e20321ea2..569040de4 100755
--- a/gobject/run-tests-retvalues
+++ b/gobject/run-tests-retvalues
@@ -18,9 +18,8 @@
 
 set -e
 
-if [ -z "$GJS" ]; then
-  echo "GObject bind tests skipped: gjs is missing"
-  exit 77
-fi
+$TEST_FUNCTIONS
+skip_if_skipped
+skip_unless_environment_variable_set GJS
 
 $GJS $srcdir/bindtests-retvalues.js 2>/dev/null
diff --git a/tests/test-functions.sh b/tests/test-functions.sh
index e5e824681..44ccd37b9 100755
--- a/tests/test-functions.sh
+++ b/tests/test-functions.sh
@@ -211,6 +211,15 @@ skip_unless_libvirt_minimum_version ()
 fi
 }
 
+# Skip unless the environment variable named is set to a non-empty value.
+skip_unless_environment_variable_set ()
+{
+if [ -z "${!1}" ]; then
+echo "$(basename $0): test skipped because \$$1 is not set"
+exit 77
+fi
+}
+
 # Run an external command and skip if the command fails.  This can be
 # used to test if a command exists.  Normally you should use
 # `cmd --help' or `cmd --version' or similar.
@@ -222,6 +231,13 @@ skip_unless ()
 fi
 }
 
+# Use this if a test is broken.  "$1" should contain the reason.
+skip_because ()
+{
+echo "$(basename $0): test skipped because: $1"
+exit 77
+}
+
 # Skip if the user is trying to run a test as root.
 # Tests shouldn't be run as root, but a few are especially dangerous.
 skip_if_root ()
-- 
2.13.2

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v2 2/3] gobject: Remove gtk-doc (RHBZ#1465665).

2017-07-07 Thread Richard W.M. Jones
The gobject bindings are adequately covered in the usual manual pages:
guestfs(3).  There is no need for separate generation of gtk-doc.
Also generating gtk documentation is the slowest part of the build,
and the tooling around gtk-doc is broken
(https://bugzilla.redhat.com/show_bug.cgi?id=1465665).

Note this removes the configure ‘--enable-gtk-doc’ option.  Using this
option now gives a warning, but is otherwise ignored:

  configure: WARNING: unrecognized options: --enable-gtk-doc
---
 Makefile.am   |   2 +-
 configure.ac  |   2 -
 generator/GObject.ml  |  18 ---
 generator/GObject.mli |   1 -
 generator/main.ml |   2 -
 gobject/Makefile.am   |   3 -
 gobject/docs/.gitignore   |  26 
 gobject/docs/Makefile.am  | 115 
 gobject/docs/gtk-doc.make | 280 --
 gobject/docs/guestfs-docs.sgml.in |  34 -
 m4/gtk-doc.m4 |  67 -
 m4/guestfs_gobject.m4 |   7 -
 12 files changed, 1 insertion(+), 556 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fb77c9e9d..2dc704500 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -332,7 +332,7 @@ po/POTFILES: configure.ac
rm -f $@ $@-t
cd $(srcdir); \
find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
-   grep -v -E 
'^(examples|gnulib|gobject/docs|perl/(blib|examples)|po-docs|tests|test-data)/' 
| \
+   grep -v -E 
'^(examples|gnulib|perl/(blib|examples)|po-docs|tests|test-data)/' | \
grep -v -E '/((guestfs|rc)_protocol\.c)$$' | \
grep -v -E '^python/utils\.c$$' | \
grep -v -E '^perl/lib/Sys/Guestfs\.c$$' | \
diff --git a/configure.ac b/configure.ac
index 293e0d3ec..dd2a4d7f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,8 +224,6 @@ AC_CONFIG_FILES([Makefile
  gnulib/tests/Makefile
  gobject/libguestfs-gobject-1.0.pc
  gobject/Makefile
- gobject/docs/Makefile
- gobject/docs/guestfs-docs.sgml
  golang/Makefile
  golang/examples/Makefile
  haskell/Makefile
diff --git a/generator/GObject.ml b/generator/GObject.ml
index bb95b170c..b2d67d926 100644
--- a/generator/GObject.ml
+++ b/generator/GObject.ml
@@ -185,24 +185,6 @@ let generate_gobject_header () =
 (function f -> pr "#include \n" f)
 filenames
 
-let generate_gobject_doc_title () =
-  pr
-"
-http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\;
-[
-  http://www.w3.org/2003/XInclude'\">
-]>
-
-  Libguestfs GObject Bindings
-";
-
-  List.iter (
-function n -> pr "  \n" n
-  ) filenames;
-
-  pr "\n"
-
 let generate_gobject_struct_header filename typ cols () =
   header_start filename;
 
diff --git a/generator/GObject.mli b/generator/GObject.mli
index b4d0ea696..a23a4b6ad 100644
--- a/generator/GObject.mli
+++ b/generator/GObject.mli
@@ -16,7 +16,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  *)
 
-val generate_gobject_doc_title : unit -> unit
 val generate_gobject_header : unit -> unit
 val generate_gobject_makefile : unit -> unit
 val generate_gobject_optargs_header : string -> string -> Types.action -> unit 
-> unit
diff --git a/generator/main.ml b/generator/main.ml
index d4316c085..cfea3f55a 100644
--- a/generator/main.ml
+++ b/generator/main.ml
@@ -283,8 +283,6 @@ Run it from the top source directory using the command
 GObject.generate_gobject_makefile;
   output_to "gobject/include/guestfs-gobject.h"
 GObject.generate_gobject_header;
-  output_to "gobject/docs/guestfs-title.sgml"
-GObject.generate_gobject_doc_title;
   List.iter (
 fun { s_name = typ; s_cols = cols } ->
   let short = sprintf "struct-%s" typ in
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 1c7750cb1..677d7a3d2 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -15,8 +15,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-SUBDIRS = . docs
-
 include $(top_srcdir)/subdir-rules.mk
 
 include $(srcdir)/Makefile.inc
@@ -33,7 +31,6 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
-   docs/.gitignore \
tests-misc.js \
run-tests \
run-tests-retvalues \
diff --git a/gobject/docs/.gitignore b/gobject/docs/.gitignore
deleted file mode 100644
index e91957f54..0
--- a/gobject/docs/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-/guestfs.args
-/guestfs-decl-list.txt
-/guestfs-decl.txt
-/guestfs-docs.sgml
-/guestfs.hierarchy
-/guestfs.interfaces
-/guestfs-overrides.txt
-/guestfs.prerequisites
-/guestfs-sections.txt
-/guestfs.signals
-/guestfs-title.sgml
-/guestfs.types
-/guestfs-undeclared.txt
-/guestfs-undocumented.txt
-/guestfs-unused.txt
-/html/

[Libguestfs] [PATCH v2 0/3] Remove gtk-doc.

2017-07-07 Thread Richard W.M. Jones
This is a repost so I can test my procmail script / automatic
testing framework.  The patch series is identical to v1.

Rich.

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


[Libguestfs] [PATCH v2 3/3] gobject: Add outline guestfs-gobject(3) manual page.

2017-07-07 Thread Richard W.M. Jones
Since we removed gtk doc, we might as well replace it with a
manual page explaining the basics of how to run gjs.
---
 .gitignore |  2 ++
 docs/guestfs-recipes.pod   |  1 +
 erlang/examples/guestfs-erlang.pod |  1 +
 gobject/Makefile.am| 19 +++
 gobject/guestfs-gobject.pod| 64 ++
 golang/examples/guestfs-golang.pod |  1 +
 java/examples/guestfs-java.pod |  1 +
 lib/guestfs.pod|  5 ++-
 lua/examples/guestfs-lua.pod   |  1 +
 ocaml/examples/guestfs-ocaml.pod   |  1 +
 perl/examples/guestfs-perl.pod |  1 +
 python/examples/guestfs-python.pod |  1 +
 ruby/examples/guestfs-ruby.pod |  1 +
 13 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 7ccc928bb..774043501 100644
--- a/.gitignore
+++ b/.gitignore
@@ -283,6 +283,8 @@ Makefile.in
 /gobject/bindtests.js
 /gobject/Guestfs-1.0.gir
 /gobject/Guestfs-1.0.typelib
+/gobject/guestfs-gobject.3
+/gobject/stamp-guestfs-gobject.pod
 /golang/bindtests.go
 /golang/examples/guestfs-golang.3
 /golang/examples/stamp-guestfs-golang.pod
diff --git a/docs/guestfs-recipes.pod b/docs/guestfs-recipes.pod
index 7d772b8f2..11eb96ad7 100644
--- a/docs/guestfs-recipes.pod
+++ b/docs/guestfs-recipes.pod
@@ -722,6 +722,7 @@ L,
 L,
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/erlang/examples/guestfs-erlang.pod 
b/erlang/examples/guestfs-erlang.pod
index 89cbda15b..2f03b8281 100644
--- a/erlang/examples/guestfs-erlang.pod
+++ b/erlang/examples/guestfs-erlang.pod
@@ -96,6 +96,7 @@ C is the name of the unknown argument.
 
 L,
 L,
+L,
 L,
 L,
 L,
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index 677d7a3d2..ddedd5b51 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -31,6 +31,7 @@ EXTRA_DIST = \
TODO.txt \
.gitignore \
bindtests-retvalues.js \
+   guestfs-gobject.pod \
tests-misc.js \
run-tests \
run-tests-retvalues \
@@ -88,6 +89,8 @@ gir_DATA = $(INTROSPECTION_GIRS)
 typelibdir = $(libdir)/girepository-1.0
 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
 
+# Tests.
+
 TESTS = \
run-tests \
run-tests-retvalues
@@ -103,3 +106,19 @@ $(TESTS): $(typelib_DATA)
 CLEANFILES += $(gir_DATA) $(typelib_DATA)
 
 endif HAVE_INTROSPECTION
+
+# Documentation.
+
+man_MANS = guestfs-gobject.3
+noinst_DATA = $(top_builddir)/website/guestfs-gobject.3.html
+
+guestfs-gobject.3 $(top_builddir)/website/guestfs-gobject.3.html: 
stamp-guestfs-gobject.pod
+
+stamp-guestfs-gobject.pod: guestfs-gobject.pod
+   $(PODWRAPPER) \
+ --section 3 \
+ --man guestfs-gobject.3 \
+ --html $(top_builddir)/website/guestfs-gobject.3.html \
+ --license examples \
+ $<
+   touch $@
diff --git a/gobject/guestfs-gobject.pod b/gobject/guestfs-gobject.pod
new file mode 100644
index 0..c0c6839fb
--- /dev/null
+++ b/gobject/guestfs-gobject.pod
@@ -0,0 +1,64 @@
+=head1 NAME
+
+guestfs-gobject - How to use libguestfs with the GObject bindings
+
+=head1 SYNOPSIS
+
+From Javascript using gjs:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+=head1 DESCRIPTION
+
+This manual page documents how to call libguestfs using GObject
+bindings, especially from Javascript.
+
+Note that the GObject bindings have problems handling 64 bit values.
+You should not use the GObject bindings if there are native bindings
+for your language.  For example, to use libguestfs from Python you are
+strongly advised to use the Python native bindings instead (see
+L).
+
+This page just documents the differences from the C API and gives some
+examples.  If you are not familiar with using libguestfs, you also
+need to read L.
+
+=head1 JAVASCRIPT
+
+Using gjs, you can write a C<.js> file containing:
+
+ const Guestfs = imports.gi.Guestfs;
+ var g = new Guestfs.Session();
+ g.add_drive('disk.img', null);
+ g.launch();
+ g.close();
+
+and then run it using:
+
+ gjs program.js
+
+=head1 SEE ALSO
+
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L,
+L.
+
+=head1 AUTHORS
+
+Richard W.M. Jones (C)
+
+=head1 COPYRIGHT
+
+Copyright (C) 2012-2017 Red Hat Inc.
diff --git a/golang/examples/guestfs-golang.pod 
b/golang/examples/guestfs-golang.pod
index c2de45ece..7b9c80ab4 100644
--- a/golang/examples/guestfs-golang.pod
+++ b/golang/examples/guestfs-golang.pod
@@ -78,6 +78,7 @@ UUIDs are not returned in structures.
 

Re: [Libguestfs] [PATCH v7 9/9] Add a virt-builder-repository tool

2017-07-07 Thread Pino Toscano
On Monday, 19 June 2017 10:48:37 CEST Cédric Bosdonnat wrote:
> +let compress_to file outdir =
> +  let outimg = outdir // (Filename.basename file) ^ ".xz" in
> +
> +  info "Compressing ...%!";
> +  let cmd = sprintf "cat \"%s\" | xz -f --best --block-size=16777216 - 
> >\"%s\""
> +file outimg in
> +  if shell_command cmd <> 0 then
> +exit 1;

This finally can now be:

  let cmd = [ "xz"; "-f"; "--best"; "--block-size=16777216"; "-c"; file ] in
  let file_flags = [ Unix.O_WRONLY; Unix.O_CREAT; Unix.O_TRUNC; ] in
  let outfd = Unix.openfile outimg file_flags 0o666 in
  let res = run_command cmd ~stdout_chan:outfd in
  if res <> 0 then
error (f_"'xz' command failed");

Yes, slightly more verbose, but it avoids the shell, and the need for
proper quoting. It's also logged, and faster (since the whole data of
the disk is not read twice, once by cat, and once by xz via stdin).

Thanks,
-- 
Pino Toscano

signature.asc
Description: This is a digitally signed message part.
___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

2017-07-07 Thread Ming Xie
I could reproduce customer's problem

Packages:
rhv:4.1.3-0.1.el7
vdsm-4.19.20-1.el7ev.x86_64
virt-v2v-1.36.3-6.el7.x86_64
libguestfs-1.36.3-6.el7.x86_64

Steps:
1.Prepare a guest which is not listed storage pool
# virsh dumpxml avocado-vt-vm1

   
  
  
  
  

.
2.Try to import this guest in rhv4.1 from KVM host but failed to import the 
guest as screenshot and get error info from vdsm.log

2017-07-07 14:41:22,176+0800 ERROR (jsonrpc/6) [root] Error getting disk size 
(v2v:1089)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1078, in 
_get_disk_info
vol = conn.storageVolLookupByPath(disk['alias'])
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4555, in 
storageVolLookupByPath
if ret is None:raise libvirtError('virStorageVolLookupByPath() failed', 
conn=self)
libvirtError: Storage volume not found: no storage vol with matching path 
'/root/RHEL-7.3-x86_64-latest.qcow2'



3.Try to convert this guest to rhv by virt-v2v on v2v conversion server,could 
import the guest from export domain to data domain on rhv4.1 after finishing 
conversion
# virt-v2v avocado-vt-vm1 -o rhv -os 10.73.131.93:/home/nfs_export
[   0.0] Opening the source -i libvirt avocado-vt-vm1
[   0.0] Creating an overlay to protect the source from being modified
[   0.4] Initializing the target -o rhv -os 10.73.131.93:/home/nfs_export
[   0.7] Opening the overlay
[   6.1] Inspecting the overlay
[  13.8] Checking for sufficient free disk space in the guest
[  13.8] Estimating space required on target for each disk
[  13.8] Converting Red Hat Enterprise Linux Server 7.3 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  52.2] Mapping filesystem data to avoid copying unused and blank areas
[  52.4] Closing the overlay
[  52.7] Checking if the guest needs BIOS or UEFI to boot
[  52.7] Assigning disks to buses
[  52.7] Copying disk 1/1 to 
/tmp/v2v.Zzc4KD/c9cfeba7-73f8-428a-aa77-9a2a1acf0063/images/c8eb039e-3007-4e08-9580-c49da8b73d55/f76d16ea-5e66-4987-a496-8f378b127986
 (qcow2)
(100.00/100%)
[ 152.4] Creating output metadata
[ 152.6] Finishing off


Result:
So this problem is caused by vdsm or ovirt

Regards
Ming Xie

- Original Message -
From: "Richard W.M. Jones" 
To: "Matthias Leopold" 
Cc: us...@ovirt.org, libguestfs@redhat.com
Sent: Wednesday, July 5, 2017 9:15:16 PM
Subject: Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

On Wed, Jul 05, 2017 at 11:14:09AM +0200, Matthias Leopold wrote:
> hi,
> 
> i'm trying to import a VM in oVirt from a KVM host that doesn't use
> storage pools. this fails with the following message in
> /var/log/vdsm/vdsm.log:
> 
> 2017-07-05 09:34:20,513+0200 ERROR (jsonrpc/5) [root] Error getting
> disk size (v2v:1089)
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1078, in
> _get_disk_info
> vol = conn.storageVolLookupByPath(disk['alias'])
>   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4770,
> in storageVolLookupByPath
> if ret is None:raise libvirtError('virStorageVolLookupByPath()
> failed', conn=self)
> libvirtError: Storage volume not found: no storage vol with matching path
> 
> the disks in the origin VM are defined as
> 
> 
>   
>   
> 
> 
>   
>   
> 
> is this a virt-v2v or oVirt problem?

Well the stack trace is in the oVirt code, so I guess it's an oVirt
problem.  Adding ovirt-users mailing list.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs
2017-07-07 14:41:10,345+08 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmsNamesFromExternalProviderVDSCommand] (default task-8) [f8166d03-f053-4832-8833-aa39142385a5] START, GetVmsNamesFromExternalProviderVDSCommand(HostName = 10.66.144.40, GetVmsFromExternalProviderParameters:{runAsync='true', hostId='5081b809-0779-41ba-9c86-a01049e41ed4', url='qemu+tcp://10.66.4.242/system', username='root', originType='KVM', namesOfVms='null'}), log id: f703286
2017-07-07 14:41:11,412+08 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.GetVmsNamesFromExternalProviderVDSCommand] (default task-8) [f8166d03-f053-4832-8833-aa39142385a5] FINISH, GetVmsNamesFromExternalProviderVDSCommand, return: [VM [rhel7.4-v2v], VM [win10-v2v], VM [avocado-vt-vm1], VM [win2k12-file-virtio], VM [rhel7.4-home], VM [esx6.0-win2012-x86_64], VM [rhel6.9-4disk-lvm], VM [esx6.0-win7-x86_64], VM [Auto-esx6.0-win7-efi], VM [multiple-linux-lvm], VM [win10], VM 

Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

2017-07-07 Thread Ming Xie
I could reproduce customer's problem

Packages:
rhv:4.1.3-0.1.el7
vdsm-4.19.20-1.el7ev.x86_64
virt-v2v-1.36.3-6.el7.x86_64
libguestfs-1.36.3-6.el7.x86_64

Steps:
1.Prepare a guest which is not listed storage pool
# virsh dumpxml avocado-vt-vm1

   
  
  
  
  

.
2.Try to import this guest in rhv4.1 from KVM host but failed to import the 
guest and get error info from vdsm.log

2017-07-07 14:41:22,176+0800 ERROR (jsonrpc/6) [root] Error getting disk size 
(v2v:1089)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1078, in 
_get_disk_info
vol = conn.storageVolLookupByPath(disk['alias'])
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4555, in 
storageVolLookupByPath
if ret is None:raise libvirtError('virStorageVolLookupByPath() failed', 
conn=self)
libvirtError: Storage volume not found: no storage vol with matching path 
'/root/RHEL-7.3-x86_64-latest.qcow2'



3.Try to convert this guest to rhv by virt-v2v on v2v conversion server,could 
import the guest from export domain to data domain on rhv4.1 after finishing 
conversion
# virt-v2v avocado-vt-vm1 -o rhv -os 10.73.131.93:/home/nfs_export
[   0.0] Opening the source -i libvirt avocado-vt-vm1
[   0.0] Creating an overlay to protect the source from being modified
[   0.4] Initializing the target -o rhv -os 10.73.131.93:/home/nfs_export
[   0.7] Opening the overlay
[   6.1] Inspecting the overlay
[  13.8] Checking for sufficient free disk space in the guest
[  13.8] Estimating space required on target for each disk
[  13.8] Converting Red Hat Enterprise Linux Server 7.3 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  52.2] Mapping filesystem data to avoid copying unused and blank areas
[  52.4] Closing the overlay
[  52.7] Checking if the guest needs BIOS or UEFI to boot
[  52.7] Assigning disks to buses
[  52.7] Copying disk 1/1 to 
/tmp/v2v.Zzc4KD/c9cfeba7-73f8-428a-aa77-9a2a1acf0063/images/c8eb039e-3007-4e08-9580-c49da8b73d55/f76d16ea-5e66-4987-a496-8f378b127986
 (qcow2)
(100.00/100%)
[ 152.4] Creating output metadata
[ 152.6] Finishing off


Result:
So this problem is caused by vdsm or ovirt

Regards
Ming Xie

- Original Message -
From: "Richard W.M. Jones" 
To: "Matthias Leopold" 
Cc: us...@ovirt.org, libguestfs@redhat.com
Sent: Wednesday, July 5, 2017 9:15:16 PM
Subject: Re: [Libguestfs] virt-v2v import from KVM without storage-pool ?

On Wed, Jul 05, 2017 at 11:14:09AM +0200, Matthias Leopold wrote:
> hi,
> 
> i'm trying to import a VM in oVirt from a KVM host that doesn't use
> storage pools. this fails with the following message in
> /var/log/vdsm/vdsm.log:
> 
> 2017-07-05 09:34:20,513+0200 ERROR (jsonrpc/5) [root] Error getting
> disk size (v2v:1089)
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1078, in
> _get_disk_info
> vol = conn.storageVolLookupByPath(disk['alias'])
>   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4770,
> in storageVolLookupByPath
> if ret is None:raise libvirtError('virStorageVolLookupByPath()
> failed', conn=self)
> libvirtError: Storage volume not found: no storage vol with matching path
> 
> the disks in the origin VM are defined as
> 
> 
>   
>   
> 
> 
>   
>   
> 
> is this a virt-v2v or oVirt problem?

Well the stack trace is in the oVirt code, so I guess it's an oVirt
problem.  Adding ovirt-users mailing list.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs