]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
time_t is not a long on FreeBSD, switch internal type to long long
authorMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 13 May 2011 05:07:13 +0000 (07:07 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 25 May 2011 16:47:33 +0000 (18:47 +0200)
src/conf/domain_conf.c
src/conf/domain_conf.h
src/esx/esx_vi_types.c
src/esx/esx_vi_types.h
tests/esxutilstest.c

index 3f2fb1103c7f8a4973b1e0c10c3904d2a4e5b504..8ff155b831eeee96959d44f0a01715543f8134f4 100644 (file)
@@ -9183,7 +9183,7 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
 
     def->name = virXPathString("string(./name)", ctxt);
     if (def->name == NULL)
-        ignore_value(virAsprintf(&def->name, "%ld", tv.tv_sec));
+        ignore_value(virAsprintf(&def->name, "%lld", (long long)tv.tv_sec));
 
     if (def->name == NULL) {
         virReportOOMError();
@@ -9193,8 +9193,8 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
     def->description = virXPathString("string(./description)", ctxt);
 
     if (!newSnapshot) {
-        if (virXPathLong("string(./creationTime)", ctxt,
-                         &def->creationTime) < 0) {
+        if (virXPathLongLong("string(./creationTime)", ctxt,
+                             &def->creationTime) < 0) {
             virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                                  _("missing creationTime from existing snapshot"));
             goto cleanup;
@@ -9259,7 +9259,7 @@ char *virDomainSnapshotDefFormat(char *domain_uuid,
         virBufferAsprintf(&buf, "    <name>%s</name>\n", def->parent);
         virBufferAddLit(&buf, "  </parent>\n");
     }
-    virBufferAsprintf(&buf, "  <creationTime>%ld</creationTime>\n",
+    virBufferAsprintf(&buf, "  <creationTime>%lld</creationTime>\n",
                       def->creationTime);
     virBufferAddLit(&buf, "  <domain>\n");
     virBufferAsprintf(&buf, "    <uuid>%s</uuid>\n", domain_uuid);
index 9d4349e480679766e0b3ded07d096e3a9445cc91..d4245d8cca41dc0952e4cc29a4af53ca04eaf22f 100644 (file)
@@ -1042,7 +1042,7 @@ struct _virDomainSnapshotDef {
     char *name;
     char *description;
     char *parent;
-    time_t creationTime;
+    long long creationTime; /* in seconds */
     int state;
 
     long active;
index c689ab0e0aa9345e66655380c6a4afa21fe2b74d..2332fde8d62175c2cadb09841ca1ea854b2eea09 100644 (file)
@@ -1402,7 +1402,7 @@ esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
 
 int
 esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
-                                     time_t *secondsSinceEpoch)
+                                     long long *secondsSinceEpoch)
 {
     char value[64] = "";
     char *tmp;
index d141a3810300efa1198a7d1f79b5adaa8fa38a12..3d843bff9f80b5d14fc2373d9889a962fd97f6d2 100644 (file)
@@ -264,7 +264,7 @@ int esxVI_DateTime_Serialize(esxVI_DateTime *dateTime, const char *element,
                              virBufferPtr output);
 int esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime);
 int esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
-                                         time_t *secondsSinceEpoch);
+                                         long long *secondsSinceEpoch);
 
 
 
index 2b365358fb656f21e7e47dcc9120181b0bc5767c..51c1e3497936746029d351919fa94cde07d05f10 100644 (file)
@@ -169,7 +169,7 @@ testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
 
 struct testDateTime {
     const char *dateTime;
-    time_t calendarTime;
+    long long calendarTime;
 };
 
 static struct testDateTime times[] = {
@@ -205,7 +205,7 @@ testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
 {
     int i;
     esxVI_DateTime dateTime;
-    time_t calendarTime;
+    long long calendarTime;
 
     for (i = 0; i < ARRAY_CARDINALITY(times); ++i) {
         dateTime.value = (char *)times[i].dateTime;