summaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorAlex Ng <alexng@messages.microsoft.com>2016-09-02 08:58:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-02 11:22:51 -0400
commitdb886e4d24c2b3d334be2cc1bd1bd05d547eb4c4 (patch)
tree760c8d3cc77fdc9eb50c27e642febdd3c687a224 /drivers/hv
parent497af84b81b98b27e9ba7aebb8a373412e328497 (diff)
Drivers: hv: utils: Check VSS daemon is listening before a hot backup
Hyper-V host will send a VSS_OP_HOT_BACKUP request to check if guest is ready for a live backup/snapshot. The driver should respond to the check only if the daemon is running and listening to requests. This allows the host to fallback to standard snapshots in case the VSS daemon is not running. Signed-off-by: Alex Ng <alexng@messages.microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hv_snapshot.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
index c4013c859bcd..a6707133c297 100644
--- a/drivers/hv/hv_snapshot.c
+++ b/drivers/hv/hv_snapshot.c
@@ -142,6 +142,11 @@ static int vss_on_msg(void *msg, int len)
142 return vss_handle_handshake(vss_msg); 142 return vss_handle_handshake(vss_msg);
143 } else if (vss_transaction.state == HVUTIL_USERSPACE_REQ) { 143 } else if (vss_transaction.state == HVUTIL_USERSPACE_REQ) {
144 vss_transaction.state = HVUTIL_USERSPACE_RECV; 144 vss_transaction.state = HVUTIL_USERSPACE_RECV;
145
146 if (vss_msg->vss_hdr.operation == VSS_OP_HOT_BACKUP)
147 vss_transaction.msg->vss_cf.flags =
148 VSS_HBU_NO_AUTO_RECOVERY;
149
145 if (cancel_delayed_work_sync(&vss_timeout_work)) { 150 if (cancel_delayed_work_sync(&vss_timeout_work)) {
146 vss_respond_to_host(vss_msg->error); 151 vss_respond_to_host(vss_msg->error);
147 /* Transaction is finished, reset the state. */ 152 /* Transaction is finished, reset the state. */
@@ -202,6 +207,7 @@ static void vss_handle_request(struct work_struct *dummy)
202 */ 207 */
203 case VSS_OP_THAW: 208 case VSS_OP_THAW:
204 case VSS_OP_FREEZE: 209 case VSS_OP_FREEZE:
210 case VSS_OP_HOT_BACKUP:
205 if (vss_transaction.state < HVUTIL_READY) { 211 if (vss_transaction.state < HVUTIL_READY) {
206 /* Userspace is not registered yet */ 212 /* Userspace is not registered yet */
207 vss_respond_to_host(HV_E_FAIL); 213 vss_respond_to_host(HV_E_FAIL);
@@ -210,9 +216,6 @@ static void vss_handle_request(struct work_struct *dummy)
210 vss_transaction.state = HVUTIL_HOSTMSG_RECEIVED; 216 vss_transaction.state = HVUTIL_HOSTMSG_RECEIVED;
211 vss_send_op(); 217 vss_send_op();
212 return; 218 return;
213 case VSS_OP_HOT_BACKUP:
214 vss_transaction.msg->vss_cf.flags = VSS_HBU_NO_AUTO_RECOVERY;
215 break;
216 case VSS_OP_GET_DM_INFO: 219 case VSS_OP_GET_DM_INFO:
217 vss_transaction.msg->dm_info.flags = 0; 220 vss_transaction.msg->dm_info.flags = 0;
218 break; 221 break;