Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jul 1, 2015
  1. @ptoscano

    sysprep: rework and fix cron-spool operation (RHBZ#1229305)

    ptoscano authored
    When cleaning the directories with cron/at jobs, remove only files
    there, as subdirectories might be used by other systems; for example
    in Debian under /var/spool/cron/ there is the atjobs subdirectory with
    the actual at queue.
    
    Make sure to not remove .SEQ files anymore, as they represent the at job
    counter which is needed by the at daemon. Instead, reset these files to
    0.
    
    Furthermore, add also the path to the .SEQ location in Debian-based
    systems.
  2. @ptoscano

    mllib: add and use last_part_of

    ptoscano authored
    Collect this small snippet to get the part of a string after the last
    occurrency of a character; replace with it the current snippets doing
    the same.
    
    Should be just code motion.
  3. @ptoscano

    mllib: add an optional filter for rm_rf_only_files

    ptoscano authored
    This way it is possible to use rm_rf_only_files, but not removing
    specific files.
  4. @rwmjones

    v2v: Match any non-"Client" variant, instead of just "Server" (RHBZ#1…

    rwmjones authored
    …234351, RHBZ#1237869).
    
    When checking if a Windows variant is a server variant, assume it is a
    server variant unless the i_product_variant field is "Client".
    
    Windows 2008 and Windows 2008R2 does not have an InstallationType key
    in the registry at all, so for these the product variant is returned
    as "unknown".
    
    Windows "Core" would have, according to the reference below,
    "Server Core".
    
    https://msdn.microsoft.com/en-us/library/ee391629%28v=vs.85%29.aspx
    
    This fixes commit 47b5f24.
  5. @rwmjones
Commits on Jun 30, 2015
  1. @ptoscano
  2. @chenhanxiao @ptoscano

    daemon: add get_random_uuid

    chenhanxiao authored ptoscano committed
    Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
  3. @chenhanxiao @ptoscano

    uuid: use newly introduced xfs_set_uuid of xfs

    chenhanxiao authored ptoscano committed
    Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
  4. @chenhanxiao @ptoscano

    uuid: use existing function of ext2

    chenhanxiao authored ptoscano committed
    Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
  5. @chenhanxiao @rwmjones

    tests: fix two minor warnings

    chenhanxiao authored rwmjones committed
    "my" variable $output masks earlier declaration in same scope at /home/libguestfs/tests/daemon/test-btrfs.pl line 66.
    "my" variable @r masks earlier declaration in same scope at /home/libguestfs/tests/daemon/test-btrfs.pl line 72.
    
    Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Commits on Jun 29, 2015
  1. @rwmjones

    Version 1.29.48.

    rwmjones authored
  2. @rwmjones
  3. @rwmjones
  4. @rwmjones

    tests: daemon: Cleanly shut down the daemon on exit.

    rwmjones authored
    This refines the previous commit by shutting down the daemon cleanly
    at the end of the test (assuming the test was successful).  It
    repurposes the 'internal_exit' API for this, which was previously used
    by the now defunct --enable-valgrind-daemon functionality.
  5. @rwmjones

    tests: Add tests using a captive daemon process.

    rwmjones authored
    This allows us to test the daemon running as a host process, allowing
    us to meaningfully test it using valgrind.
    
    This commit only adds a single test that check that the daemon starts
    up, can be pinged, and exits.
  6. @rwmjones

    daemon: Move all the kernel command line parsing to the init script.

    rwmjones authored
    Instead of parsing /proc/cmdline from the daemon, move all of that
    parsing into the init script, and pass the argument via the daemon
    command line.
    
    For example, previously the daemon and init script both looked for
    guestfs_network=1 in /proc/cmdline.  Now the init script still looks
    for it, and if found it runs `guestfsd --network'.
  7. @rwmjones

    daemon: Add -l / --listen flag.

    rwmjones authored
    This option, used for testing, causes the daemon to create the Unix
    domain socket (from guestfs_channel), listen on it, and accept a
    single connection.
  8. @rwmjones

    daemon: Add undocumented --test / -t option to enable test mode.

    rwmjones authored
    This is a catch-all mode for turning off daemon features which
    interfere with our testing of the daemon.
  9. @rwmjones

    configure: Remove test for valgrind --vgdb option.

    rwmjones authored
    We'll now just require that valgrind is new enough.
    
    As best as I can tell from the valgrind subversion(!) repository, this
    option was added to valgrind in around 2011.
  10. @rwmjones

    v2v: Free XML objects in the correct order.

    rwmjones authored
    If you free an xmlDocPtr before any xmlXPathObjectPtrs that reference
    the doc, you'll get valgrind errors like this:
    
      ==7390== Invalid read of size 4
      ==7390==    at 0x4EB8BC6: xmlXPathFreeNodeSet (xpath.c:4185)
      ==7390==    by 0x4EB8CC5: xmlXPathFreeObject (xpath.c:5492)
      ==7390==    by 0x400A56: main (in /tmp/test)
      ==7390==  Address 0x60c0928 is 8 bytes inside a block of size 120 free'd
      ==7390==    at 0x4C29D2A: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==7390==    by 0x4E8784F: xmlFreeNodeList (tree.c:3683)
      ==7390==    by 0x4E87605: xmlFreeDoc (tree.c:1242)
      ==7390==    by 0x400A4A: main (in /tmp/test)
    
    The following simple test program demonstrates the problem:
    
      #include <stdio.h>
      #include <stdlib.h>
      #include <assert.h>
      #include <libxml/xpath.h>
    
      int
      main (int argc, char *argv[])
      {
        xmlDocPtr doc;
        xmlXPathContextPtr xpathctx;
        xmlXPathObjectPtr xpathobj;
    
        doc = xmlReadMemory ("<test/>", 7, NULL, NULL, XML_PARSE_NONET);
        assert (doc);
        xpathctx = xmlXPathNewContext (doc);
        assert (xpathctx);
        xpathobj = xmlXPathEvalExpression (BAD_CAST "/test", xpathctx);
        assert (xpathobj);
        xmlFreeDoc (doc);
        xmlXPathFreeObject (xpathobj);
        xmlXPathFreeContext (xpathctx);
        exit (EXIT_SUCCESS);
      }
    
    In virt-v2v we were not freeing up objects in the correct order,
    because we didn't express the dependency between objects at the C
    level into the OCaml, where the OCaml garbage collector could see
    those dependencies.  For example code like:
    
      let doc = ... in
      let xpathctx = xpath_new_context doc in
      let xpathobj = xpath_eval_expression xpathctx "/foo" in
    
    might end up freeing the 'doc' (xmlDocPtr) if, say, there were no
    further references to it in the code, even though the 'xpathobj'
    (xmlXPathObjectPtr) remains live.
    
    To avoid this, we change the OCaml-level representation of objects
    like xpathobj so they contain a reference back to the higher-level
    objects (xpathctx & doc).  Therefore holding an xpathobj means that
    the doc cannot be freed.
    
    However that alone is not quite sufficient.  There is a further
    problem when the program calls Gc.full_major, Gc.compact etc., or even
    just when xpathctx & doc happen to be freed at the same time.  The GC
    won't necessarily free them in the right order as it knows both need
    to be freed but doesn't know that one must be freed before the other.
    
    To solve this we have to move the finalisers into OCaml code, since
    the OCaml Gc.finalise function comes with an explicit ordering
    guarantee (that finalisers are always called in reverse order that
    they were created), which the C-level finaliser does not.
  11. @ptoscano

    New API: btrfs_replace

    Cao jin authored ptoscano committed
    Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
  12. @rwmjones

    v2v: OVF: If actual_size field is estimated, add a comment to the out…

    rwmjones authored
    …put.
    
    The 'note:' comment is added, as below:
    
      <Section xsi:type='ovf:DiskSection_Type'>
        <Info>List of Virtual Disks</Info>
        <!-- note: actual_size field is estimated -->
        <Disk ovf:actual_size='7' [...]/>
      </Section>
  13. @rwmjones

    v2v: Increase the timeout of VMware curl connections (RHBZ#1146007).

    rwmjones authored
    On certain webservers these appear to go beyond even 600 seconds (10
    minutes).
Commits on Jun 25, 2015
  1. @rwmjones
Commits on Jun 23, 2015
  1. @chenhanxiao @rwmjones

    do_btrfs_subvolume_list: fix a bad return value

    chenhanxiao authored rwmjones committed
    don't return a value which is to be freed.
    
    Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
  2. @chenhanxiao @rwmjones

    do_btrfs_qgroup_show: fix a bad return value

    chenhanxiao authored rwmjones committed
    We should not use temporary lines buffer as return value,
    for lines buffer will be freed.
    
    Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
  3. @rwmjones

    lib: Add optional 'append' parameter to copy-(device|file)-to-file APIs.

    rwmjones authored
    This allows you to append one file to another:
    
      copy-file-to-file /input.txt /output.txt append:true
    
    will append the contents of /input.txt to /output.txt.
  4. @rwmjones

    v2v: Support loading virtio-win drivers from virtio-win.iso (RHBZ#123…

    rwmjones authored
    …4351).
    
    This makes several changes to the handling of virtio-win drivers:
    
    The VIRTIO_WIN_DIR environment variable has been renamed
    VIRTIO_WIN (but you can still use the old name).
    
    You can point the VIRTIO_WIN either at a RHEL virtio-win directory
    (ie. /usr/share/virtio-win), OR at a loopback-mounted virtio-win ISO,
    OR at the virtio-win.iso file itself.  In the latter case, libguestfs
    is used to open the ISO file and read drivers from it.
    
    The code is more flexible about the pathnames of drivers, because the
    paths in the ISO are completely different from the paths in RHEL
    /usr/share/virtio-win.
  5. @rwmjones
  6. @ptoscano

    Modify the function: analyze_line, make it more flexible

    Cao jin authored ptoscano committed
    Modify the function from a fixed delimiter to a variable. So,
    it can be used in more APIs later. Also modified the existing
    callers
    
    Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
  7. @chenhanxiao @ptoscano

    btrfs: remove redundant whitespace

    chenhanxiao authored ptoscano committed
    s/  =/ =
    
    Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Commits on Jun 22, 2015
  1. @rwmjones

    v2v: test-harness: Add Config module to library.

    rwmjones authored
    Missing dependency.
  2. @rwmjones

    appliance: Make uefi_firmware variable static.

    rwmjones authored
    It is not used outside the compilation unit.
    
    This fixes commit 544a731.
Commits on Jun 20, 2015
  1. @rwmjones

    launch: Refactor guestfs_int_get_cpu_model code.

    rwmjones authored
    Shorter and does the same thing.
  2. @rwmjones

    aarch64: appliance: Use kraxel's edk2.git repo if available.

    rwmjones authored
    Gerd is making EDK2 builds available here:
    
    https://www.kraxel.org/repos/
    
    These are convenient for Fedora/aarch64 users, so use this firmware if
    available.
    
    This commit also refactors the UEFI searching code.
Something went wrong with that request. Please try again.