}
-void
+string
command_mount_xsnapshots(DBus::Connection& conn, const string& config_name,
unsigned int num)
{
DBus::Hoho hoho(call);
hoho << config_name << num;
- conn.send_with_reply_and_block(call);
+ DBus::Message reply = conn.send_with_reply_and_block(call);
+
+ string mount_point;
+
+ DBus::Hihi hihi(reply);
+ hihi >> mount_point;
+
+ return mount_point;
}
}
+string
+command_get_xmount_point(DBus::Connection& conn, const string& config_name,
+ unsigned int num)
+{
+ DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetMountPoint");
+
+ DBus::Hoho hoho(call);
+ hoho << config_name << num;
+
+ DBus::Message reply = conn.send_with_reply_and_block(call);
+
+ string mount_point;
+
+ DBus::Hihi hihi(reply);
+ hihi >> mount_point;
+
+ return mount_point;
+}
+
+
void
command_create_xcomparison(DBus::Connection& conn, const string& config_name, unsigned int number1,
unsigned int number2)
" <arg name='number' type='u' direction='in'/>\n"
" </method>\n"
+ " <method name='GetMountPoint'>\n"
+ " <arg name='config-name' type='s' direction='in'/>\n"
+ " <arg name='number' type='u' direction='in'/>\n"
+ " </method>\n"
+
" <method name='CreateComparison'>\n"
" <arg name='config-name' type='s' direction='in'/>\n"
" <arg name='number1' type='u' direction='in'/>\n"
check_permission(conn, msg, *it);
Snapper* snapper = it->getSnapper();
-
Snapshots& snapshots = snapper->getSnapshots();
Snapshots::iterator snap = snapshots.find(num);
check_permission(conn, msg, *it);
Snapper* snapper = it->getSnapper();
-
Snapshots& snapshots = snapper->getSnapshots();
Snapshots::iterator snap = snapshots.find(num);
check_permission(conn, msg, *it);
Snapper* snapper = it->getSnapper();
-
Snapshots& snapshots = snapper->getSnapshots();
Snapshots::iterator snap1 = snapshots.find(pre_num);
check_in_use(*it);
Snapper* snapper = it->getSnapper();
-
Snapshots& snapshots = snapper->getSnapshots();
for (list<unsigned int>::const_iterator it = nums.begin(); it != nums.end(); ++it)
check_permission(conn, msg, *it);
Snapper* snapper = it->getSnapper();
-
Snapshots& snapshots = snapper->getSnapshots();
Snapshots::iterator snap = snapshots.find(num);
snap->mountFilesystemSnapshot();
+ string mount_point = snap->snapshotDir();
+
DBus::MessageMethodReturn reply(msg);
+ DBus::Hoho hoho(reply);
+ hoho << mount_point;
+
conn.send(reply);
}
check_permission(conn, msg, *it);
Snapper* snapper = it->getSnapper();
-
Snapshots& snapshots = snapper->getSnapshots();
Snapshots::iterator snap = snapshots.find(num);
}
+void
+Client::get_mount_point(DBus::Connection& conn, DBus::Message& msg)
+{
+ string config_name;
+ dbus_uint32_t num;
+
+ DBus::Hihi hihi(msg);
+ hihi >> config_name >> num;
+
+ y2deb("GetMountPoint config_name:" << config_name << " num:" << num);
+
+ boost::unique_lock<boost::shared_mutex> lock(big_mutex);
+
+ MetaSnappers::iterator it = meta_snappers.find(config_name);
+
+ check_permission(conn, msg, *it);
+
+ Snapper* snapper = it->getSnapper();
+ Snapshots& snapshots = snapper->getSnapshots();
+ Snapshots::iterator snap = snapshots.find(num);
+
+ string mount_point = snap->snapshotDir();
+
+ DBus::MessageMethodReturn reply(msg);
+
+ DBus::Hoho hoho(reply);
+ hoho << mount_point;
+
+ conn.send(reply);
+}
+
+
void
Client::create_comparison(DBus::Connection& conn, DBus::Message& msg)
{
mount_snapshot(conn, msg);
else if (msg.is_method_call(INTERFACE, "UmountSnapshot"))
umount_snapshot(conn, msg);
+ else if (msg.is_method_call(INTERFACE, "GetMountPoint"))
+ get_mount_point(conn, msg);
else if (msg.is_method_call(INTERFACE, "CreateComparison"))
create_comparison(conn, msg);
else if (msg.is_method_call(INTERFACE, "DeleteComparison"))