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

Re: [libvirt-users] QEMU hook on restore

On 02/10/2012 01:45 PM, Eric Blake wrote:
> On 02/10/2012 05:43 AM, Székelyi Szabolcs wrote:
>> Hi,
>> I'm using libvirt 0.8.3. It looks like to me that when a QEMU domain is 
>> restored from save, the hook is called with the "stopped end -" arguments.
>> I've also noticed that the domain description passed to the hook script 
>> doesn't contain the network device the host will be attached to (XPath: 
>> /domain/devices/interface/target/@dev).
> This is a different question; right now it is a feature that we don't
> ever expose the actual network device through dumpxml to the user.  But
> given your use case of a hook, we might have a reason to do it after
> all.  Laine, thoughts?

Looking back at the first paragraph, I see that Székely is using libvirt
0.8.3, which didn't have forward mode='bridge' networks anyway, and thus
has no such thing as "<actual>", so this isn't his problem.

As a matter of fact, what he's looking for is the name of the tap
device. I just checked with libvirt-0.9.9, and see that in fact <target
dev='xxx'/> isn't given in the *first* time the hook script is called
for the domain (when $2 == "prepare"). However, it *is* there the second
time the hook script is called (when $2 == "begin"). That's because
during the first hook it hasn't yet been determined.

>From the documentation page, it looks like the "prepare" hook didn't
exist until 0.9.0; my guess would be that the xml sent to the hook for
"start" pre-0.9.0 was the static xml (direct from the config), and when
the earlier hook was added, this behavior was changed.

So, it appears this *isn't* our oppurtunity to expose <actual> (unless
somebody really wants to :-)

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