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

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



On Sat, Nov 19, 2011 at 12:56 AM, Christophe Fergeau
<cfergeau redhat com> 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.

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124


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