<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 05/14/2012 05:16 AM, Richard W.M. Jones wrote:
    <blockquote cite="mid:20120513211606.GA2253@amd.home.annexia.org"
      type="cite">
      <pre wrap="">On Sun, May 13, 2012 at 11:55:34AM +0800, Nok wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Hi

I`ve been trying this guestfs_mount_local api for quite a few days,
but still can`t get over it.
Now it seems to have enter the fuse loop but have some problems with
'mount',
and stops at guestfs_mount_local_run(g).

Here`s corresponding code in the test program:
……
if(guestfs_mount_local(g,"/mnt/libg")==-1)
exit(EXIT_FAILURE);
else
guestfs_mount_local_run(g);
……

Below is a part of the debug dump information,

……
version = 1.17.40.Root device: /dev/vda1 (this is test output)

libguestfs: guestfs__mount_local: fuse_mount /mnt/libg
libguestfs: guestfs__mount_local: fuse_new
libguestfs: guestfs__mount_local: leaving fuse_mount_local
libguestfs: guestfs__mount_local_run: entering fuse_loop
libguestfs: send_to_daemon: 56 bytes: 00 00 00 34 | 20 00 f5 f5 | 00
00 00 04 | 00 00 00 35 | 00 00 00 00 | ...
guestfsd: main_loop: proc 11 (lvs) took 0.04 seconds
guestfsd: main_loop: new request, len 0x34
guestfsd: error: lstat_stub: you must call 'mount' first to mount
the root filesystem
</pre>
      </blockquote>
      <pre wrap="">
Are you actually mounting any filesystem before calling
guestfs_mount_local?</pre>
    </blockquote>
    I just realized that I didn`t mount the /dev/sda to guestfs
    appliance mount point<br>
    as you wrote in the example "
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <span class="n" style="margin-top: 0px; margin-right: 0px;
      margin-bottom: 0px; margin-left: 0px; padding-top: 0px;
      padding-right: 0px; padding-bottom: 0px; padding-left: 0px;
      border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">guestfs_mount_options</span><span style="color: rgb(51,
      51, 51); font-family: 'Bitstream Vera Sans Mono', 'Courier New',
      monospace; font-size: 12px; font-style: normal; font-variant:
      normal; font-weight: normal; letter-spacing: normal; line-height:
      16px; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
      text-transform: none; white-space: pre; widows: 2; word-spacing:
      0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width:
      0px; background-color: rgb(255, 255, 255); display: inline
      !important; float: none; "> </span><span class="p"
      style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px;
      margin-left: 0px; padding-top: 0px; padding-right: 0px;
      padding-bottom: 0px; padding-left: 0px; border-top-width: 0px;
      border-right-width: 0px; border-bottom-width: 0px;
      border-left-width: 0px; border-style: initial; border-color:
      initial; border-image: initial; font-size: 12px; font: inherit;
      color: rgb(51, 51, 51); font-family: 'Bitstream Vera Sans Mono',
      'Courier New', monospace; font-style: normal; font-variant:
      normal; font-weight: normal; letter-spacing: normal; line-height:
      16px; orphans: 2; text-align: -webkit-auto; text-indent: 0px;
      text-transform: none; white-space: pre; widows: 2; word-spacing:
      0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width:
      0px; background-color: rgb(255, 255, 255); ">(</span><span
      class="n" style="margin-top: 0px; margin-right: 0px;
      margin-bottom: 0px; margin-left: 0px; padding-top: 0px;
      padding-right: 0px; padding-bottom: 0px; padding-left: 0px;
      border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">g</span><span class="p" style="margin-top: 0px;
      margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
      padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
      padding-left: 0px; border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">,</span><span style="color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-size:
      12px; font-style: normal; font-variant: normal; font-weight:
      normal; letter-spacing: normal; line-height: 16px; orphans: 2;
      text-align: -webkit-auto; text-indent: 0px; text-transform: none;
      white-space: pre; widows: 2; word-spacing: 0px;
      -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); display: inline !important;
      float: none; "> </span><span class="s" style="margin-top: 0px;
      margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
      padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
      padding-left: 0px; border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(221, 17, 68); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">"acl,user_xattr"</span><span class="p" style="margin-top:
      0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
      padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
      padding-left: 0px; border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">,</span><span style="color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-size:
      12px; font-style: normal; font-variant: normal; font-weight:
      normal; letter-spacing: normal; line-height: 16px; orphans: 2;
      text-align: -webkit-auto; text-indent: 0px; text-transform: none;
      white-space: pre; widows: 2; word-spacing: 0px;
      -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); display: inline !important;
      float: none; "> </span><span class="s" style="margin-top: 0px;
      margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
      padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
      padding-left: 0px; border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(221, 17, 68); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">"/dev/sda1"</span><span class="p" style="margin-top: 0px;
      margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
      padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
      padding-left: 0px; border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">,</span><span style="color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-size:
      12px; font-style: normal; font-variant: normal; font-weight:
      normal; letter-spacing: normal; line-height: 16px; orphans: 2;
      text-align: -webkit-auto; text-indent: 0px; text-transform: none;
      white-space: pre; widows: 2; word-spacing: 0px;
      -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); display: inline !important;
      float: none; "> </span><span class="s" style="margin-top: 0px;
      margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
      padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
      padding-left: 0px; border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(221, 17, 68); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">"/"</span><span class="p" style="margin-top: 0px;
      margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
      padding-top: 0px; padding-right: 0px; padding-bottom: 0px;
      padding-left: 0px; border-top-width: 0px; border-right-width: 0px;
      border-bottom-width: 0px; border-left-width: 0px; border-style:
      initial; border-color: initial; border-image: initial; font-size:
      12px; font: inherit; color: rgb(51, 51, 51); font-family:
      'Bitstream Vera Sans Mono', 'Courier New', monospace; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: 16px; orphans: 2; text-align: -webkit-auto;
      text-indent: 0px; text-transform: none; white-space: pre; widows:
      2; word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); ">)".<br>
      i guess that must be the problem in my testcase and the reason why<br>
       it kept prompting "must call' mount' first".<br>
    </span>
    <blockquote cite="mid:20120513211606.GA2253@amd.home.annexia.org"
      type="cite">
      <pre wrap="">

I'll try to write a small example program and send it.

</pre>
      <blockquote type="cite">
        <pre wrap="">guestfsd: main_loop: proc 53 (lstat) took 0.00 seconds
libguestfs: recv_from_daemon: 116 bytes: 20 00 f5 f5 | 00 00 00 04 |
00 00 00 35 | 00 00 00 01 | 00 12 34 36 | ...
libguestfs: error: lstat: lstat_stub: you must call 'mount' first to
mount the root filesystem
libguestfs: send_to_daemon: 56 bytes: 00 00 00 34 | 20 00 f5 f5 | 00
00 00 04 | 00 00 00 35 | 00 00 00 00 | ...
guestfsd: main_loop: new request, len 0x34

……

Any idea what might be wrong with it?the fuse?
</pre>
      </blockquote>
      <pre wrap="">
Rich.

</pre>
    </blockquote>
    Thanks for your nice example program!<br>
    <br>
    Nok<br>
  </body>
</html>