* [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE *** @ 2014-06-18 15:34 Claire Murphy 2014-06-18 15:34 ` [dpdk-dev] [PATCH 1/2] Patch for Qemu wrapper for US-VHost to ensure Qemu process ends when VM is shutdown Claire Murphy 2014-06-18 15:34 ` [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost Claire Murphy 0 siblings, 2 replies; 6+ messages in thread From: Claire Murphy @ 2014-06-18 15:34 UTC (permalink / raw) To: dev *** BLURB HERE *** Claire Murphy (2): Patch for Qemu wrapper for US-VHost to ensure Qemu process ends when VM is shutdown. Patch to allow live migration of a VM with US-VHost. examples/vhost/libvirt/qemu-wrap.py | 31 +++++++++++++++++++++++++++---- examples/vhost/vhost-net-cdev.c | 18 ++++++++++++++++++ examples/vhost/virtio-net.c | 8 +++++++- 3 files changed, 52 insertions(+), 5 deletions(-) ^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 1/2] Patch for Qemu wrapper for US-VHost to ensure Qemu process ends when VM is shutdown. 2014-06-18 15:34 [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE *** Claire Murphy @ 2014-06-18 15:34 ` Claire Murphy 2014-06-18 15:34 ` [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost Claire Murphy 1 sibling, 0 replies; 6+ messages in thread From: Claire Murphy @ 2014-06-18 15:34 UTC (permalink / raw) To: dev Signed-off-by: Claire Murphy <claire.k.murphy@intel.com> --- examples/vhost/libvirt/qemu-wrap.py | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-) diff --git a/examples/vhost/libvirt/qemu-wrap.py b/examples/vhost/libvirt/qemu-wrap.py index e2d68a0..bfe668a 100755 --- a/examples/vhost/libvirt/qemu-wrap.py +++ b/examples/vhost/libvirt/qemu-wrap.py @@ -76,6 +76,7 @@ # "/dev/ptmx", "/dev/kvm", "/dev/kqemu", # "/dev/rtc", "/dev/hpet", "/dev/net/tun", # "/dev/<devbase-name>-<index>", +# "/dev/hugepages" # ] # # 4.b) Disable SELinux or set to permissive mode @@ -161,6 +162,8 @@ hugetlbfs_dir = "" ############################################# import sys, os, subprocess +import time +import signal #List of open userspace vhost file descriptors @@ -174,6 +177,18 @@ vhost_flags = [ "csum=off", "guest_ecn=off" ] +#String of the path to the Qemu process pid +qemu_pid = "/tmp/%d-qemu.pid" % os.getpid() + +############################################# +# Signal haldler to kill Qemu subprocess +############################################# +def kill_qemu_process(signum, stack): + pidfile = open(qemu_pid, 'r') + pid = int(pidfile.read()) + os.killpg(pid, signal.SIGTERM) + pidfile.close() + ############################################# # Find the system hugefile mount point. @@ -274,13 +289,13 @@ def main(): emul_call = '' mem_prealloc_set = 0 mem_path_set = 0 - num = 0; + num = 0 #parse the parameters while (num < num_cmd_args): arg = sys.argv[num] - #Check netdev +1 parameter for vhostfd + #Check netdev +1 parameter for vhostfd if arg == '-netdev': num_vhost_devs = len(fd_list) new_args.append(arg) @@ -333,7 +348,6 @@ def main(): emul_call += mp emul_call += " " - #add user options for opt in emul_opts_user: emul_call += opt @@ -353,13 +367,22 @@ def main(): emul_call+=str(arg) emul_call+= " " + emul_call += "-pidfile %s " % qemu_pid #Call QEMU - subprocess.call(emul_call, shell=True) + process = subprocess.Popen(emul_call, shell=True, preexec_fn=os.setsid) + + for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]: + signal.signal(sig, kill_qemu_process) + process.wait() #Close usvhost files for fd in fd_list: os.close(fd) + #Cleanup temporary files + if os.access(qemu_pid, os.F_OK): + os.remove(qemu_pid) + if __name__ == "__main__": -- 1.7.0.7 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost. 2014-06-18 15:34 [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE *** Claire Murphy 2014-06-18 15:34 ` [dpdk-dev] [PATCH 1/2] Patch for Qemu wrapper for US-VHost to ensure Qemu process ends when VM is shutdown Claire Murphy @ 2014-06-18 15:34 ` Claire Murphy 2014-08-06 9:44 ` Gray, Mark D 2014-08-06 10:01 ` Gray, Mark D 1 sibling, 2 replies; 6+ messages in thread From: Claire Murphy @ 2014-06-18 15:34 UTC (permalink / raw) To: dev Signed-off-by: Claire Murphy <claire.k.murphy@intel.com> --- examples/vhost/vhost-net-cdev.c | 18 ++++++++++++++++++ examples/vhost/virtio-net.c | 8 +++++++- 2 files changed, 25 insertions(+), 1 deletions(-) diff --git a/examples/vhost/vhost-net-cdev.c b/examples/vhost/vhost-net-cdev.c index ef42e88..e942df0 100644 --- a/examples/vhost/vhost-net-cdev.c +++ b/examples/vhost/vhost-net-cdev.c @@ -275,6 +275,24 @@ vhost_net_ioctl(fuse_req_t req, int cmd, void *arg, VHOST_IOCTL_R(struct vhost_vring_file, file, ops->set_vring_call); break; + case VHOST_SET_VRING_ERR: + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: VHOST_SET_VRING_ERR cmd=%d Un-Supported\n", ctx.fh,cmd); + result = -1; + fuse_reply_ioctl(req, result, NULL, 0); + break; + + case VHOST_SET_LOG_BASE: + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: VHOST_SET_LOG_BASE cmd=%d Un-Supported\n", ctx.fh,cmd); + result = 0; + fuse_reply_ioctl(req, result, NULL, 0); + break; + + case VHOST_SET_LOG_FD: + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: VHOST_SET_LOG_FD cmd=%d Un-Supported \n", ctx.fh,cmd); + result = -1; + fuse_reply_ioctl(req, result, NULL, 0); + break; + default: RTE_LOG(ERR, VHOST_CONFIG, "(%"PRIu64") IOCTL: DOESN NOT EXIST\n", ctx.fh); result = -1; diff --git a/examples/vhost/virtio-net.c b/examples/vhost/virtio-net.c index 9be959f..3cf650d 100644 --- a/examples/vhost/virtio-net.c +++ b/examples/vhost/virtio-net.c @@ -573,7 +573,13 @@ set_features(struct vhost_device_ctx ctx, uint64_t *pu) dev = get_device(ctx); if (dev == NULL) return -1; - if (*pu & ~VHOST_FEATURES) + + /* + * We mask the VHOST_F_LOG_ALL feature bit here as it is enabled by default + * during migration in QEMU even if we have it disabled as a feature in + * userspace vhost. + */ + if (*pu & ~(VHOST_FEATURES | (1ULL << VHOST_F_LOG_ALL))) return -1; /* Store the negotiated feature list for the device. */ -- 1.7.0.7 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost. 2014-06-18 15:34 ` [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost Claire Murphy @ 2014-08-06 9:44 ` Gray, Mark D 2014-08-06 10:01 ` Gray, Mark D 1 sibling, 0 replies; 6+ messages in thread From: Gray, Mark D @ 2014-08-06 9:44 UTC (permalink / raw) To: Murphy, Claire K, dev; +Cc: Czesnowicz, Przemyslaw > Subject: [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with > US-VHost. > > > Signed-off-by: Claire Murphy <claire.k.murphy@intel.com> > --- > examples/vhost/vhost-net-cdev.c | 18 ++++++++++++++++++ > examples/vhost/virtio-net.c | 8 +++++++- > 2 files changed, 25 insertions(+), 1 deletions(-) > > diff --git a/examples/vhost/vhost-net-cdev.c b/examples/vhost/vhost-net- > cdev.c index ef42e88..e942df0 100644 > --- a/examples/vhost/vhost-net-cdev.c > +++ b/examples/vhost/vhost-net-cdev.c > @@ -275,6 +275,24 @@ vhost_net_ioctl(fuse_req_t req, int cmd, void *arg, > VHOST_IOCTL_R(struct vhost_vring_file, file, ops- > >set_vring_call); > break; > > + case VHOST_SET_VRING_ERR: > + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: > VHOST_SET_VRING_ERR cmd=%d Un-Supported\n", ctx.fh,cmd); > + result = -1; > + fuse_reply_ioctl(req, result, NULL, 0); > + break; > + > + case VHOST_SET_LOG_BASE: > + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: > VHOST_SET_LOG_BASE cmd=%d Un-Supported\n", ctx.fh,cmd); > + result = 0; > + fuse_reply_ioctl(req, result, NULL, 0); > + break; > + > + case VHOST_SET_LOG_FD: > + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: > VHOST_SET_LOG_FD cmd=%d Un-Supported \n", ctx.fh,cmd); > + result = -1; > + fuse_reply_ioctl(req, result, NULL, 0); > + break; > + > default: > RTE_LOG(ERR, VHOST_CONFIG, "(%"PRIu64") IOCTL: > DOESN NOT EXIST\n", ctx.fh); > result = -1; > diff --git a/examples/vhost/virtio-net.c b/examples/vhost/virtio-net.c index > 9be959f..3cf650d 100644 > --- a/examples/vhost/virtio-net.c > +++ b/examples/vhost/virtio-net.c > @@ -573,7 +573,13 @@ set_features(struct vhost_device_ctx ctx, uint64_t > *pu) > dev = get_device(ctx); > if (dev == NULL) > return -1; > - if (*pu & ~VHOST_FEATURES) > + > + /* > + * We mask the VHOST_F_LOG_ALL feature bit here as it is enabled > by default > + * during migration in QEMU even if we have it disabled as a feature > in > + * userspace vhost. > + */ > + if (*pu & ~(VHOST_FEATURES | (1ULL << VHOST_F_LOG_ALL))) > return -1; > > /* Store the negotiated feature list for the device. */ > -- > 1.7.0.7 +1. This patch enables live migration for us on Intel DPDK vSwitch. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost. 2014-06-18 15:34 ` [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost Claire Murphy 2014-08-06 9:44 ` Gray, Mark D @ 2014-08-06 10:01 ` Gray, Mark D 2014-08-29 15:08 ` Thomas Monjalon 1 sibling, 1 reply; 6+ messages in thread From: Gray, Mark D @ 2014-08-06 10:01 UTC (permalink / raw) To: Murphy, Claire K, dev; +Cc: Czesnowicz, Przemyslaw > Subject: RE: [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM > with US-VHost. > > > Subject: [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM > > with US-VHost. > > > > > > Signed-off-by: Claire Murphy <claire.k.murphy@intel.com> > > --- > > examples/vhost/vhost-net-cdev.c | 18 ++++++++++++++++++ > > examples/vhost/virtio-net.c | 8 +++++++- > > 2 files changed, 25 insertions(+), 1 deletions(-) > > > > diff --git a/examples/vhost/vhost-net-cdev.c > > b/examples/vhost/vhost-net- cdev.c index ef42e88..e942df0 100644 > > --- a/examples/vhost/vhost-net-cdev.c > > +++ b/examples/vhost/vhost-net-cdev.c > > @@ -275,6 +275,24 @@ vhost_net_ioctl(fuse_req_t req, int cmd, void > *arg, > > VHOST_IOCTL_R(struct vhost_vring_file, file, ops- > > >set_vring_call); > > break; > > > > + case VHOST_SET_VRING_ERR: > > + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: > > VHOST_SET_VRING_ERR cmd=%d Un-Supported\n", ctx.fh,cmd); > > + result = -1; > > + fuse_reply_ioctl(req, result, NULL, 0); > > + break; > > + > > + case VHOST_SET_LOG_BASE: > > + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: > > VHOST_SET_LOG_BASE cmd=%d Un-Supported\n", ctx.fh,cmd); > > + result = 0; > > + fuse_reply_ioctl(req, result, NULL, 0); > > + break; > > + > > + case VHOST_SET_LOG_FD: > > + RTE_LOG(ERR, CONFIG, "(%"PRIu64") IOCTL: > > VHOST_SET_LOG_FD cmd=%d Un-Supported \n", ctx.fh,cmd); > > + result = -1; > > + fuse_reply_ioctl(req, result, NULL, 0); > > + break; > > + > > default: > > RTE_LOG(ERR, VHOST_CONFIG, "(%"PRIu64") IOCTL: > > DOESN NOT EXIST\n", ctx.fh); > > result = -1; > > diff --git a/examples/vhost/virtio-net.c b/examples/vhost/virtio-net.c > > index 9be959f..3cf650d 100644 > > --- a/examples/vhost/virtio-net.c > > +++ b/examples/vhost/virtio-net.c > > @@ -573,7 +573,13 @@ set_features(struct vhost_device_ctx ctx, > > uint64_t > > *pu) > > dev = get_device(ctx); > > if (dev == NULL) > > return -1; > > - if (*pu & ~VHOST_FEATURES) > > + > > + /* > > + * We mask the VHOST_F_LOG_ALL feature bit here as it is enabled > > by default > > + * during migration in QEMU even if we have it disabled as a feature > > in > > + * userspace vhost. > > + */ > > + if (*pu & ~(VHOST_FEATURES | (1ULL << VHOST_F_LOG_ALL))) > > return -1; > > > > /* Store the negotiated feature list for the device. */ > > -- > > 1.7.0.7 > > +1. This patch enables live migration for us on Intel DPDK vSwitch. Acked-by: Mark D. Gray <mark.d.gray@intel.com> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost. 2014-08-06 10:01 ` Gray, Mark D @ 2014-08-29 15:08 ` Thomas Monjalon 0 siblings, 0 replies; 6+ messages in thread From: Thomas Monjalon @ 2014-08-29 15:08 UTC (permalink / raw) To: Murphy, Claire K; +Cc: dev, Czesnowicz, Przemyslaw > > > Subject: [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM > > > with US-VHost. > > > > > > Signed-off-by: Claire Murphy <claire.k.murphy@intel.com> > > > > +1. This patch enables live migration for us on Intel DPDK vSwitch. > > Acked-by: Mark D. Gray <mark.d.gray@intel.com> Nobody else reviewed this patch? Title is wrongly formatted, there is no explanation in commit log, there are some checkpatches issues, and more importantly, it doesn't build: error: ‘RTE_LOGTYPE_CONFIG’ undeclared -- Thomas ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-08-29 15:04 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-06-18 15:34 [dpdk-dev] [PATCH 0/2] *** SUBJECT HERE *** Claire Murphy 2014-06-18 15:34 ` [dpdk-dev] [PATCH 1/2] Patch for Qemu wrapper for US-VHost to ensure Qemu process ends when VM is shutdown Claire Murphy 2014-06-18 15:34 ` [dpdk-dev] [PATCH 2/2] Patch to allow live migration of a VM with US-VHost Claire Murphy 2014-08-06 9:44 ` Gray, Mark D 2014-08-06 10:01 ` Gray, Mark D 2014-08-29 15:08 ` Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).