mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
libxl: Refactor logic in domain post parse callback
With the current control flow the post parse callback returned success right away for fully virtualized VMs. To allow adding additional checks into the post parse callback tweak the conditions so that the function doesn't return early except for error cases. To clarify the original piece of code borrow the wording from the commit message for the patch that introduced the code.
This commit is contained in:
parent
b15f588385
commit
19e85d8454
@ -546,10 +546,9 @@ libxlDomainDefPostParse(virDomainDefPtr def,
|
||||
virCapsPtr caps ATTRIBUTE_UNUSED,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (STREQ(def->os.type, "hvm"))
|
||||
return 0;
|
||||
|
||||
if (def->nconsoles == 0) {
|
||||
/* Xen PV domains always have a PV console, so add one to the domain config
|
||||
* via post-parse callback if not explicitly specified in the XML. */
|
||||
if (STRNEQ(def->os.type, "hvm") && def->nconsoles == 0) {
|
||||
virDomainChrDefPtr chrdef;
|
||||
|
||||
if (!(chrdef = virDomainChrDefNew()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user