mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kys@exchange.microsoft.com
To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com,
	vkuznets@redhat.com, jasowang@redhat.com,
	leann.ogasawara@canonical.com, alexng@microsoft.com
Cc: Alex Ng <alexng@messages.microsoft.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>
Subject: [PATCH 7/7] Drivers: hv: utils: Check VSS daemon is listening before a hot backup
Date: Fri,  2 Sep 2016 05:58:25 -0700	[thread overview]
Message-ID: <1472821105-7150-7-git-send-email-kys@exchange.microsoft.com> (raw)
In-Reply-To: <1472821105-7150-1-git-send-email-kys@exchange.microsoft.com>

From: Alex Ng <alexng@messages.microsoft.com>

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>
---
 drivers/hv/hv_snapshot.c |    9 ++++++---
 tools/hv/hv_vss_daemon.c |    3 +++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
index c4013c8..a670713 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)
 		return vss_handle_handshake(vss_msg);
 	} else if (vss_transaction.state == HVUTIL_USERSPACE_REQ) {
 		vss_transaction.state = HVUTIL_USERSPACE_RECV;
+
+		if (vss_msg->vss_hdr.operation == VSS_OP_HOT_BACKUP)
+			vss_transaction.msg->vss_cf.flags =
+				VSS_HBU_NO_AUTO_RECOVERY;
+
 		if (cancel_delayed_work_sync(&vss_timeout_work)) {
 			vss_respond_to_host(vss_msg->error);
 			/* Transaction is finished, reset the state. */
@@ -202,6 +207,7 @@ static void vss_handle_request(struct work_struct *dummy)
 	 */
 	case VSS_OP_THAW:
 	case VSS_OP_FREEZE:
+	case VSS_OP_HOT_BACKUP:
 		if (vss_transaction.state < HVUTIL_READY) {
 			/* Userspace is not registered yet */
 			vss_respond_to_host(HV_E_FAIL);
@@ -210,9 +216,6 @@ static void vss_handle_request(struct work_struct *dummy)
 		vss_transaction.state = HVUTIL_HOSTMSG_RECEIVED;
 		vss_send_op();
 		return;
-	case VSS_OP_HOT_BACKUP:
-		vss_transaction.msg->vss_cf.flags = VSS_HBU_NO_AUTO_RECOVERY;
-		break;
 	case VSS_OP_GET_DM_INFO:
 		vss_transaction.msg->dm_info.flags = 0;
 		break;
diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index 5d51d6f..e082980 100644
--- a/tools/hv/hv_vss_daemon.c
+++ b/tools/hv/hv_vss_daemon.c
@@ -250,6 +250,9 @@ int main(int argc, char *argv[])
 				syslog(LOG_ERR, "/etc/fstab and /proc/mounts");
 			}
 			break;
+		case VSS_OP_HOT_BACKUP:
+			syslog(LOG_INFO, "VSS: op=CHECK HOT BACKUP\n");
+			break;
 		default:
 			syslog(LOG_ERR, "Illegal op:%d\n", op);
 		}
-- 
1.7.4.1

      parent reply	other threads:[~2016-09-02 11:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02 12:56 [PATCH 0/7] Drivers: hv: Some miscellaneous fixes kys
2016-09-02 12:58 ` [PATCH 1/7] Drivers: hv: cleanup vmbus_open() for wrap around mappings kys
2016-09-02 12:58   ` [PATCH 2/7] Drivers: hv: ring_buffer: wrap around mappings for ring buffers kys
2016-09-02 12:58   ` [PATCH 3/7] Drivers: hv: ring_buffer: use wrap around mappings in hv_copy{from,to}_ringbuffer() kys
2016-09-02 12:58   ` [PATCH 4/7] Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw() kys
2016-09-02 12:58   ` [PATCH 5/7] Drivers: hv: Introduce a policy for controlling channel affinity kys
2016-09-02 12:58   ` [PATCH 6/7] Drivers: hv: utils: Continue to poll VSS channel after handling requests kys
2016-09-02 12:58   ` kys [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1472821105-7150-7-git-send-email-kys@exchange.microsoft.com \
    --to=kys@exchange.microsoft.com \
    --cc=alexng@messages.microsoft.com \
    --cc=alexng@microsoft.com \
    --cc=apw@canonical.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=leann.ogasawara@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®