<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libguestfs.git/daemon/command.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 FileIn ops that abort during the chunk upload stage.</title>
<updated>2011-03-18T17:56:45+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2011-03-18T17:17:30+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=33b638109ed66ea360b53b80b1f407b3a5f5ec39'/>
<id>33b638109ed66ea360b53b80b1f407b3a5f5ec39</id>
<content type='text'>
As a previous, incorrect attempt to fix RHBZ#576879 we tried to
prevent the daemon from sending an error reply if the daemon had
cancelled the transfer.  This is wrong: the daemon should send an
error reply in these cases.

A simple test case is this:

  guestfish -N fs -m /dev/sda1 upload big-file /

(This fails because the target "/" is a directory, not a file.)
Prior to this commit, libguestfs would hang instead of printing an
error.  With this commit, libguestfs prints an error.

What is happening is:

  (1) Library is uploading
  a file                          (2) In the middle of the long
                                  upload, daemon detects an error.
                                  Daemon cancels.
  (3) Library detects cancel,
  sends cancel chunk, then waits
  for the error reply from the
  daemon.                         (4) Daemon is supposed to send
                                  an error reply message.

Because step (4) wasn't happening, uploads that failed like this would
hang in the library (waiting for the error message, while the daemon
was waiting for the next request).

This also adds a regression test.

This temporarily breaks the "both ends cancel" case (RHBZ#576879c5).
Therefore the test for that is disabled, and this is fixed in the next
patch in the series.

This partially reverts commit dc706a639eec16084c0618baf7bfde00c6565f63.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As a previous, incorrect attempt to fix RHBZ#576879 we tried to
prevent the daemon from sending an error reply if the daemon had
cancelled the transfer.  This is wrong: the daemon should send an
error reply in these cases.

A simple test case is this:

  guestfish -N fs -m /dev/sda1 upload big-file /

(This fails because the target "/" is a directory, not a file.)
Prior to this commit, libguestfs would hang instead of printing an
error.  With this commit, libguestfs prints an error.

What is happening is:

  (1) Library is uploading
  a file                          (2) In the middle of the long
                                  upload, daemon detects an error.
                                  Daemon cancels.
  (3) Library detects cancel,
  sends cancel chunk, then waits
  for the error reply from the
  daemon.                         (4) Daemon is supposed to send
                                  an error reply message.

Because step (4) wasn't happening, uploads that failed like this would
hang in the library (waiting for the error message, while the daemon
was waiting for the next request).

This also adds a regression test.

This temporarily breaks the "both ends cancel" case (RHBZ#576879c5).
Therefore the test for that is disabled, and this is fixed in the next
patch in the series.

This partially reverts commit dc706a639eec16084c0618baf7bfde00c6565f63.
</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>Fix FileIn cmds losing synch if both ends send cancel messages (RHBZ#576879).</title>
<updated>2010-05-13T16:08:02+00:00</updated>
<author>
<name>Richard Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-05-12T18:55:06+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=dc706a639eec16084c0618baf7bfde00c6565f63'/>
<id>dc706a639eec16084c0618baf7bfde00c6565f63</id>
<content type='text'>
During a FileIn command (eg. upload, tar-in) if both sides
experience errors, then both sides could send cancel messages,
the result being lost synchronization.

The reason for the lost synch was because the daemon was ignoring
this case and sending an error message back which the library side
(which had cancelled) was not expecting.

Fix this by checking in the daemon for the case where the library
also cancels during daemon cancellation, and not sending an error
messages.

This also includes an enhanced regression test which checks for this
case.

This extends the original fix in
commit 5922d7084d6b43f0a1a15b664c7082dfeaf584d0.

More details can be found here:
https://bugzilla.redhat.com/show_bug.cgi?id=576879#c5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During a FileIn command (eg. upload, tar-in) if both sides
experience errors, then both sides could send cancel messages,
the result being lost synchronization.

The reason for the lost synch was because the daemon was ignoring
this case and sending an error message back which the library side
(which had cancelled) was not expecting.

Fix this by checking in the daemon for the case where the library
also cancels during daemon cancellation, and not sending an error
messages.

This also includes an enhanced regression test which checks for this
case.

This extends the original fix in
commit 5922d7084d6b43f0a1a15b664c7082dfeaf584d0.

More details can be found here:
https://bugzilla.redhat.com/show_bug.cgi?id=576879#c5
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix upload losing synchronization if root not mounted (RHBZ#576879).</title>
<updated>2010-04-17T14:22:29+00:00</updated>
<author>
<name>Richard Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-04-17T13:25:55+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=5922d7084d6b43f0a1a15b664c7082dfeaf584d0'/>
<id>5922d7084d6b43f0a1a15b664c7082dfeaf584d0</id>
<content type='text'>
Modify the generator so that it can correctly handle early
cancellation for Pathname|Device|.. parameters.  This fixes
the upload command, but consequently we need to fix the
parameters for tar_in and t?z_in commands.  This should also
mean that 'win:' can now be used as the second argument of
tar_in and t?z_in commands in guestfish, whereas previously
this wouldn't have worked.

Adds a regression test for the original problem.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Modify the generator so that it can correctly handle early
cancellation for Pathname|Device|.. parameters.  This fixes
the upload command, but consequently we need to fix the
parameters for tar_in and t?z_in commands.  This should also
mean that 'win:' can now be used as the second argument of
tar_in and t?z_in commands in guestfish, whereas previously
this wouldn't have worked.

Adds a regression test for the original problem.
</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>Fix prototype of commandv to match prototype of commandrv.</title>
<updated>2009-11-09T11:05:19+00:00</updated>
<author>
<name>Richard Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2009-11-08T11:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=3cf719bc077a5f0d4f1a79279a5ba6e41d53c9b9'/>
<id>3cf719bc077a5f0d4f1a79279a5ba6e41d53c9b9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>command.c: avoid shadowing a global function</title>
<updated>2009-08-17T09:40:24+00:00</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-08-17T07:16:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=e82d864e02f7ab36881c6cda2798bb76370ee6c7'/>
<id>e82d864e02f7ab36881c6cda2798bb76370ee6c7</id>
<content type='text'>
* daemon/command.c (do_sh_lines, do_sh): Do not shadow global "command".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* daemon/command.c (do_sh_lines, do_sh): Do not shadow global "command".
</pre>
</div>
</content>
</entry>
<entry>
<title>adjust const "**" pointers to avoid warnings</title>
<updated>2009-08-17T09:40:24+00:00</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-08-07T07:38:37+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=adf20c0c4d9f488d55254f54a79079b9cacbde8d'/>
<id>adf20c0c4d9f488d55254f54a79079b9cacbde8d</id>
<content type='text'>
Also, ...
* src/generator.ml: Add DeviceList type, and propagate that change
out to all calling/interface code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also, ...
* src/generator.ml: Add DeviceList type, and propagate that change
out to all calling/interface code.
</pre>
</div>
</content>
</entry>
<entry>
<title>generator.ml: use new "Pathname" designation</title>
<updated>2009-08-13T12:45:34+00:00</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-08-11T13:59:56+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0'/>
<id>84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0</id>
<content type='text'>
Nearly every file-related function in daemons/*.c is affected:
Remove this pair of statements from each affected do_* function:
-  NEED_ROOT (return -1);
-  ABS_PATH (dir, return -1);
and change the type of the corresponding parameter to "const char *".
* src/generator.ml: Emit NEED_ROOT just once, even when there are two or
more Pathname args.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Nearly every file-related function in daemons/*.c is affected:
Remove this pair of statements from each affected do_* function:
-  NEED_ROOT (return -1);
-  ABS_PATH (dir, return -1);
and change the type of the corresponding parameter to "const char *".
* src/generator.ml: Emit NEED_ROOT just once, even when there are two or
more Pathname args.
</pre>
</div>
</content>
</entry>
<entry>
<title>update all NEED_ROOT uses</title>
<updated>2009-08-13T12:45:34+00:00</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-08-10T21:11:01+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=6bda071b5cd8393b37653687027c4ae6c6cf3804'/>
<id>6bda071b5cd8393b37653687027c4ae6c6cf3804</id>
<content type='text'>
run this command:
  git grep -l -w NEED_ROOT|xargs perl -pi -e \
    's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
run this command:
  git grep -l -w NEED_ROOT|xargs perl -pi -e \
    's/(NEED_ROOT) \((.*?)\)/$1 (return $2)/'
</pre>
</div>
</content>
</entry>
</feed>
