Skip to contentSkip to conversation

qemu: accept filename for incoming migration

PATCH Applied Jim Paris 2 participants 2 messages Aug 9, 2007 1 message not in the archive KVM

lore
Share & tools
lore

Jim Paris

author
#0 lore raw

PATCH 1/1 qemu: accept filename for incoming migration

Extends option syntax to allow "-incoming file://<path>" for file-based migration.

---

For some applications (e.g. qemu launched by libvirt) it's much easier to just pass a filename on the commandline than to feed data via stdin.

 qemu/migration.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
qemu/migration.c +9 -1
index 96b0c2f..737bb22 100644
@@ -949,7 +949,15 @@ int migrate_incoming(const char *device)
 
     if (strcmp(device, "stdio") == 0)
 	ret = migrate_incoming_fd(STDIN_FILENO);
-    else if (strstart(device, "tcp://", &ptr)) {
+    else if (strstart(device, "file://", &ptr)) {
+	int fd = open(ptr, O_RDONLY);
+	if (fd < 0) {
+	    ret = MIG_STAT_DST_INVALID_PARAMS;
+	} else {
+	    ret = migrate_incoming_fd(fd);
+	    close(fd);
+	}
+    } else if (strstart(device, "tcp://", &ptr)) {
 	char *host, *end;
 	host = strdup(ptr);
 	end = strchr(host, '/');
Signature · 8 lines
1.5.3.rc4


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Applied
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · Jim Paris

Extends option syntax to allow "-incoming file://<path>" for file-based migration.

Applied, thanks.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/