| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(cherry picked from commit ce18be33cd5279a8d4120eedd037400c275585c0)
|
|
|
|
|
| |
pclose can return > 0 when the status of the command was non-zero.
(cherry picked from commit 631faad97171d7c1238b2e413c663cf61476f440)
|
|
|
|
|
| |
In particular pclose returns a status > 0 if the command fails.
(cherry picked from commit a24652c7b27e8494268ccb6c9a5a2e5541ba5efd)
|
|
|
|
| |
(cherry picked from commit 2ace9be4cd69e84cd88e5b0fd74de861a4973c91)
|
|
|
|
|
|
| |
This refactors the code in test_qemu slightly to ensure that
FILE *fp is not leaked on error paths.
(cherry picked from commit 08e77ad8cb4e8ac70d4217ebd5d236eba81645b5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default event handler in libguestfs was simply writing all debug
output directly to stderr. However if the output contains
non-printable characters such as terminal control codes then these
would also be sent directly.
With newer SeaBIOS there is a lame attempt to implement a splash
screen using terminal control codes, thus when libguestfs tries to
display debugging output it would cause the screen to clear and debug
output to be lost.
This commit causes all non-printing characters to be escaped.
(\n and \r characters from the appliance are treated somewhat
specially).
Furthermore, instead of using write(2), use buffered stderr calls.
(cherry picked from commit 06019bc82e107f7715ebc59e491610e06dad1e39)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously any disk that had /autoexec.bat or /boot.ini or /ntldr
would be picked up as a candidate for a Windows root disk. If further
checking could not find any systemroot (eg. /windows) then this would
result in complete failure of inspection.
In particular, this got confused by Hp_recovery partitions which have
/autoexec.bat, but don't have a systemroot in one of the usual places
(they have /MiniNT instead).
What we do now is to properly investigate all possible systemroot
places before deciding this is a Windows systemroot, so the subsequent
failure cannot occur.
(Thanks to lorimar for reporting this bug).
Cherry picked from commit 2c57305f72cd6181d1849ae6e1b892aa01c7f844
and backported to stable-1.10 branch.
|
|
|
|
|
| |
It always has done. The documentation was wrong.
(cherry picked from commit 70f44cc0ea0bcdd025ed657461e07f6778be44ba)
|
|
|
|
| |
(cherry picked from commit 3cf31c2fe0b356ea5c04117c5235b0a3cfe34971)
|
|
|
|
| |
(cherry picked from commit bad3f4b54a959685f3c0697238fc5753096834fb)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the blkid command returns 2, that means the value was not found.
Note that this changes the output of the vfs-type API when the
filesystem has no type (eg when it is empty). Previously this would
return an error. Now it returns empty string "".
We did not document this either way. Making it return empty string is
consistent with vfs-label and vfs-uuid.
This change broke list-filesystems, since that code was assuming that
vfs-type could only return a filesystem type or an error.
(cherry picked from commit 168fd4ad5d1e5da93e11388095d41aaa8f804ceb)
|
|
|
|
| |
(cherry picked from commit 8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55)
|
|
|
|
| |
(cherry picked from commit 70daccfe4e9939078436c2830928d8e53432dd84)
|
|
|
|
| |
(cherry picked from commit a548c9668315844763456c15e89e35e9702b851a)
|
|
|
|
|
|
| |
Not that I'm paranoid about qemu breaking snapshots of anything like
that ...
(cherry picked from commit f3ada2c7653866f2529c9f18aaa99f76cd984844)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous guestfs___download_to_tmp function did not handle
multiboot correctly. In particular it used the same cache name
for downloaded files from different roots, which could have caused
things like applications in each root to be confused.
This changes the function so that the cache filename is prefixed
with the root / fs number, eg. $tmpdir/0-Name instead of $tmpdir/Name.
This change also requires the function to return the new name, so
all places in the code which called this function had to be
updated.
This updates and fixes commit 3c1f762abed92f7a358f3bc93e3396d0606b18ad.
(Cherry picked and backported from
commit 5f26270c343bf543a7bf20cf3e6f182f6282f8ea)
|
|
|
|
| |
(cherry picked from commit daf55c07978cd29fe6675911bf76da0b056fdae1)
|
|
|
|
|
|
| |
Make this error more informative, since it is a common error when the
appliance fails to start up.
(cherry picked from commit 2f73ea343cc4a3433f20e99a7835152767a70f80)
|
|
|
|
| |
(Cherry picked from commit 64841fe8957f798df12a38bd81843c7011f2c278)
|
|
|
|
|
|
|
|
|
| |
Because of the previous change to size_t, when pos == 0 the loop would
wrap around and cause a segmentation fault.
This fixes a regression introduced by
commit 10167cea98f93a74abe63f0a54d3a662997e7489.
(cherry picked from commit 607aa95de927b5b8e4b212655c71bf21acbba372)
|
|
|
|
| |
(cherry picked from commit 805e6dbc15eae5a4f85eea3c37e295aefaefeb69)
|
|
|
|
| |
(cherry picked from commit 40f2b698ac765128bfcda5f0db893c95d09ae89a)
|
|
|
|
| |
(cherry picked from commit 108d7a134c5d26b967fa7162d9b80b40112c2869)
|
|
|
|
| |
(cherry picked from commit a5e421570cc840f70f2931e24b3df40c9a14cd2d)
|
|
|
|
| |
(cherry picked from commit 470e373eea218c8d46b0c63dda93ee9ece48940f)
|
|
|
|
| |
(cherry picked from commit dd86183f3f6d4d5ad28e1f12c56ba920934e7ad0)
|
|
|
|
| |
(cherry picked from commit 10167cea98f93a74abe63f0a54d3a662997e7489)
|
|
|
|
|
| |
This is just code motion.
(cherry picked from commit 478b2d80ed1d613f621e89a97a0b140004ebac29)
|
|
|
|
| |
(cherry picked from commit b2f8627ab59daeb03f036dde6c66fb9da736950c)
|
|
|
|
| |
(cherry picked from commit c0f96e9c6eda77e5e99de862dd4366010e4a1ab8)
|
|
|
|
|
|
| |
The virt-v2v transfer ISO had a /windows directory. The core
inspection code thought this was a Windows root filesystem.
(cherry picked from commit 0da6f55a6745686ca056c6bc8ebf647f111cb8e8)
|
|
|
|
|
|
| |
virt-inspector would exit silently if list-applications failed along
this error path.
(cherry picked from commit 782f3a36469ca396dbf998ea82af2699153be3ed)
|
|
|
|
|
| |
Previously we returned "rhel" for these, which was not accurate.
(cherry picked from commit 2b0ca7e7b8d369a42a51b1feec72ae8f17257c78)
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two changes here:
(1) The code for listing RPM applications ran db_dump and parsed the
output. We abstract out that parsing code into a separate reusable
module (src/dbdump.c).
(2) The old db_dump parsing code used db_dump -p (printable) format.
Instead use db_dump -k (hex) format so we can read binary fields.
(cherry picked from commit a986e8dadb0c70634f6d1d89dd3e7bb5d9af3078)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The src/inspect.c file had grown rather large -- 3,500 lines. Split
it across several files according to function.
This is just moving code.
After the split the files are more evenly divided:
536 src/inspect_apps.c
766 src/inspect.c
537 src/inspect_fs.c
404 src/inspect_fs_cd.c
785 src/inspect_fs_unix.c
535 src/inspect_fs_windows.c
3563 total
(cherry picked from commit 3336b5448f12c9eb25bf7a0cecda1315c4cf07ea)
|
|
|
|
|
| |
This is just moving code around.
(cherry picked from commit 439a42efdb052748c8457f866b2c68a581034826)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During inspection we download various files such as the Windows
'software' and 'system' registries. Previously these were downloaded
as temporary files and discarded immediately after use. This meant
that the 'software' registry was being downloaded twice by
virt-inspector (it's required once for basic OS inspection, and a
second time to list Windows applications).
This commit changes this so that these files are cached in g->tmpdir,
and thus the second time we just reuse the file we've already
downloaded.
Callers shouldn't be relying on inspect-list-applications to reread
the actual registry from the VM (unless you close and reopen the
handle). It says in the documentation that the results of inspection
may be cached in the handle.
(cherry picked from commit 3c1f762abed92f7a358f3bc93e3396d0606b18ad)
|
|
|
|
|
|
|
|
|
| |
In preparation for caching inspection information in the temporary
directory (g->tmpdir), allow the temporary directory to contain
arbitrary files, and remove all of them when the handle is closed.
This just generalizes the previous method of cleaning up the tmpdir.
(cherry picked from commit 70975981bed8e0c01b5966c10b507bb82086e5f8)
|
|
|
|
|
| |
* src/events.c: Include <string.h>, for use of strlen.
(cherry picked from commit a53833fdd21cd573fe8fd02d7a11a3a5e9764ce0)
|
|
|
|
| |
We can now get drive letter mappings through the inspection API.
|
|
|
|
| |
Found using valgrind.
|
|
|
|
|
| |
rpcgen generates source which can't be safely compiled with strict-aliasing
enabled.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This returns the drive mappings from the Windows Registry.
virt-inspector displays the drive mappings, giving output
similar to this:
<drive_mappings>
<drive_mapping name="C">/dev/sda2</drive_mapping>
<drive_mapping name="E">/dev/sdb1</drive_mapping>
</drive_mappings>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
A more accurate description of what this function does.
This is just code motion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces a new form of progress event, where we don't know how
much of the operation has taken place, but we nevertheless want to
send back some indication of activity. Some progress bar indicators
directly support this, eg. GtkProgressBar where it is known as "pulse
mode".
A pulse mode progress message is a special backwards-compatible form
of the ordinary progress message. No change is required in callers,
unless they want to add support for pulse mode.
The daemon sends:
- zero or more progress messages with position = 0, total = 1
- a single final progress message with position = total = 1
Note that the final progress message may not be sent if the call fails
and returns an error. This is consistent with the behaviour of
ordinary progress messages.
The daemon allows two types of implementation. Either you can just
call notify_progress (0, 1); ...; notify_progress (1, 1) as usual.
Or you can call the functions pulse_mode_start, pulse_mode_end and/or
pulse_mode_cancel (see documentation in daemon/daemon.h). For this
second form of call, the guarantee is very weak: it *just* says the
daemon is still capable of doing something, and it doesn't imply that
if there is a subprocess that it is doing anything. However this does
make it very easy to add pulse mode progress messages to all sorts of
existing calls that depend on long-running external commands.
To do: add a third variant that monitors a subprocess and only sends
back progress messages if it's doing something, where "doing
something" might indicate it's using CPU time or it's printing output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit generates approximate progress messages during the
guestfs_launch call. Currently this code generates:
0 / 12: launch clock starts
3 / 12: appliance created
6 / 12: detected that guest kernel started
9 / 12: detected that /init script is running
12 / 12: launch completed successfully
(Note this is not an ABI and may be changed or removed in a future
version).
Progress messages are only generated at all if 5 seconds have elapsed
since the launch, and they are only generated for the ordinary
appliance (not if using attach-method to attach to an existing virtio
serial port).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As explained in the comment:
/* QEMU's console emulates a 16550A serial port. The real 16550A
* device has a small FIFO buffer (16 bytes) which means here we see
* lots of small reads of 1-16 bytes in length, usually single
* bytes. Sleeping here for a very brief period groups reads
* together (so we usually get a few lines of output at once) and
* improves overall throughput, as well as making the event
* interface a bit more sane for callers. With a virtio-serial
* based console (not yet implemented) we may be able to remove
* this. XXX
*/
|
|
|
|
| |
This is just code motion.
|
|
|
|
| |
This is just code motion.
|