/*
* Copyright (c) [2012-2015] Novell, Inc.
+ * Copyright (c) 2016 SUSE LLC
*
* All Rights Reserved.
*
}
+void
+command_prepare_quota(DBus::Connection& conn, const string& config_name)
+{
+ DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "PrepareQuota");
+
+ DBus::Hoho hoho(call);
+ hoho << config_name;
+
+ conn.send_with_reply_and_block(call);
+}
+
+
+XQuotaData
+command_query_quota(DBus::Connection& conn, const string& config_name)
+{
+ DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "QueryQuota");
+
+ DBus::Hoho hoho(call);
+ hoho << config_name;
+
+ DBus::Message reply = conn.send_with_reply_and_block(call);
+
+ XQuotaData quota_data;
+
+ DBus::Hihi hihi(reply);
+ hihi >> quota_data;
+
+ return quota_data;
+}
+
+
void
command_xsync(DBus::Connection& conn, const string& config_name)
{
/*
* Copyright (c) [2012-2015] Novell, Inc.
+ * Copyright (c) 2016 SUSE LLC
*
* All Rights Reserved.
*
command_get_xfiles(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2);
+void
+command_prepare_quota(DBus::Connection& conn, const string& config_name);
+
+XQuotaData
+command_query_quota(DBus::Connection& conn, const string& config_name);
+
void
command_xsync(DBus::Connection& conn, const string& config_name);
/*
* Copyright (c) [2011-2014] Novell, Inc.
+ * Copyright (c) [2016] SUSE LLC
*
* All Rights Reserved.
*
if (name == "error.acl_error")
return _("ACL error.");
+ if (name == "error.quota")
+ return sformat(_("Quota failure (%s)."), e.message());
+
return sformat(_("Failure (%s)."), name.c_str());
}
}
+ Hihi&
+ operator>>(Hihi& hihi, XQuotaData& data)
+ {
+ hihi.open_recurse();
+ hihi >> data.size >> data.used;
+ hihi.close_recurse();
+ return hihi;
+ }
+
+
Hoho&
operator<<(Hoho& hoho, SnapshotType data)
{
};
+struct XQuotaData
+{
+ uint64_t size;
+ uint64_t used;
+};
+
+
namespace DBus
{
Hihi& operator>>(Hihi& hihi, XFile& data);
+ Hihi& operator>>(Hihi& hihi, XQuotaData& data);
+
}