[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt-users] Bug? virGetLastError() returns NULL after virDomainCreate() if Domain running already



Am Donnerstag, 23. Februar 2012, 13:40:03 I wrote:
> Am Mittwoch, 22. Februar 2012, 11:26:50 schrieb Eric Blake:
> > Can you post the code snippet you are using to get this situation?
> 
> Unfortunately, the problem occurs inside a fairly large, and unfortunately
> not Open-Source, C++ program. I will try to reduce it to a minimal testcase
> as soon as I get around to it.

Okay, I wrote a minimal testcase that does just the operations that lead to 
the problem, only to find out that this won't reproduce the bug either :-\

That means either I'm inadvertently triggering some rare corner case here who 
knows where in my code, or the bug is really in my code. I don't think it's 
the latter, though, because the relevant part of my code looks like this:

if(virDomainCreate(vserver.get_virdomain().get()) != 0) {
	// TODO clean up pointer
	virErrorPtr error = virGetLastError();
	if(error != 0) {
		syslog(LOG_ERR, "Could not start vserver, error code: %d", error->code);
		// VIR_ERR_OPERATION_INVALID means the vm was already in a started state
		if(error->code != VIR_ERR_OPERATION_INVALID)
			throw std::runtime_error("Could not start vserver");
		}
	else {
		syslog(LOG_ERR, "Could not start vserver, no error code from libvirt");
		throw std::runtime_error("Could not start vserver, no error code from 
libvirt");
		}
	}

There's nothing in there between calling virDomainCreate() and 
virGetLastError(). There are no other threads, either.

Anyway, I've fired up gdb now to see if I can find out where the error object 
gets lost.

	Guido


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]