Update:

Using mount (read-only) and unmount commands in a script that loops 
continuously, we are able to see near
instantaneous file modifications (less than 0.5 sec) performed on a Win7 live 
guest.  We have to use the sync.exe
utility (technet.microsoft.com/en-us/sysinternals/bb897438.aspx), otherwise 
changes are not visible for 10-20 sec.

We tested sync.exe with our libguestfs test program (using various methods, 
including rsync_out, and w/wo sync on
Linux side), but we're still not able to see live guest file changes until we 
relaunch the image.  Any advice on how
to get around the relaunch requirement (which takes 3-5 sec due to loading the 
appliance Linux kernel), would be
greatly appreciated.  There are many reasons why using libguestfs is a better 
solution for us in the long run. 
Thanks.

-Jeff

---------------- Original Message ---------------
Subject: Re: [Libguestfs] getting guestfs_rsync_out to work
From:    "Jeff Brower" <jbro...@signalogic.com>
Date:    Mon, February 9, 2015 3:39 pm
To:      "Richard W.M. Jones" <rjo...@redhat.com>
Cc:      libguestfs@redhat.com
-------------------------------------------------

Richard-

> On Mon, Feb 09, 2015 at 08:27:22AM -0600, Jeff Brower wrote:
>> Yes we know that it doesn't know.  We'd be ok to re-launch the image to pick 
>> up changes except for the time it
takes (if we could get into 1 to 10 msec range it would be ok).
>
> There's no feasible way to start a Linux kernel in under about 1-2 seconds.  
> It just takes that long for the kernel
to initialize itself. Even if you use the User-mode Linux backend (which just 
runs vmlinux as a userspace process)
you'll experience approximately the same overhead.

Ok got it.  Thanks again for your reply.  We tried guestfs_drop_caches() as 
follows:

  while(1) {

    guestfs_mount(g, "/dev/sda2", "/");

    printf("%s\n", guestfs_cat(g, "/HostShared/temp.txt"));

    guestfs_umount(g, "/");

    guestfs_drop_caches(g, 3);

    usleep(1000*1000);
 }

and still we cannot see changes made to temp.txt (from inside the Win7 guest 
VM) while this loop continues to run on
the host Linux.  We still have to re-launch the image to see changes.

In general, it would be great if the "kernel load" and "disk refresh / sync" 
functions in guestfs_launch() could be
separated.  If there was a way to do read-only file sharing, a very limited 
subset of what virtFs/9p can do, that
would be great for Win guests.

-Jeff

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs

Reply via email to