[libvirt] [PATCH] util: Make sure virExec hook failures are raised

With the introduction virDispatchError, hook function errors are never sent through the error callback, so users will never see these messages. Fix this by calling virDispatchError after hook failure. Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/util/util.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/util/util.c b/src/util/util.c index ba6b0db..45ca657 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -557,8 +557,11 @@ __virExec(virConnectPtr conn, } if (hook) - if ((hook)(data) != 0) + if ((hook)(data) != 0) { + VIR_DEBUG0("Hook function failed."); + virDispatchError(NULL); _exit(1); + } /* The steps above may need todo something privileged, so * we delay clearing capabilities until the last minute */ -- 1.6.5.2

Hi, I have one test host running Debian unstable (kernel 2.6.32.3), and I would like to virtualize on it using KVM and virsh. Debian unstable has libvirt 0.7.5. On this host, I cannot start any KVM domain using console with these XML parts: <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target port='0'/> </console> When I try virsh start $domain, I get the error message: error: internal error no assigned pty for device serial0 When I remove the serial and console stanza, the machine starts up. This is the configuration documented everywhere. At first, I suspected a change in the configuration syntax and filed Debian bug #565145, But on the #virt IRC channel, people suggested that there was a change in libvirt parsing KVM's output, which may be a genuine bug breaking the console. Is this already a known issue? Can I do anything to help debugging? Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 3221 2323190

I apologize for thread hijacking, I missed editing out the IN-Reply-To-Header. Sorry. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 3221 2323190

On Wed, Jan 13, 2010 at 03:50:07PM -0500, Cole Robinson wrote:
With the introduction virDispatchError, hook function errors are never sent through the error callback, so users will never see these messages.
Fix this by calling virDispatchError after hook failure.
Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/util/util.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c index ba6b0db..45ca657 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -557,8 +557,11 @@ __virExec(virConnectPtr conn, }
if (hook) - if ((hook)(data) != 0) + if ((hook)(data) != 0) { + VIR_DEBUG0("Hook function failed."); + virDispatchError(NULL); _exit(1); + }
/* The steps above may need todo something privileged, so * we delay clearing capabilities until the last minute */ --
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Cole Robinson
-
Daniel P. Berrange
-
Marc Haber