summaryrefslogtreecommitdiffstats
path: root/appliance
Commit message (Collapse)AuthorAgeFilesLines
* lib: Rework temporary and cache directory code.Richard W.M. Jones2012-11-091-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* appliance: Add 99-guestfs-serial.rules to EXTRA_DIST.1.19.49Richard W.M. Jones2012-10-091-0/+1
| | | | This fixes commit 7786d56db8c22413949f98ef6b15fe0ea367d195.
* launch: Add add_drive 'label' option.Richard W.M. Jones2012-10-082-1/+38
| | | | | | | | | | | | | | | | | | | | | 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.
* build: Use 'tmp-d' as name of temporary directory instead of 'tmp'.Richard W.M. Jones2012-10-061-6/+6
| | | | | | | When building supermin.d/daemon.img, use 'tmp-d' instead of 'tmp' as the name of the temporary directory. This is just code motion.
* New APIs: hivex_*Richard W.M. Jones2012-08-291-0/+3
| | | | | | | | | | | Transscribe many hivex(3) APIs into the libguestfs API. There is one hive handle per libguestfs handle, as with Augeas. Note that hivex uses iconv_open for some APIs (eg. hivex_value_string). But since we delete all the i18n files from the appliance, this doesn't work -- iconv_open returns EINVAL. Therefore hivex APIs which require iconv cannot be bound in the daemon.
* podwrapper: Add --license parameter, which is required.Richard W.M. Jones2012-08-211-0/+1
| | | | | | | | | | This adds standard LICENSE and BUGS sections to all of the man pages that are processed by podwrapper. Modify all the calls to $(PODWRAPPER) to add the right --license parameter according to the content. Note that this relaxes the license on some code example pages, making them effectively BSD-style licensed.
* man pages: Ensure consistent copyright/author sections, remove licenseRichard W.M. Jones2012-08-211-15/+0
| | | | | | | | | | section. Ensure each man page contains consistent COPYRIGHT and AUTHOR sections. Remove the LICENSE section. We will add that back in podwrapper in a later commit.
* Even on Debian, the package containing the diff binary it has been diffutils ↵Hilko Bengen2012-08-151-3/+1
| | | | | | for two years. There had been a virtual package "diff" that depended on diffutils, but that's gone in wheezy/sid, too.
* appliance: Add rsync and openssh-client{,s} to the appliance.Richard W.M. Jones2012-08-041-0/+3
| | | | | | This adds ~10M to the appliance (328M -> 338M). However for virt-rescue these are frequently requested tools.
* appliance: Exclude kernel* packages explicitly.Richard W.M. Jones2012-07-301-4/+9
| | | | | febootstrap >= 3.19 will no longer exclude the kernel package by default.
* libguestfs-make-fixed-appliance: Don't reference obsolete development version.Richard W.M. Jones2012-07-301-1/+1
|
* build: Change how make.sh, packagelist, excludelist are updated.Richard W.M. Jones2012-07-181-6/+9
| | | | | | Add proper dependencies for these files, but also use 'cmp' to ensure they only get overwritten if the new files have actually changed, so we don't rebuild the appliance unnecessarily.
* build: Change calls to podwrapper.sh to use $(PODWRAPPER).Richard W.M. Jones2012-07-161-1/+1
| | | | | This will allow us to easily change the location of this script in future.
* appliance: Update paths to udevd.Richard W.M. Jones2012-07-021-1/+3
| | | | | systemd is playing a WTF game with udevd, moving it around and renaming it unnecessarily in each release. Chase all known locations.
* appliance: Update comment to note that systemd package now contains udevd.Richard W.M. Jones2012-07-021-1/+1
|
* build: Define builddir and abs_srcdir when they are missing.Richard W.M. Jones2012-06-181-0/+3
| | | | | | | | | | | | | | | | | | | | | RHEL 5-era autoconf did not define these, so define them manually when they are missing. Define builddir as '.' The scripts require this. It won't work in the srcdir != builddir case, but we don't care about that for RHEL 5. This commit also moves the builddir / abs_srcdir variable setting above the include of subdir-rules.mk, in case that include uses these variables. Useful script: for f in $(find -name Makefile.am | xargs fgrep '$(abs_srcdir)' -l) ; do if ! grep -q '^abs_srcdir' $f; then echo missing in $f fi done
* virtio-scsi: Increase udev timeout.Richard W.M. Jones2012-06-141-1/+1
| | | | | In Koji, when you've got 200+ disks, udev times out before all the udev events have been processed.
* appliance: Add lsscsi to package list.Richard W.M. Jones2012-06-131-0/+1
|
* appliance: 'udevd' has been renamed, since it joined systemd.Richard W.M. Jones2012-05-281-28/+29
|
* appliance: Move udev (common package name) to the common section.Richard W.M. Jones2012-05-281-3/+1
| | | | This should be just code motion.
* appliance: Include 'bzip2' in appliance (RHBZ#824716).Richard W.M. Jones2012-05-241-0/+1
| | | | | | | | Missing package caused this error in compress-device-out: libguestfs: error: compress_device_out: compression type bzip2 is not supported Thanks Mohua Li.
* appliance: Remove some unnecessary errors.Richard W.M. Jones2012-04-251-2/+4
| | | | | | | | | | | | virt-rescue prints errors such as: rm: cannot remove `/proc': Is a directory mkdir: cannot create directory `/proc': File exists rm: cannot remove `/sys': Is a directory mkdir: cannot create directory `/sys': File exists People have reported these errors (which are nothing to worry about) as bugs in the past, so avoid them where possible.
* Fix libguestfs-make-fixed-appliance --help option so it displays usage.Richard W.M. Jones2012-04-091-1/+3
| | | | Previously it printed 'Internal error!'
* Fix out-of-tree build for applianceHilko Bengen2012-03-281-1/+1
|
* appliance: Add a tool to make fixed appliances.Richard W.M. Jones2012-03-173-1/+355
|
* appliance: Include genisoimage in the appliance.Richard W.M. Jones2012-03-161-0/+1
| | | | | This is mainly useful for the 'isoinfo' tool, but 'genisoimage' itself may be interesting to have in future.
* Add guestfsd.suppressions file to EXTRA_DIST.1.17.17Richard W.M. Jones2012-03-141-2/+3
|
* appliance: Enhance --enable-valgrind-daemon with a suppressions file.Richard W.M. Jones2012-03-143-3/+26
| | | | This lets us suppress errors in system libraries.
* Test fails in arch linuxNikos Skalkotos2012-03-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --20cf303ea4a84a7a7c04ba331375 Content-Type: text/plain; charset=ISO-8859-1 Hello Richard, I found what the problem was and the udev symlinks where not created. The init script in the appliance uses a full paths for udevadm (/sbin/udevadm) which in my case was wrong. In Arch Linux udevadm is hosted under /usr/bin, not /sbin. When I fixed this, libguestfs was able to communicate with the appliance VM. Since PATH variable is defined and exported in init, there is no need in using full paths for external programs. As far as I've seen this affects all the git branches in libguestfs's repository. Please find attached a patch for the master branch. Nikos Skalkotos, Athens, Greece On 24 February 2012 10:25, Richard W.M. Jones <rjones@redhat.com> wrote: > On Thu, Feb 23, 2012 at 08:50:12PM +0200, Nikos Skalkotos wrote: > [...] > > I don't know specifically why it fails with ArchLinux, but the problem > is caused by the /dev/virtio-ports/* symlinks not getting created by > udev. > > /dev/vport0p1 exists: > > > crw------- 1 root root 252, 1 Feb 23 18:17 vport0p1 > > but udev doesn't make the corresponding /dev/virtio-ports symlink: > > > /dev/virtio-ports/org.libguestfs.channel.0: No such file or directory > > The symlink is supposed to be created by this udev rule: > > /lib/udev/rules.d/50-udev-default.rules:KERNEL=="vport*", > ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" > > So I'd start by looking to see if that rule exists in the udev rules > that Arch is using. Secondly if it does exist, is the corresponding > *.rules being copied into the appliance? (Check appliance/supermin.d/ > hostfiles) > > In an old Ubuntu that has udev that predates having this rule, we add > the following patch: > > > http://libguestfs.org/download/binaries/ubuntu1004-packages/0002-ubuntu-10.04-Use-dev-vport0p1.patch > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat > http://people.redhat.com/~rjones > virt-p2v converts physical machines to virtual machines. Boot with a > live CD or over the network (PXE) and turn machines into Xen guests. > http://et.redhat.com/~rjones/virt-p2v > Hello Richard,<br><br>I found what the problem was and the udev symlinks where not created. The init script in the appliance uses a full paths for udevadm (/sbin/udevadm) which in my case was wrong. In Arch Linux udevadm is hosted under /usr/bin, not /sbin. When I fixed this, libguestfs was able to communicate with the appliance VM.<br> <br>Since PATH variable is defined and exported in init, there is no need in using full paths for external programs. As far as I&#39;ve seen this affects all the git branches in libguestfs&#39;s repository. Please find attached a patch for the master branch.<br> <br>Nikos Skalkotos,<br>Athens, Greece<br><br><div class="gmail_quote">On 24 February 2012 10:25, Richard W.M. Jones <span dir="ltr">&lt;<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> On Thu, Feb 23, 2012 at 08:50:12PM +0200, Nikos Skalkotos wrote:<br> [...]<br> <br> I don&#39;t know specifically why it fails with ArchLinux, but the problem<br> is caused by the /dev/virtio-ports/* symlinks not getting created by<br> udev.<br> <br> /dev/vport0p1 exists:<br> <div class="im"><br> &gt; crw------- 1 root root 252,   1 Feb 23 18:17 vport0p1<br> <br> </div>but udev doesn&#39;t make the corresponding /dev/virtio-ports symlink:<br> <div class="im"><br> &gt; /dev/virtio-ports/org.libguestfs.channel.0: No such file or directory<br> <br> </div>The symlink is supposed to be created by this udev rule:<br> <br> /lib/udev/rules.d/50-udev-default.rules:KERNEL==&quot;vport*&quot;, ATTR{name}==&quot;?*&quot;, SYMLINK+=&quot;virtio-ports/$attr{name}&quot;<br> <br> So I&#39;d start by looking to see if that rule exists in the udev rules<br> that Arch is using.  Secondly if it does exist, is the corresponding<br> *.rules being copied into the appliance?  (Check appliance/supermin.d/<br> hostfiles)<br> <br> In an old Ubuntu that has udev that predates having this rule, we add<br> the following patch:<br> <br> <a href="http://libguestfs.org/download/binaries/ubuntu1004-packages/0002-ubuntu-10.04-Use-dev-vport0p1.patch" target="_blank">http://libguestfs.org/download/binaries/ubuntu1004-packages/0002-ubuntu-10.04-Use-dev-vport0p1.patch</a><br> <br> Rich.<br> <span class="HOEnZb"><font color="#888888"><br> --<br> Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/%7Erjones%0Avirt-p2v" target="_blank">http://people.redhat.com/~rjones<br> virt-p2v</a> converts physical machines to virtual machines.  Boot with a<br> live CD or over the network (PXE) and turn machines into Xen guests.<br> <a href="http://et.redhat.com/%7Erjones/virt-p2v" target="_blank">http://et.redhat.com/~rjones/virt-p2v</a><br> </font></span></blockquote></div><br>
* build: Choose a virtual directory for the daemon which is not a symlink.Richard W.M. Jones2012-02-061-4/+5
| | | | | | | Check /sbin, /usr/sbin, /bin and /usr/bin to ensure that neither the directory nor the parent (eg. /usr) is a symlink, and use this directory for the virtual directory used to store guestfsd in the appliance.
* appliance: udev >= 176 now requires /dev to be a devtmpfs.Richard W.M. Jones2012-01-271-0/+3
| | | | | See this udev commit: https://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=220893b3cbdbf8932f95c44811b169a8f0d33939
* appliance: Switch to using 'iproute' ('ip' command) from 'net-tools' ↵Jiri Popelka2012-01-252-6/+10
| | | | | | | | | (RHBZ#784647). Change 'ifconfig' and 'netstat' commands to use 'ip' instead. 'iproute' was already included in the appliance, so this reduces the size of the appliance accordingly.
* Enable running the daemon under valgrind.Richard W.M. Jones2012-01-243-3/+20
| | | | | | | | | | | | | | | | | This commit allows you to run the daemon under valgrind. You have to enable it at configure time: ./configure --enable-valgrind-daemon This should *not* be done for production builds. When this feature is enabled, valgrind is added to the appliance and the daemon is run under valgrind. Log messages from valgrind are passed back over a virtio-serial channel into a file called 'valgrind.log.$PID' in the top build directory. Running 'make check', 'make extra-tests' etc causes many valgrind.log.* files to be created which must be examined by hand.
* appliance: Add psmisc package to the appliance.Richard W.M. Jones2012-01-191-0/+1
| | | | This allows us to use 'fuser' and other ps tools.
* Tempus fugit.Richard W.M. Jones2012-01-181-1/+1
| | | | Update all copyright dates to 2012.
* daemon: Use pkg-config to locate Augeas CFLAGS / libraries.Richard W.M. Jones2011-12-031-0/+1
| | | | | | | | | | | | | | | | | | Augeas 0.10 depends on libxml2, so this is now required in the appliance (in fact, it was already present). However this exposed two bugs: (1) In libguestfs we use a home-brewed recipe for Augeas flags, resulting in this error: /usr/include/augeas.h:24:25: fatal error: libxml/tree.h: No such file or directory (2) Augeas's own augeas.pc didn't include the libxml2 flags, so it was broken. This requires a patch to Augeas 0.10, see: https://www.redhat.com/archives/augeas-devel/2011-December/msg00008.html Change to using pkg-config to detect Augeas. It is still an optional library.
* New API: list-md-devices.Matthew Booth2011-11-111-0/+3
| | | | | | | Return a list of Linux MD devices detected in the guest. This API complements list_devices, list_partitions, list_lvs and list_dm_devices.
* Update FSF address.Matthew Booth2011-11-082-2/+2
|
* appliance: Add 'mdadm' package.Richard W.M. Jones2011-10-311-0/+1
|
* appliance: udev-174 moves udevd to /lib/udev/udevd (instead of /sbin/udevd)Richard W.M. Jones2011-10-201-0/+5
|
* Ubuntu 11.10: Create /run and /run/lock if not already.Richard W.M. Jones2011-10-181-0/+1
| | | | In real machines these directories are a ramdisk.
* appliance: Fedora cryptsetup-luks renamed to cryptsetup.Richard W.M. Jones2011-10-141-1/+2
| | | | Therefore we need both names to be listed in the file.
* Use ArchLinux's new kernel package "linux".Erik Nolte2011-10-141-1/+1
|
* New APIs: compress-out, compress-device-out.Richard W.M. Jones2011-09-281-0/+1
| | | | | | | | | | | | | | | | | These APIs let you copy compressed files or devices out from the disk image. Compression is useful for large images which are mostly zeroes. We cannot currently do sparseness detection, and compression gives us a form of zero detection for free. Example usage: $ guestfish --ro -a /dev/vg_pin/F16x64 -i \ compress-out gzip /etc/passwd /tmp/passwd.gz $ file -z /tmp/passwd.gz /tmp/passwd.gz: ASCII text (gzip compressed data, was "passwd", from Unix, last modified: Sun Aug 28 14:40:46 2011)
* Create /sys directory if it doesn't exist already.Richard W.M. Jones2011-09-011-0/+1
| | | | Ubuntu 10.04 LTS packages don't create /sys.
* out-of-tree build: fix applianceHilko Bengen2011-08-151-0/+1
|
* debian: Add gawk to packagelist.Richard W.M. Jones2011-08-021-0/+1
| | | | It's already included, but implicitly.
* appliance: Add systemd to get /sbin/reboot for virt-rescue (RHBZ#661280).Richard W.M. Jones2011-07-132-5/+1
|
* init: Remove timeout in udevadm settle command.Richard W.M. Jones2011-06-081-1/+1
| | | | | | | | | | The given timeout (10s) was too low if the appliance was running slowly, which caused a cascade of other failures during tests. Note that in udev-171 and above on Fedora, /sbin/start_udev no longer exists, so now we are using this manual method to start udevd.
* fuse: Fix getxattr, listxattr calls and add a regression test (RHBZ#691389).Richard W.M. Jones2011-03-281-0/+1
| | | | | | | | | | | | | | | | | The documentation for the getxattr and listxattr calls is not very clear and as a result we were always returning something different from that which the Linux kernel would usually return. This fixes these calls, at least far enough that both the 'getfattr' and 'getfacl' programs now work fine on FUSE-mounted filesystems. Note that SELinux attrs are *not* passed through. This appears to be a known bug between SELinux and FUSE. For more information see: http://www.spinics.net/lists/selinux/msg09460.html Notes: Labels: bugfix, RHBZ#691389