于 2011年07月15日 03:50, Osier Yang 写道:
于 2011年07月15日 00:25, Eric Blake 写道:
> On 07/13/2011 09:56 PM, Osier Yang wrote:
>>>> -=item B<undefine> I<domain-id>
>>>> +=item B<undefine> I<domain-id> optional
I<--undefine-managed-state>
>>>>
>>>> Undefine the configuration for an inactive domain. Since it's not
>>>> running
>>>> the domain name or UUID must be used as the I<domain-id>.
>>> Oh, this is different than libvirt.c, which claimed you can run
>>> 'undefine' on a running persistent domain. Which is it? Can
undefine
>>> make a running domain transient, or must it be on an inactive domain?
>> No, document in libvirt.c is not correct, undefining on a running domain
>> will be refused.
> I argue that we found a bug in the qemu driver then.
>
> Right now, you can use 'virDomainDefineXML' to convert a transient guest
> into a persistent one, but there is no counterpart operation to convert
> a persistent guest back into a transient one.
>
> That is, I think the libvirt.c docs are right in implying that you can
> 'undefine' a running domain, and that the qemu driver needs to be fixed
> to allow this use case.
>
It looks to me all of the dirvers which supports domain undefine
don't allow to
undefine a running domain, except xend, ESX, and xenapi, which leave the
determination to the underlying hypervisor.
if (virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot delete active domain"));
goto cleanup;
}
if (!vm->persistent) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cannot undefine transient
domain"));
goto cleanup;
}
Is the codes above to check if the domain is persistent bogus? If we
don't intend
to support undefine a running domain. A transient domain can only be in
running
or paused state, in which cases the domain id is already not -1, means
for a
transient domain, codes above will never be executed (fails when checking if
it's active)
> Either Dan, do you want to weigh in on this API question?
>
>
>
> --
> libvir-list mailing list
> libvir-list(a)redhat.com
>
https://www.redhat.com/mailman/listinfo/libvir-list
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list