Re: [Xen-devel] Interested to participate in Outreachy Program
Hi Doug, Can you have a look at patch and let me know if everything is correct, I think things are good. I would also like to have a word with you for deciding timeline for project. Meantime, I have started reading stuff about rust language. Regards, -Sabiya diff --git a/tools/Makefile b/tools/Makefile index 3f45fb9..1c2fb79 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,4 +1,4 @@ -XEN_ROOT = $(CURDIR)/.. + XEN_ROOT = $(CURDIR)/.. include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y := diff --git a/tools/console/client/main.c b/tools/console/client/main.c index d006fdc..199432c 100644 --- a/tools/console/client/main.c +++ b/tools/console/client/main.c @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef __sun__ #include #endif @@ -45,10 +46,12 @@ #define ESCAPE_CHARACTER 0x1d +# define CONTROL(c) ((c) ^ 0x40) + static volatile sig_atomic_t received_signal = 0; static char lockfile[sizeof (XEN_LOCK_DIR "/xenconsole.") + 8] = { 0 }; static int lockfd = -1; - +static char escapechar = ESCAPE_CHARACTER; static void sighandler(int signum) { received_signal = 1; @@ -214,7 +217,7 @@ static int console_loop(int fd, struct xs_handle *xs, char *pty_path, char msg[60]; len = read(STDIN_FILENO, msg, sizeof(msg)); - if (len == 1 && msg[0] == ESCAPE_CHARACTER) { + if (len == 1 && msg[0] == escapechar) { return 0; } @@ -318,6 +321,14 @@ static void console_unlock(void) } } +char getEscapeChar(const char *s) +{ +if (*s == '^') +return CONTROL(toupper(s[1])); + +return *s; +} + int main(int argc, char **argv) { struct termios attr; @@ -329,6 +340,7 @@ int main(int argc, char **argv) struct option lopt[] = { { "type", 1, 0, 't' }, { "num", 1, 0, 'n' }, + { "escapechar", 1, 0, 'n' }, { "help",0, 0, 'h' }, { 0 }, @@ -363,6 +375,11 @@ int main(int argc, char **argv) exit(EINVAL); } break; + case 'e' : + escapechar = getEscapeChar(optarg); +break; + + default: fprintf(stderr, "Invalid argument\n"); fprintf(stderr, "Try `%s --help' for more information.\n", diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 4cdc169..86ee670 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1715,14 +1715,16 @@ static void domain_destroy_domid_cb(libxl__egc *egc, } int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, - libxl_console_type type) + libxl_console_type type, char escapechar) { + + GC_INIT(ctx); char *p = GCSPRINTF("%s/xenconsole", libxl__private_bindir_path()); char *domid_s = GCSPRINTF("%d", domid); char *cons_num_s = GCSPRINTF("%d", cons_num); char *cons_type_s; - +char *cons_escape_char = GCSPRINTF("%c", escapechar); switch (type) { case LIBXL_CONSOLE_TYPE_PV: cons_type_s = "pv"; @@ -1734,13 +1736,17 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, goto out; } -execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s, (void *)NULL); + if(cons_escape_char == NULL) +execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s,(void *)NULL); + else +execl(p, p, domid_s, "--num", cons_num_s, "--type", cons_type_s, "--escapechar", cons_escape_char, (void *)NULL); out: GC_FREE; return ERROR_FAIL; } + int libxl_console_get_tty(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type, char **path) { @@ -1823,7 +1829,7 @@ out: return rc; } -int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm) +int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm, char escapechar) { uint32_t domid; int cons_num; @@ -1832,7 +1838,7 @@ int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm) rc = libxl__primary_console_find(ctx, domid_vm, , _num, ); if ( rc ) return rc; -return libxl_console_exec(ctx, domid, cons_num, type); +return libxl_console_exec(ctx, domid, cons_num, type, escapechar); } int libxl_primary_console_get_tty(libxl_ctx *ctx, uint32_t domid_vm, diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index f9e3ef5..4ac8cfd 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -218,6 +218,12 @@ #define LIBXL_HAVE_SOFT_RESET 1 /* + if user does not specify any escape character sequence then + Default escape character will be ^] + */ + +#define CTRL_CLOSE_BRACKET '\e' +/* * libxl ABI compatibility * * The only guarantee which libxl makes regarding ABI compatibility @@ -1317,15 +1323,26 @@ int libxl_wait_for_free_memory(libxl_ctx *ctx, uint32_t domid, uint32_t memory_k int libxl_wait_for_memory_target(libxl_ctx *ctx, uint32_t domid, int wait_secs); int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass); -int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, libxl_console_type type); + +
Re: [Xen-devel] Interested to participate in Outreachy Program
Hi Doug, Can you please help on questions/problems where I am stuck? Deadline for applying for outreachy is coming closer. Regards, Sabiya Hi Doug, I am done with building of xen source.Now, I have started looking at source files and identifying changes required for given task. As you suggested, I went through virsh command source to get idea how escape sequence char option is implemented. Based on that,I came up with following findings: *To complete this task, Steps will be* 1. Do help related change in libxl/xl_cmdtable.c 2. Add handling of one more option for command 'xl console' in file xl_cmdimpl.c in method main_console. From this method, call is delegated to libxl_console_exec() in libxl.c 3. libxl_console_exec delegates to execl(), Do some changes in this method. *Question/Doubts:* - Where I need to use this escape char? - libxl_console_exec() is called by many methods Will it affect other flows as well? - Could not find execl method implementation where it actually prints data - Changes for handling escape char are not cleared Can you please help me on this? Regards, -Sabiya On Sat, Mar 19, 2016 at 11:31 PM, sabiya kazi <sabiy...@gmail.com> wrote: > Hi Doug, > I have started building xen source. > Can you help me on issue of creating guest domain? > > > Regards, > -Sabiya > > On Fri, Mar 18, 2016 at 1:18 AM, sabiya kazi <sabiy...@gmail.com> wrote: > >> Hi Doug, >> >> I have proceeded on xen installation. I have configured grub to use xen, >> I could see xl command and tried it's few options. >> >> However, I am getting failure while creating a Debian PV Guest using >> >> xen-create-image --hostname=tutorial-pv-guest \ >> --memory=512mb \ >> --vcpus=2 \ >> --lvm=vg0 \ >> --dhcp \ >> --pygrub \ >> --dist=wheezy >> >> I have attached logs for reference. >> Before this step, I could not setup Linux Bridge Network for Guest >> networking. >> I am using my router for internet connection.Can this will be problem? >> Can you please have a look and let me know. >>Now, One more question to make changes for "Xl command" I need to >> check it's source, I have checked out source from xen repository. >> Can you share path of xl and virsh command source, I can start looking at >> source.. >> >> Rega >> > ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] Interested to participate in Outreachy Program
Hi Doug, I am done with building of xen source.Now, I have started looking at source files and identifying changes required for given task. As you suggested, I went through virsh command source to get idea how escape sequence char option is implemented. Based on that,I came up with following findings: *To complete this task, Steps will be* 1. Do help related change in libxl/xl_cmdtable.c 2. Add handling of one more option for command 'xl console' in file xl_cmdimpl.c in method main_console. From this method, call is delegated to libxl_console_exec() in libxl.c 3. libxl_console_exec delegates to execl(), Do some changes in this method. *Question/Doubts:* - Where I need to use this escape char? - libxl_console_exec() is called by many methods Will it affect other flows as well? - Could not find execl method implementation where it actually prints data - Changes for handling escape char are not cleared Can you please help me on this? Regards, -Sabiya On Sat, Mar 19, 2016 at 11:31 PM, sabiya kazi <sabiy...@gmail.com> wrote: > Hi Doug, > I have started building xen source. > Can you help me on issue of creating guest domain? > > > Regards, > -Sabiya > > On Fri, Mar 18, 2016 at 1:18 AM, sabiya kazi <sabiy...@gmail.com> wrote: > >> Hi Doug, >> >> I have proceeded on xen installation. I have configured grub to use xen, >> I could see xl command and tried it's few options. >> >> However, I am getting failure while creating a Debian PV Guest using >> >> xen-create-image --hostname=tutorial-pv-guest \ >> --memory=512mb \ >> --vcpus=2 \ >> --lvm=vg0 \ >> --dhcp \ >> --pygrub \ >> --dist=wheezy >> >> I have attached logs for reference. >> Before this step, I could not setup Linux Bridge Network for Guest >> networking. >> I am using my router for internet connection.Can this will be problem? >> Can you please have a look and let me know. >>Now, One more question to make changes for "Xl command" I need to >> check it's source, I have checked out source from xen repository. >> Can you share path of xl and virsh command source, I can start looking at >> source.. >> >> Rega >> > ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Re: [Xen-devel] Interested to participate in Outreachy Program
Hi Doug, Can you tell me what steps I should follow for this project? Regards, Sabiya On Mar 5, 2016 11:59 PM, "sabiya kazi" <sabiy...@gmail.com> wrote: > > Hi Doug, > > I would like to work on the project *Rust Bindings for libxl *as a part > of Outreachy Program 2016. > > I have completed my B.E in Computer engineering from Pune Institute Of > Computer Technology, Pune, India. > > I am using opensource software and I would like to contribute to > opensource community. I am interested in learning system programming and > virtualization concepts. > > Can you please suggest me how to go ahead for this project and > for submitting my first patch, can you assign a task to work upon? > > Regards, > -Sabiya > > > > > ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
[Xen-devel] Interested to participate in Outreachy Program
Hi Doug, I would like to work on the project *Rust Bindings for libxl *as a part of Outreachy Program 2016. I have completed my B.E in Computer engineering from Pune Institute Of Computer Technology, Pune, India. I am using opensource software and I would like to contribute to opensource community. I am interested in learning system programming and virtualization concepts. Can you please suggest me how to go ahead for this project and for submitting my first patch, can you assign a task to work upon? Regards, -Sabiya ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel