| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Try to get the host's loops_per_jiffy value and pass this on the
command line to the guest. In theory this should avoid the appliance
having to recalculate this value in a VM with TCG (which is generally
error-prone). This should avoid timing issues.
We only do this when we are certain that the guest will be TCG.
Currently we only have enough information to do this from the libvirt
attach-method. So mostly this will only affect people using Fedora in
a VM.
The host loops_per_jiffy value is not exported by the kernel. It is
only printed by the kernel early during boot, so if boot messages have
"scrolled off" the kernel ring buffer, it won't be available. Some
operating systems save early kernel messages in /var/log/dmesg but (a)
Fedora 18+ seem to have abandoned this file and (b) on Ubuntu this
file is unreadable for spurious "security" reasons.
I have submitted a patch to make lpj available through /proc/cpuinfo.
|
|
|
|
| |
Move this into a common file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New APIs: set-tmpdir, get-tmpdir, set-cachedir, get-cachedir.
The current code has evolved over time and has a number of problems:
(a) A single environment variable ($TMPDIR) controls the
location of several directories.
(b) It's hard for the library user to predict which directory
libguestfs will use, unless the user simulates the same internal steps
that libguestfs performs.
This commit fixes these issues.
(a) Now three environment variables control the location of all small
temporary files, and the appliance cache:
For temporary files: $LIBGUESTFS_TMPDIR or $TMPDIR or /tmp.
For the appliance cache: $LIBGUESTFS_CACHEDIR or $TMPDIR or /var/tmp.
The user can also set these directories explicitly through API calls
(guestfs_set_tmpdir and guestfs_set_cachedir).
(b) The user can also retrieve the actual directories that libguestfs
will use, by calling guestfs_get_tmpdir and guestfs_get_cachedir.
These functions are also used internally.
This commit also:
- reworks the internal tmpdir code
- removes the internal (undocumented) guestfs_tmpdir call (replacing
it with calls to the documented guestfs_get_tmpdir API instead)
- changes the ./run script to set LIBGUESTFS_TMPDIR and
LIBGUESTFS_CACHEDIR
- adds a test
- fixes a few places like libguestfs-make-fixed-appliance which
depended on $TMPDIR
|
| |
|
|
|
|
|
|
|
|
| |
New API: remove-drive.
Note because of a bug in fuser, this only works with psmisc >= 22.20.
This also updates the hotplugging tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When libvirt is used, we can allow disks to be hotplugged.
guestfs_add_drive can be called after launch to hot-add a disk.
When a disk is hot-added, we first ask libvirt to add the disk to the
appliance, then we make an internal call into the appliance to get it
to wait for the disk to appear (ie. udev_settle ()).
Hot-added disks are tracked in the g->drives array.
This also adds a test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New API: list-disk-labels
Allow the user to pass an optional disk label when adding a drive.
This is passed through to qemu / libvirt using the disk serial field,
and from there to the appliance which exposes it through udev,
creating a special alias of the device /dev/disk/guestfs/<label>.
Partitions are named /dev/disk/guestfs/<label><partnum>.
virtio-blk and virtio-scsi limit the serial field to 20 bytes. We
further limit the name to maximum 20 ASCII characters in [a-zA-Z].
list-devices and list-partitions are not changed: these calls still
return raw block device names. However a new call, list-disk-labels,
returns a hash table allowing callers to map between disk labels, and
block device and partition names.
This commit also includes a test.
|
|
|
|
| |
Using an array simplifies the implementation of hotplugging.
|
|
|
|
| |
This can be used by the attach-method, eg. for libvirt-only data.
|
|
|
|
|
| |
Because we create a special file, there is no point forcing qemu
to create an overlay as well. Save time by setting readonly = 0.
|
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The second parameter to 'config' may be NULL.
In commit 52fa23d74f6308daf804c2330b0b27e0b4412594 (refactoring of
guestfs_config) the code this got lost, and guestfs_config would
segfault if qemu_value was NULL.
Also this fixes the libvirt method to handle the same case.
I checked libguestfs-1.18 and -1.16 branches, and this problem does
NOT affect them.
|
|
|
|
|
|
|
| |
Since this is the most common error seen by people who have
installation problems, buggy qemu, etc, and since no one reads the
FAQ, describe in this error message what resources are available to
debug launch problems.
|
| |
|
|
|
|
|
| |
This is a workaround for a bug with virtio-scsi in qemu 1.2:
https://bugzilla.redhat.com/show_bug.cgi?id=847549
|
|
|
|
|
|
| |
function.
This is just code motion / simplification.
|
|
|
|
|
|
| |
This lets us create g->tmpdir lazily earlier if needed.
This commit is just code motion.
|
|
|
|
| |
attach-method.
|
|
|
|
| |
It should work with any attach-method.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Complete the attach-method libvirt backend.
This backend uses libvirt to create a transient KVM domain to run the
appliance.
Note that this still will only work with local libvirt URIs since the
<kernel>, <initrd> and appliance links in the libvirt XML refer to
local files, and virtio serial only works locally (limitation of
libvirt). Remote support will be added later.
|
|
|
|
|
| |
With this commit, you can set the attach method to libvirt,
but calling launch will give an error.
|
|
|
|
|
|
| |
g->attach_ops points to a structure which contains the
operations supported by each attach method backend
(ie. appliance, unix, etc.).
|
|
|
|
|
|
| |
Move and rewrite guestfs_config so it accumulates a list of qemu
parameters in the handle. These are added to the appliance at launch
time (with attach method == unix:... you'll now get an error).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
launch-appliance.c contains the code associated with the 'appliance'
attach-method. Mostly. In fact there are a few APIs which don't fit
so nicely:
- config: deprecated API which fiddles with the qemu command
line directly
- max-disks: depends on the qemu implementation (virtio-scsi
or not)
- debug-drives: used for testing only
launch-unix.c contains the code associated with 'unix:<path>'.
launch.c is the common code for launching, along with a few other APIs
such as guestfs_add_drive_opts.
This commit also reduces the number of headers to just those
which are required.
|
|
|
|
|
| |
Note that debug* calls are not part of the stable API and can be
removed or changed at any time.
|
|
|
|
|
|
| |
By using the once_had_no_optargs flag, this change is backwards
compatible for callers (except Haskell, PHP and GObject as discussed
in earlier commit).
|
|
|
|
|
|
| |
This reverts commit 6e5a85bb9b6557bc337625a339728e23f5f2dd94.
It turns out this is a bug in QEMU after all.
|
|
|
|
|
|
|
| |
https://bugs.launchpad.net/qemu/+bug/1021649 is invalid, probably
caused by a Fedora ROM.
This updates commit 52d188e32fb8addb45bf926df07e34ab35898f85.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new API splits orderly close into a two-step process:
if (guestfs_shutdown (g) == -1) {
/* handle the error, eg. qemu error */
}
guestfs_close (g);
Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors. Read the documentation for further information.
This change also:
- deprecates guestfs_kill_subprocess
- turns guestfs_kill_subprocess into the same as guestfs_shutdown
- changes guestfish and other tools to call shutdown + close
where necessary (not for read-only tools)
- updates documentation
- updates examples
|
|
|
|
| |
This is just a comment and has no functional effect.
|
|
|
|
|
| |
Note that qemu treats these identically, so this change has
no functional effect.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The stdin and stdout of the qemu process are aliased to g->fd:
g->fd[0] = wfd[1];
g->fd[1] = rfd[0];
However if the child exits early, then child_cleanup closes g->fd[0],
g->fd[1], AND the code at the cleanup1 label closes wfd[1], rfd[0],
resulting in a double-close.
Avoid this case by setting wfd[1], rfd[0] to -1. In the cleanup1
label, only close wfd[1], rfd[0] if they are not -1, and add the same
for g->fd[0], g->fd[1].
|
| |
|
|
|
|
| |
This fixes commit ef5c02c6ee72eb8e127115923951777a2c2b8480.
|
| |
|
|
|
|
|
|
|
|
|
| |
Old KVM can't add /dev/null readonly. Treat /dev/null as a special
case.
We also fix a few tests where /dev/null was being used with
format=qcow2. This was always incorrect behaviour, but qemu appears
to tolerate it.
|
|
|
|
| |
This fixes commit 295d6af48d1d8c5238d1536b0c6a2ece42b0b445.
|
|
|
|
|
| |
In Koji, when you've got 200+ disks, udev times out before all the
udev events have been processed.
|
|
|
|
| |
Returns the maximum number of disks that may be added to a handle.
|
|
|
|
| |
This fixes commit 0c0a7d0d868d153adf0600189f771459e1068b0a.
|
|
|
|
| |
This requires febootstrap >= 3.15.
|
|
|
|
|
| |
This allows us to find out what qemu devices are supported
at runtime.
|
|
|
|
|
|
|
|
|
|
|
| |
QEMU 1.0 was released at the end of 2011.
Remove all the cruft about detecting broken -machine type which
was only required for QEMU 0.15.
This also reverts commit 30ecbf3ec2ada68f7e125a180553e31b069033b7.
Even on ARM you can pass -machine accel=kvm:tcg and qemu does the
right thing, so I'm not sure why we wanted to disable that.
|
|
|
|
|
|
|
|
|
|
|
|
| |
These were used to select the default drive and network interface.
They both default to 'virtio'.
These were added back in the day when virtio was buggy, so that
packagers could revert to using ide/ne2k_pci to work around distro
bugs. However virtio has been stable in qemu for a very long time, so
it seems unlikely that any packager would need to use these, and in
any case it would be better to do this detection at runtime (cf. for
virtio-scsi).
|
|
|
|
| |
No functional change.
|
| |
|
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
|
| |
This flag allows extra QEMU options to be passed on the command line.
This is useful mainly on arm (see the notes in the updated README
file).
|