On Tue, Jul 06, 2010 at 08:22:30AM +0100, Richard W.M. Jones wrote:
On Mon, Jul 05, 2010 at 12:26:00PM -0400, Daniel P. Berrange wrote:
@@ -1905,6 +1996,11 @@ guestfs__kill_subprocess (guestfs_h *g) return -1; }
+ if (strcmp(g->method, GUESTFS_LAUNCH_METHOD_SPAWN) != 0) { + error (g, _("cannot kill subprocess with launch method '%s'"), g->method); + return -1; + } +
I'm thinking about removing this error, and just make it silently return 0. If you change the attach method in guestfish or by setting $GUESTFS_LAUNCH_METHOD before running an app, they'll all get an error if they call kill_subprocess(). I think this isn't nice because setting of $GUESTFS_LAUNCH_METHOD was supposed to be transparent to them. Hence probably best to just return 0.
What does guestfs_get_pid return? Possibly it will return -1 (because g->pid == -1) but it won't set the error string.
Yep, it already returns -1, and sets an error string. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|