[libvirt] [PATCHv2 08/27] esx: reject unknown flags

Eric Blake eblake at redhat.com
Wed Jul 13 17:39:07 UTC 2011


On 07/13/2011 06:15 AM, Matthias Bolte wrote:
> 2011/7/8 Eric Blake <eblake at redhat.com>:
>> Silently ignored flags get in the way of new features that
>> use those flags.
>>

>> @@ -3829,12 +3837,14 @@ esxDomainMigratePrepare(virConnectPtr dconn,
>>                         int *cookielen ATTRIBUTE_UNUSED,
>>                         const char *uri_in ATTRIBUTE_UNUSED,
>>                         char **uri_out,
>> -                        unsigned long flags ATTRIBUTE_UNUSED,
>> +                        unsigned long flags,
>>                         const char *dname ATTRIBUTE_UNUSED,
>>                         unsigned long resource ATTRIBUTE_UNUSED)
>>  {
>>     esxPrivate *priv = dconn->privateData;
>>
>> +    virCheckFlags(0, -1);
>> +

> 
> Actually this is wrong. This was implemented before libvirt knew about
> 
> VIR_MIGRATE_PERSIST_DEST
> VIR_MIGRATE_UNDEFINE_SOURCE
> 
> But an ESX migration has exactly the semantic implied by those two
> flags. So actually those two flags have to be passed always. I should
> have fixed that ages ago.

So, do we fix that now, or do we push this patch as-is (with the
semantic change of rejecting the flags that are currently useful) along
with your cleanup as a followup (with requiring the two flags)?

I'm leaning a bit towards the latter (fix the flags to require the bits
that must be present), so I'll post a v2.

> Also if the domain is running ESX does a
> live migration always, so VIR_MIGRATE_LIVE has to passed too. ESX
> supports migration of inactive domains. It seems that migration in
> libvirt is only meant for active domains, but this isn't documented
> well.

Right now, qemu domains only get migrated if the domain is active, but I
could totally see enhancing that to support migration of persistent but
inactive domains (and it's a lot simpler - dumpxml on the source, and
define on the destination, without having to do any handshaking between
qemu processes).  In fact, I'd love that as a feature addition!

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110713/85f871f9/attachment-0001.sig>


More information about the libvir-list mailing list