Re: [PATCH][RFC] libvirt ldoms support

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

 



Hi,

The following was not included in the ldom patch, but I would
appreciate your advice.

Xen is the default hypervisor for virsh and if the user doesn't
specify in the command line option, the virsh connects to xen.
But, for the SPARC platforms, xen is not supported.  So I would
like to add the #ifdef WITH_LDOMS block in do_open()
(in src/libvirt.c) to default to ldoms if the user doesn't specify
with --connect when running virsh on the SPARC platforms.

static virConnectPtr
do_open (const char *name,
         virConnectAuthPtr auth,
         int flags)
{
    int i, res;
    virConnectPtr ret = NULL;
    xmlURIPtr uri;

#ifdef WITH_LDOMS                           =====>
    /* Convert NULL or "" to ldoms:/// */   =====>
    if (!name || name[0] == '\0')
        name = "ldoms:///";                 =====>
#else                                       =====>
    /* Convert NULL or "" to xen:/// for back compat */
    if (!name || name[0] == '\0')
        name = "xen:///";
#endif
..

Would this kind of branching in the common code be acceptable?

Thanks,
Eunice

Daniel Veillard wrote:
  In general libvirt code should never rely on WITH_LDOMS conditional
compilation except for:
- the registration of the ldom driver virInitialize() in src/libvirt.c
     - in the ldom specific files
     - potentially in some of the storage or xml back-end for a bit of
       specific processing
but really it should never affect virsh.c, or the API files.


--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]