[libvirt] [PATCHv3] Add invariant TSC cpu flag

Ján Tomko jtomko at redhat.com
Tue Jun 3 11:22:57 UTC 2014


On 06/02/2014 06:35 PM, Daniel P. Berrange wrote:
> On Thu, May 15, 2014 at 10:31:05AM +0200, Ján Tomko wrote:
>> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
>> index f0df1a6..7504a38 100644
>> --- a/src/qemu/qemu_migration.c
>> +++ b/src/qemu/qemu_migration.c
>> @@ -1513,6 +1513,20 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm,
>>          return false;
>>      }
>>  
>> +    for (i = 0; i < def->cpu->nfeatures; i++) {
>> +        virCPUFeatureDefPtr feature = &def->cpu->features[i];
>> +
>> +        if (feature->policy != VIR_CPU_FEATURE_REQUIRE)
>> +            continue;
>> +
>> +        if (STREQ(feature->name, "invtsc")) {
>> +            virReportError(VIR_ERR_OPERATION_INVALID,
>> +                           _("domain has CPU feature: %s"),
>> +                           feature->name);
>> +            return false;
>> +        }
>> +    }
> 
> Could you add a comment describing why we forbid migration with
> this feature set. It probably isn't obvious to some random person
> reading this in the future :-)

I've added this comment locally:
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 3857c09..36ee718 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1519,6 +1519,7 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver,
virDomainObjPtr vm,
         if (feature->policy != VIR_CPU_FEATURE_REQUIRE)
             continue;

+        /* QEMU blocks migration and save with invariant TSC enabled */
         if (STREQ(feature->name, "invtsc")) {
             virReportError(VIR_ERR_OPERATION_INVALID,
                            _("domain has CPU feature: %s"),


> 
> ACK
> 

As Eric pointed out, QEMU support is only merged in the maintainer's qom-cpu
branch:
https://github.com/afaerber/qemu-cpu/tree/qom-cpu

I'll push this after it gets merged in qemu.git master.

Thanks for the review.

Jan

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


More information about the libvir-list mailing list