<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libguestfs.git/daemon/debug.c, branch stable-1.10</title>
<subtitle>[MIRROR] library for accessing and modifying guest disk images</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/'/>
<entry>
<title>proto: Fix both-ends-cancel case.</title>
<updated>2011-03-18T18:27:24+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2011-03-18T18:27:21+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=f4d996fd26762053d68f46de5790aae893f03d38'/>
<id>f4d996fd26762053d68f46de5790aae893f03d38</id>
<content type='text'>
In the case where both ends cancel at the same time (eg. both ends
realize there are errors before or during the transfer), previously we
skipped sending back an error from the daemon, on the spurious basis
that the library would not need it (the library is cancelling because
of its own error).

However this is wrong: we should always send back an error message
from the daemon in order to preserve synchronization of the protocol.

A simple test case is:

  $ guestfish -N fs -m /dev/sda1 upload nosuchfile /
  libguestfs: error: open: nosuchfile: No such file or directory
  libguestfs: error: unexpected procedure number (66/282)

(Notice two things: there are errors at both ends, and the
loss of synchronization).

After applying this commit, the loss of synchronization does not occur
and we just see the library error:

  $ guestfish -N fs -m /dev/sda1 upload nosuchfile /
  libguestfs: error: open: nosuchfile: No such file or directory

The choice of displaying the library or the daemon error is fairly
arbitrary in this case -- it would be valid to display either or even
to combine them into one error.  Displaying the library error only
makes the code considerably simpler.

This commit also (re-)enables a test for this case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the case where both ends cancel at the same time (eg. both ends
realize there are errors before or during the transfer), previously we
skipped sending back an error from the daemon, on the spurious basis
that the library would not need it (the library is cancelling because
of its own error).

However this is wrong: we should always send back an error message
from the daemon in order to preserve synchronization of the protocol.

A simple test case is:

  $ guestfish -N fs -m /dev/sda1 upload nosuchfile /
  libguestfs: error: open: nosuchfile: No such file or directory
  libguestfs: error: unexpected procedure number (66/282)

(Notice two things: there are errors at both ends, and the
loss of synchronization).

After applying this commit, the loss of synchronization does not occur
and we just see the library error:

  $ guestfish -N fs -m /dev/sda1 upload nosuchfile /
  libguestfs: error: open: nosuchfile: No such file or directory

The choice of displaying the library or the daemon error is fairly
arbitrary in this case -- it would be valid to display either or even
to combine them into one error.  Displaying the library error only
makes the code considerably simpler.

This commit also (re-)enables a test for this case.
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: Don't use ../src path to include generator_protocol.h</title>
<updated>2010-11-03T13:15:19+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-11-03T12:52:24+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=9ff99418361cd1b56b00e4ffef52444021e60c72'/>
<id>9ff99418361cd1b56b00e4ffef52444021e60c72</id>
<content type='text'>
This file is already hard-linked into the current directory, so
the relative path is not required.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This file is already hard-linked into the current directory, so
the relative path is not required.
</pre>
</div>
</content>
</entry>
<entry>
<title>debug: Add qtrace &lt;device&gt; on|off to allow selective traces.</title>
<updated>2010-10-06T10:26:25+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-10-06T09:19:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=13276f753421c2df4f036647ce43e2ae8a2def0c'/>
<id>13276f753421c2df4f036647ce43e2ae8a2def0c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>debug: Add 'debug progress' command.</title>
<updated>2010-09-01T16:03:19+00:00</updated>
<author>
<name>Richard Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-09-01T16:03:19+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=8c37961b455cbc72d4879da65c6aafd332857f05'/>
<id>8c37961b455cbc72d4879da65c6aafd332857f05</id>
<content type='text'>
This debugging command generates progress notification messages,
used for testing purposes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This debugging command generates progress notification messages,
used for testing purposes.
</pre>
</div>
</content>
</entry>
<entry>
<title>debug: Arrange prototypes in alphabetical order.</title>
<updated>2010-09-01T14:38:15+00:00</updated>
<author>
<name>Richard Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-09-01T14:38:15+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=99679fe5a28efcee3be2406aeaf446b4e1a976df'/>
<id>99679fe5a28efcee3be2406aeaf446b4e1a976df</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: Enable debug command by default.</title>
<updated>2010-09-01T14:37:24+00:00</updated>
<author>
<name>Richard Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-09-01T14:37:24+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=83f381f5ccfb7e86bfaaeeade9d06c9e54ddb0cf'/>
<id>83f381f5ccfb7e86bfaaeeade9d06c9e54ddb0cf</id>
<content type='text'>
The debug command is useful for internal testing, and so should
be enabled by default in all builds.

Note that it is still *not* part of the stable ABI.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The debug command is useful for internal testing, and so should
be enabled by default in all builds.

Note that it is still *not* part of the stable ABI.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a core_pattern debug command</title>
<updated>2010-08-26T13:00:57+00:00</updated>
<author>
<name>Matthew Booth</name>
<email>mbooth@redhat.com</email>
</author>
<published>2010-08-26T12:36:10+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=a45302cb8a0ee3b4ffd0656b24a06ebdf7b50f38'/>
<id>a45302cb8a0ee3b4ffd0656b24a06ebdf7b50f38</id>
<content type='text'>
This adds a new debug command, core_pattern, which writes a new pattern for
coredump files to the appliance kernel, and sets the daemon's hard and soft core
limits to infinity.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds a new debug command, core_pattern, which writes a new pattern for
coredump files to the appliance kernel, and sets the daemon's hard and soft core
limits to infinity.
</pre>
</div>
</content>
</entry>
<entry>
<title>New API: debug-upload (not a formal part of the API/ABI).</title>
<updated>2010-04-19T15:31:24+00:00</updated>
<author>
<name>Richard Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-04-19T15:31:24+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=87e49e7e87e570537f04e34178c9c6d2b876c16c'/>
<id>87e49e7e87e570537f04e34178c9c6d2b876c16c</id>
<content type='text'>
Allow arbitrary files to be uploaded into the appliance, but
only when --enable-debug-command is enabled.  This lets you
run shell scripts, like this:

  &gt;&lt;fs&gt; debug-upload -&lt;&lt;EOF /tmp/script.sh 0700
  #!/bin/sh -
  # ...
  EOF
  &gt;&lt;fs&gt; debug sh "/tmp/script.sh"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Allow arbitrary files to be uploaded into the appliance, but
only when --enable-debug-command is enabled.  This lets you
run shell scripts, like this:

  &gt;&lt;fs&gt; debug-upload -&lt;&lt;EOF /tmp/script.sh 0700
  #!/bin/sh -
  # ...
  EOF
  &gt;&lt;fs&gt; debug sh "/tmp/script.sh"
</pre>
</div>
</content>
</entry>
<entry>
<title>daemon: Don't need to prefix error messages with the command name.</title>
<updated>2010-02-12T16:49:00+00:00</updated>
<author>
<name>Richard Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-02-12T14:06:25+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=e9c37113104c1cfb234535adc9b52ad3880a41ce'/>
<id>e9c37113104c1cfb234535adc9b52ad3880a41ce</id>
<content type='text'>
The RPC stubs already prefix the command name to error messages.
The daemon doesn't have to do this.  As a (small) benefit this also
makes the daemon slightly smaller.

Code in the daemon such as:

  if (argv[0] == NULL) {
    reply_with_error ("passed an empty list");
    return NULL;
  }

now results in error messages like this:

  &gt;&lt;fs&gt; command ""
  libguestfs: error: command: passed an empty list

(whereas previously you would have seen ..command: command:..)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The RPC stubs already prefix the command name to error messages.
The daemon doesn't have to do this.  As a (small) benefit this also
makes the daemon slightly smaller.

Code in the daemon such as:

  if (argv[0] == NULL) {
    reply_with_error ("passed an empty list");
    return NULL;
  }

now results in error messages like this:

  &gt;&lt;fs&gt; command ""
  libguestfs: error: command: passed an empty list

(whereas previously you would have seen ..command: command:..)
</pre>
</div>
</content>
</entry>
<entry>
<title>use STREQ, not strcmp: part 1</title>
<updated>2009-11-09T21:34:16+00:00</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-11-09T13:30:11+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=9a8889e4d0c532b9f77af3a9cc7aae06adebfb83'/>
<id>9a8889e4d0c532b9f77af3a9cc7aae06adebfb83</id>
<content type='text'>
git grep -l 'strcmp *([^=]*== *0'|xargs \
  perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git grep -l 'strcmp *([^=]*== *0'|xargs \
  perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
</pre>
</div>
</content>
</entry>
</feed>
