Re: [PATCHv2.5 08/10] qemu: conf: Add support for memory device cold(un)plug

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

 



>> +
>> +int
>> +virDomainMemoryInsert(virDomainDefPtr def,
>> +                      virDomainMemoryDefPtr mem)
>> +{
>> +    int id = def->nmems;
>> +
>> +    if (mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
>> +        virDomainDefHasDeviceAddress(def, &mem->info)) {
> 
> Hmm... so if our incoming mem has an address defined - it could be
> anything - we're just failing declaring that the domain already contains
> a device with the same address? Doesn't seem right.
> 
> And again - we have this problem of TYPE_NONE, TYPE_DIMM, TYPE_LAST and
> who knows what in the future.
> 
> 

Perhaps I was thinking too much about the various Find* API's when I
first read this, but upon further reflection and looking at the code
paths using it I see what the goal is. So safely ignore this particular
comment.

John
>> +        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
>> +                       _("Domain already contains a device with the same "
>> +                         "address"));
>> +        return -1;
>> +    }
>> +
>> +    if (VIR_APPEND_ELEMENT(def->mems, def->nmems, mem) < 0)
>> +        return -1;
>> +
>> +    return id;
>> +}
>> +

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