Re: [PATCH 07/12] vcpu: make old API trivially wrap to new API

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

 



On 10/01/2010 09:26 AM, Matthias Bolte wrote:
@@ -2392,6 +2393,11 @@ esxDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
     esxVI_ManagedObjectReference *task = NULL;
     esxVI_TaskInfoState taskInfoState;

+    if (flags != VIR_DOMAIN_VCPU_ACTIVE) {
+        ESX_ERROR(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
+        return -1;
+    }
+

Why not use virCheckFlags here?

virCheckFlags is useful for the maximal set of permitted flags, regardless of whether they are set or cleared. This instance was going for zero semantic change, therefore we expect an exact flag set. At which point, checking for the exact flag is easier than checking for all supported flags and then an exact flag check.

See patch 11/12 for an example of how qemu replaces an exact flag check with virCheckFlags when we finally add real support for all flag combinations. The same thing can be done for esx when (and if) we figure out how to support all flag combinations.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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