Re: [libvirt-glib] Add API to redefine an existing domain

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

 



On Sat, Nov 19, 2011 at 01:02:28AM +0200, Zeeshan Ali (Khattak) wrote:
> On Sat, Nov 19, 2011 at 12:56 AM, Christophe Fergeau
> <cfergeau@xxxxxxxxxx> wrote:
> > Hey,
> >
> > Reading this patch, I'm wondering if gvir_domain_set_config might achieve
> > what you are after (it's not implemented either)
> 
>   Yeah, that might actually be better.
> 
> 
> >> +    GVirConnectionPrivate *priv = conn->priv;
> >> +
> >> +    xml = gvir_config_object_to_xml(GVIR_CONFIG_OBJECT(conf));
> >> +
> >> +    g_return_if_fail(xml != NULL);
> >> +
> >> +    g_mutex_lock(priv->lock);
> >> +    dom = g_hash_table_lookup (priv->domains,
> >> +                               (gpointer)gvir_domain_get_uuid(domain));
> >> +    g_mutex_unlock(priv->lock);
> >> +    g_return_if_fail(dom != NULL);
> >> +    /* FIXME: Check if config's domain ID is the same as domain passed */
> >> +
> >> +    if (!(handle = virDomainDefineXML(priv->conn, xml))) {
> >
> > Shouldn't handle be assigned to some persistent state? My guess is
> > domain->priv->handle.
> 
>  No, there is supposed to be already a corresponding domain with the
> handle in hash table. Don't let the 'DomainDefineXML' name fool you.

No need for the handle variable then. This is one of the things that
fooled me :)

Christophe

Attachment: pgpdlOjb8rlcF.pgp
Description: PGP signature

--
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]