| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reimplements parts of commit da0a4f8d1f6ddd302ceba028d87c6e009589e503
in a different, but compatible way.
We pass guestfs_vmchannel=tcp:<ip>:<port> on the command line. This
is intended to be used as follows (now and in future versions):
tcp:10.0.2.4:6666 for guestfwd vmchannel
tcp:10.0.2.2:<port> for future "no vmchannel" implementation
/dev/vcon4 for future virtio-console vmchannel*
It also accepts the old-style guestfs=10.0.2.4:6666 parameter which
is sent by older libraries, and turns this transparently into the
correct format above.
If no guestfs_vmchannel is passed, then this defaults to the guestfwd
vmchannel which older libraries would expect.
* Maybe this last one should be dev:/dev/vcon4 or file:/dev/vcon4, but
we don't need to decide that now.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
buf[], append[] and memsize_str[] were all temporary buffers
used in non-overlapping code.
Combine them to use a single buffer (buf[]).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Newer versions of qemu have changed the command line format
(again). '-net channel' is now deprecated. Instead we use:
-chardev socket,id=guestfsvmc,path=/path/to/sock,server,nowait
-net user,vlan=0,net=10.0.2.0/8,guestfwd=tcp:10.0.2.4:6666-chardev:guestfsvmc
-net nic,model=ne2k_pci,vlan=0
The old style format is still used if the new style is not
detected at runtime.
|
|
|
|
|
|
|
|
|
|
| |
Since we control the appliance tightly, we can just specify
that it will always use a particular host and port, and we
don't need to pass it on the command line each time.
Also the VMCHANNEL_* constants are only relevant to the
particular guestfwd vmchannel implementation, so we rename
them as GUESTFWD_*.
|
|
|
|
|
|
|
|
|
|
| |
Add the configure parameter --enable-packet-dump so that this
code can be enabled without editing the source.
This code is normally commented out, because it is too verbose
unless you happen to be debugging the underlying protocol. Because
it is normally commented out, I found it had bit-rotted slightly.
This commit also fixes the obvious problems.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit removes the external main loop, which never worked
and caused a number of bugs. Requests are now done synchronously,
and if the user wants to have requests issued in the background
or to have a responsive GUI, then they'll just have to use threads.
The big change is to push all reads and writes through two
functions called send_to_daemon (for writes) and recv_from_daemon
(for reads) which operate synchronously. These functions
read/write whole messages, and also handle checking for EOF
(ie. daemon died) and asynchronous log message events from
qemu (eg. from debug / dmesg printed by the guest). A more
complete description of how these work can be found in the code.
This code passes a complete run of the tests.
Bugs believed to be fixed by this commit:
https://bugzilla.redhat.com/show_bug.cgi?id=501888
internal error: reply callback called twice
https://bugzilla.redhat.com/show_bug.cgi?id=504418
In virt-inspector: "download: guestfs_download reply failed, see earlier error messages"
I have tried to avoid reintroducing this:
https://bugzilla.redhat.com/show_bug.cgi?id=508713
libguestfs: error: write: Broken pipe (guestfish only)
One other benefit of this is that 'set_busy/end_busy' calls
no longer appear in traces.
|
|
|
|
|
| |
This leaves trace enabled afterwards, resulting in some
ugly test messages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds the ability to group entries in a string list with single
quotes. So the string:
"'foo bar'"
becomes 1 token rather than 2. Consequently single quotes must now be escaped:
"\'"
resolves to a literal single quote.
Incidentally, this change also alters another, probably unintentional behaviour
of the previous implementation, in that tokens are separated by any amount of
whitespace rather than a single whitespace character. I.e.:
"a b"
resolves to:
'a' 'b'
rather than:
'a' '' 'b'
That last syntax can be used if an empty argument is still desired. Whitespace
is now also defined to include tabs.
parse_string_list can also now fail if it contains an unmatched open quote.
|
|
|
|
|
| |
Enable this by calling guestfs_trace (handle, 1) or by
setting the LIBGUESTFS_TRACE=1 environment variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously non-daemon actions were called directly by
user code, eg:
/* Non-generated */
int
guestfs_set_verbose (guestfs_h *g, int v)
{
g->verbose = !!v;
return 0;
}
This changes these actions so they go indirectly via
some generated code, eg:
/* Generated */
int guestfs_set_verbose (guestfs_h *g,
int verbose)
{
return guestfs__set_verbose (g, verbose);
}
/* Non-generated */
int
guestfs__set_verbose (guestfs_h *g, int v)
{
g->verbose = !!v;
return 0;
}
The aim is to have a place in the generated code where
we can add debug or tracing information for these non-
daemon calls.
|
|
|
|
|
| |
echo_daemon is a simple echo which can be used to test connectivity between the
client and daemon.
|
|
|
|
| |
Parsed string lists are allocated by malloc, but were never freed.
|
|
|
|
| |
* src/guestfs.h (guestfs_abort_cb): Declare with attribute noreturn.
|
|
|
|
|
| |
* src/guestfs.c (guestfs__receive_file_sync): Don't set "r",
only to ignore it.
|
|
|
|
|
|
| |
* src/generator.ml: Emit "unsigned long int n_failed;" rather than
"int failed;", to avoid warning from gcc about "assuming signed
overflow does not occur when simplifying conditional to constant".
|
|
|
|
|
| |
* src/generator.ml (emit_ocaml_copy_list_function): New function.
Emit a function definition only if it will be used.
|
|
|
|
|
|
|
|
|
| |
* src/generator.ml: Emit prototypes for ocaml_guestfs_* functions,
to avoid warnings from gcc -Wmissing-prototypes. Normally we'd put
these somewhere else, but in this unusual case, they're not needed
anywhere else. Handle the >5-argument case, too, for these:
ocaml_guestfs_test0_byte, ocaml_guestfs_sfdisk_byte,
ocaml_guestfs_sfdisk_N_byte.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we're using gnulib in earnest, any manual definition
would provoke a redefinition warning.
* fish/fish.c (_GNU_SOURCE): Don't define.
* fish/destpaths.c (_GNU_SOURCE): Likewise.
* src/guestfs.c (_GNU_SOURCE): Likewise.
* bootstrap (modules): Add asprintf, strchrnul, strerror, strndup
and vasprintf.
* fish/fish.c (main): Set argv[0] to sanitized program_name, so
functions like getopt_long that use argv[0] use the clean name.
|
| |
|
|
|
|
|
|
| |
* src/generator.ml (emit_print_list_function): Emit code that doesn't
evoke warnings. s/int/unsigned int/
(emit print_*_indent): Likewise, s/int/unsigned int/
|
|
|
|
| |
Was 256 for the old squashfs device.
|
|
|
|
|
| |
The squashfs format changes too much. Use an ISO file for
the tests instead.
|
|
|
|
|
|
|
| |
On RHEL 5, ext2 is compiled into the kernel, so trying to modprobe
it will fail. I've checked that fat.ko is always a module on the
platforms we care about (RHEL 5, Fedora 11, Debian), so use that
to test instead.
|
|
|
|
|
|
|
|
| |
* src/generator.ml: Fix this particular problem by
renaming the "module" parameter to "modulename".
Avoid the general problem by ensuring that no parameter name is
in the set of nearly all Haskell, OCaml and C reserved words.
(zfile): Adjust one more offender: s/method/meth/.
|
| |
|
|
|
|
|
| |
GCC 4.4.1 warns about some unused macros. Comment these out
while they are not used.
|
|
|
|
|
| |
* configure.ac: Define/configure it.
* src/Makefile.am: Use new variables.
|
|
|
|
|
|
|
| |
Even though these functions are marked as "not implemented yet",
and they will surely return a value once implemented, ...
* src/guestfs.c (select_add_timeout): Declare with noreturn attribute.
(select_remove_timeout): Likewise.
|
|
|
|
| |
* src/guestfs.c (guestfs_end_busy): Add a "default:" label.
|
|
|
|
|
| |
* src/guestfs.c [struct guestfs_h] (msg_in_size, msg_in_allocated):
(msg_out_size, msg_out_allocated): Change type from int to unsigned int.
|
|
|
|
| |
* src/guestfs.c (receive_file_data_sync, xread, xwrite): Use char*.
|
|
|
|
|
| |
* src/generator.ml (check_reply_header): Emit parameter declarations
that are unsigned, so as to avoid signed/unsigned-compare warnings.
|
|
|
|
| |
* src/guestfs.c (guestfs_launch): Handle dup failure.
|
|
|
|
|
|
|
|
|
| |
* bootstrap (modules): Add ignore-value.
* src/guestfs.c: Include "ignore-value.h".
(stdout_event): Ignore failure to write to stderr.
Also, prefer STDERR_FILENO over the literal "2".
* src/Makefile.am (libguestfs_la_CPPFLAGS): Include gnulib's .h files.
(libprotocol_la_CFLAGS): Remove -Wall -Wno-unused.
|
|
|
|
| |
Allow kernel modules to be loaded into the appliance.
|
|
|
|
| |
Move code which updates pod2text memo file into a separate function.
|
|
|
|
|
| |
* src/generator.ml: Do not emit functions like print_xattr,
print_lvm_vg, print_inotify_event, that are not used.
|
|
|
|
|
| |
* src/generator.ml (emit_print_list_function): New function.
Emit a function definition only if it will be used.
|
|
|
|
|
|
|
|
|
| |
* src/generator.ml: Avoid warnings in generated tests.c, regarding
print_strings, and in exercising any function that takes a StringList
or DeviceList parameter.
(print_strings): Change param type to "char *const *s".
Declare fully-const initializer for each list-taking function use.
Cast *List argument to "(char **)".
|
|
|
|
|
| |
* src/Makefile.am: Compile protocol.c into a convenience library, so it
can have its own CFLAGS, and link that with the destination one.
|
| |
|
|
|
|
| |
Missing declaration of local variable 'i'.
|
| |
|
|
|
|
| |
* src/generator.ml: Emit a few omitted newlines.
|