| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
Error: NULL_RETURNS:
/builddir/build/BUILD/libguestfs-1.16.5/examples/virt-dhcp-address.c:129: var_assigned: Assigning: "guest_distro" = null return value from "guestfs_inspect_get_distro".
/builddir/build/BUILD/libguestfs-1.16.5/examples/virt-dhcp-address.c:131: dereference: Dereferencing a pointer that might be null "guest_distro" when calling "__coverity_strcmp".
[...]
/builddir/build/BUILD/libguestfs-1.16.5/examples/virt-dhcp-address.c:126: var_assigned: Assigning: "guest_type" = null return value from "guestfs_inspect_get_type".
/builddir/build/BUILD/libguestfs-1.16.5/examples/virt-dhcp-address.c:128: dereference: Dereferencing a pointer that might be null "guest_type" when calling "__coverity_strcmp".
|
|
|
|
|
| |
Running this on a disk image displays the guest icon
(using external 'display' program).
|
|
|
|
|
|
| |
do a code cleanup by removing the tailing spaces
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
|
|
|
|
| |
Update all copyright dates to 2012.
|
| |
|
| |
|
|
|
|
| |
This contains suggested manual tests that users can run.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This returns the actual registry key corresponding to
CurrentControlSet (eg. it might be "ControlSet001").
Previously the inspection code was hard-coding ControlSet001. Now we
use the correct control set, and also make it available to callers
through the API.
This commit also updates the virt-dhcp-address example so it uses this
new API.
virt-inspector displays the current control set when available.
|
|
|
|
|
|
| |
This is like the mythical 'virt-ifconfig'. There is not enough
certainty around the right way to be doing this for us to make
a full virt tool for this. Therefore the code is just an example.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix guestfish (and other C tools) so that they ignore errors
when /etc/fstab contains bogus entries.
Update the documentation for inspect-get-mountpoints to emphasize
that callers must be aware of this when mounting the returned
values.
Add a regression test.
Update the example code ("inspect_vm") to reflect the way this
API ought to be called.
For more detail see:
https://bugzilla.redhat.com/show_bug.cgi?id=668574
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This large commit changes the generator so that optional arguments
can be supported for functions.
The model for arguments (known as the "style") is changed from
(ret, args) to (ret, args, optargs) where optargs is a more limited
list of arguments.
One function has been added which takes optional arguments, it is
"add-drive-opts", modelled as:
(RErr, [String "filename"], #required
[Bool "readonly"; String "format"; String "iface"]) #optional
Note that this function is processed in the library (does not go over
the RPC protocol to the daemon). This has allowed us to simplify
the current implementation by omitting changes related to RPC or the
daemon, although we plan to add these at some point in the future.
From C this function can be called in 3 different ways as in these
examples:
guestfs_add_drive_opts (g, filename,
GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,
GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
-1);
(the argument(s) between 'filename' and '-1' are the optional ones).
guestfs_add_drive_opts_va (g, filename, args);
where 'args' is a va_list. This works like the first version.
struct guestfs_add_drive_opts_argv optargs = {
.bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK,
.readonly = 1,
}
guestfs_add_drive_opts_argv (g, filename, &optargs);
This last form lets you construct lists of optional arguments, and
is used by guestfish and the language bindings.
In guestfish optional arguments are used like this:
add-drive-opts filename readonly:true
In OCaml these are mapped naturally to OCaml optional arguments, eg:
g#add_drive_opts ~readonly:true filename;
In Perl these are mapped to extra arguments, eg:
$g->add_drive_opts ($filename, readonly => 1);
In Python these are mapped to optional arguments, eg:
g.add_drive_opts ("file", readonly = 1, format = "qcow2")
In Ruby these are mapped to a final hash argument, eg:
g.add_drive_opts("file", {})
g.add_drive_opts("file", :readonly => 1)
g.add_drive_opts("file", :readonly => 1, :iface => "virtio")
In PHP these are mapped to extra parameters. This is not quite
accurate since you cannot omit arbitrary optional parameters, but
there's not much than can be done within the limitations of PHP
as a language.
Unimplemented in: Haskell, C#, Java.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert all uses automatically, via these two commands:
git grep -l '\<exit *(1)' \
| grep -vEf .x-sc_prohibit_magic_number_exit \
| xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/'
git grep -l '\<exit *(0)' \
| grep -vEf .x-sc_prohibit_magic_number_exit \
| xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/'
* .x-sc_prohibit_magic_number_exit: New file.
Edit (RWMJ): Don't change Java code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds an explicit dependency on generator.ml for every file it
generates, except java files. Java is left for another time because it's
considerably trickier.
It also adds a build rule for src/libguestfs.la so it can be rebuilt as required
from other directories.
It does this by creating a top level make file, subdir-rules.mk, which can be
included from sub-directories. sub-directories need to define 'generator_built'
to include local files which are built by generator.ml, and they will be updated
automatically.
This fixes parallel make, and will automatically re-create generated files when
make is run from any directory.
It also fixes the problem which efad4f53 was targetting. Specifically,
src/guestfs_protocol.(c|h) had an erroneous dependency on stamp-generator, and
therefore generator.ml, despite not being directly created by it. This caused
them to be recreated every time generator.ml ran rather than only when
src/guestfs_protocol.x was updated, which cascaded into a daemon and therefore
appliance update.
This patch also changes the contents of the distribution tarball by including
files created by rpcgen.
|
| |
|
|
|
|
|
| |
git grep -l 'strcmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
|
|
|
|
|
| |
git grep -l 'strncmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
|
|
|
|
|
| |
git grep -l 'strncmp *([^=]*!= *0'|xargs \
perl -pi -e 's/\bstrncmp( *\(.*?\)) *!= *0/STRNEQLEN$1/g'
|
|
|
|
|
| |
Since this program is just an example, it shouldn't require
the Gnulib c-ctype functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros.
* fish/tilde.c: Remove unnecessary inclusion of ctype.h.
* bootstrap: Add gnulib's c-ctype module to the list.
* daemon/m4/gnulib-cache.m4: Likewise.
* daemon/ext2.c: Include "c-ctype.h", not <ctype.h>.
Use c_isspace, etc, rather than isspace.
* daemon/guestfsd.c: Likewise.
* daemon/lvm.c: Likewise.
* daemon/proto.c: Likewise.
* fish/fish.c: Likewise.
* fish/tilde.c: Likewise.
* src/generator.ml: Likewise.
* src/guestfs.c: Likewise.
* examples/to-xml.c: Likewise.
* examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib
so inclusion of "c-ctype.h" works.
(to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes guestfs_launch so that it both launches
the appliance and waits until it is ready (ie. the daemon communicates
back to us).
Since we removed the pretence that we could implement a low-level
asynchronous API, the need to call launch() followed by wait_ready()
has looked a bit silly.
Now guestfs_wait_ready() is basically a no-op. It is left in the
API for backwards compatibility. Any calls to guestfs_wait_ready()
can be removed from client code.
|
|
|
|
|
|
|
|
|
|
|
| |
Do it by running this command:
[exempted files are matched via .x-sc_TAB_in_indentation]
git ls-files \
| pcregrep -vf .x-sc_TAB_in_indentation \
| xargs pcregrep -l '^ *\t' \
| xargs perl -MText::Tabs -ni -le \
'$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
|
|
|
|
|
| |
* examples/hello.c [HAVE_CONFIG_H]: Include <config.h> conditionally.
* examples/to-xml.c: Likewise.
|
|
|
|
|
|
| |
* ocaml/guestfs_c.c: Include <config.h>.
* examples/to-xml.c: Likewise.
* examples/hello.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch allows you to do:
mkdir build
cd build
../configure ...
make
This will output all generated files to the build directory. Given that
autogen automatically runs configure, you can also do:
BUILDDIR=./build ./autogen.sh
which will do the right thing.
Also:
* Fix a dependency bug which means that guestfs_protocol.h
isn't automatically rebuilt.
* Re-running autogen.sh with no arguments won't blow away your previous
configure arguments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hi Rich,
automake's policy on what to remove via "make clean" is reasonable:
if running build rules creates it, then "make clean" can and should remove it.
However, even if build rules happen
to create backup files, please remove only the specific ones
they can create, not all of the ones in a directory. Just in case
someone relies on those and expect them to hang around...
>From 1e8be391ac17b4ddcf9671e8413d2660844e6993 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Thu, 30 Apr 2009 15:47:52 +0200
Subject: [PATCH] build: don't tell "make clean" to remove my '~' backup files
* Makefile.am (CLEANFILES): Don't remove '~' backup files.
* daemon/Makefile.am: Ditto.
* examples/Makefile.am: Ditto.
* fish/Makefile.am: Ditto.
* images/Makefile.am: Ditto.
* inspector/Makefile.am: Ditto.
* java/Makefile.am: Ditto.
* ocaml/Makefile.am: Ditto.
* ocaml/examples/Makefile.am: Ditto.
* perl/Makefile.am: Ditto.
* python/Makefile.am: Ditto.
* ruby/Makefile.am: Ditto.
* src/Makefile.am: Ditto.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|