From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>, xen-devel@lists.xenproject.org
Cc: ian.jackson@eu.citrix.com, ian.campbell@citrix.com,
stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH] qemu-trad: xenstore: use relative path for device-model node
Date: Mon, 30 Mar 2015 13:43:37 +0100 [thread overview]
Message-ID: <551944F9.1030908@citrix.com> (raw)
In-Reply-To: <1427719062-9105-1-git-send-email-wei.liu2@citrix.com>
On 30/03/15 13:37, Wei Liu wrote:
> For QEMU traditional stubdom, this is incompatible startup protocol
> change. This change needs to work with corresponding libxl changeset.
> QEMU traditional is shipped with Xen so we are allowed to do such
> change.
>
> For QEMU traditional running in Dom0, there is no functional change
> because it will still write to the same /local/domain/0 path.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
For the change, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
However, it would be nice if you also unsplit the pasprintf() calls. It
looks as if all of them should fit on a single line now.
~Andrew
> ---
> xenstore.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/xenstore.c b/xenstore.c
> index b0d6f77..09319c7 100644
> --- a/xenstore.c
> +++ b/xenstore.c
> @@ -711,7 +711,7 @@ void xenstore_parse_domain_config(int hvm_domid)
>
>
> /* Set a watch for log-dirty commands from the migration tools */
> - if (pasprintf(&buf, "/local/domain/0/device-model/%u/logdirty/cmd",
> + if (pasprintf(&buf, "device-model/%u/logdirty/cmd",
> domid) != -1) {
> xs_watch(xsh, buf, "logdirty");
> fprintf(logfile, "Watching %s\n", buf);
> @@ -719,7 +719,7 @@ void xenstore_parse_domain_config(int hvm_domid)
>
> /* Set a watch for suspend requests from the migration tools */
> if (pasprintf(&buf,
> - "/local/domain/0/device-model/%u/command", domid) != -1) {
> + "device-model/%u/command", domid) != -1) {
> xs_watch(xsh, buf, "dm-command");
> fprintf(logfile, "Watching %s\n", buf);
> }
> @@ -777,7 +777,7 @@ int xenstore_parse_disable_pf_config ()
> int disable_pf = 0;
> unsigned int len;
>
> - if (pasprintf(&buf, "/local/domain/0/device-model/%u/disable_pf",domid) == -1)
> + if (pasprintf(&buf, "device-model/%u/disable_pf",domid) == -1)
> goto out;
>
> params = xs_read(xsh, XBT_NULL, buf, &len);
> @@ -808,13 +808,13 @@ static void xenstore_process_logdirty_event(void)
>
> /* Remember the paths for the command and response entries */
> if (pasprintf(&ret_path,
> - "/local/domain/0/device-model/%u/logdirty/ret",
> + "device-model/%u/logdirty/ret",
> domid) == -1) {
> fprintf(logfile, "Log-dirty: out of memory\n");
> exit(1);
> }
> if (pasprintf(&cmd_path,
> - "/local/domain/0/device-model/%u/logdirty/cmd",
> + "device-model/%u/logdirty/cmd",
> domid) == -1) {
> fprintf(logfile, "Log-dirty: out of memory\n");
> exit(1);
> @@ -855,7 +855,7 @@ static void xenstore_process_dm_command_event(void)
> unsigned int len;
>
> if (pasprintf(&path,
> - "/local/domain/0/device-model/%u/command", domid) == -1) {
> + "device-model/%u/command", domid) == -1) {
> fprintf(logfile, "out of memory reading dm command\n");
> goto out;
> }
> @@ -875,7 +875,7 @@ static void xenstore_process_dm_command_event(void)
> } else if (!strncmp(command, "usb-add", len)) {
> fprintf(logfile, "dm-command: usb-add a usb device\n");
> if (pasprintf(&path,
> - "/local/domain/0/device-model/%u/parameter", domid) == -1) {
> + "device-model/%u/parameter", domid) == -1) {
> fprintf(logfile, "out of memory reading dm command parameter\n");
> goto out;
> }
> @@ -889,7 +889,7 @@ static void xenstore_process_dm_command_event(void)
> } else if (!strncmp(command, "usb-del", len)) {
> fprintf(logfile, "dm-command: usb-del a usb device\n");
> if (pasprintf(&path,
> - "/local/domain/0/device-model/%u/parameter", domid) == -1) {
> + "device-model/%u/parameter", domid) == -1) {
> fprintf(logfile, "out of memory reading dm command parameter\n");
> goto out;
> }
> @@ -905,7 +905,7 @@ static void xenstore_process_dm_command_event(void)
> fprintf(logfile, "dm-command: hot remove pass-through pci dev \n");
>
> if (pasprintf(&path,
> - "/local/domain/0/device-model/%u/parameter", domid) == -1) {
> + "device-model/%u/parameter", domid) == -1) {
> fprintf(logfile, "out of memory reading dm command parameter\n");
> goto out;
> }
> @@ -919,7 +919,7 @@ static void xenstore_process_dm_command_event(void)
> fprintf(logfile, "dm-command: hot insert pass-through pci dev \n");
>
> if (pasprintf(&path,
> - "/local/domain/0/device-model/%u/parameter", domid) == -1) {
> + "device-model/%u/parameter", domid) == -1) {
> fprintf(logfile, "out of memory reading dm command parameter\n");
> goto out;
> }
> @@ -944,7 +944,7 @@ void xenstore_record_dm(const char *subpath, const char *state)
> char *path = NULL;
>
> if (pasprintf(&path,
> - "/local/domain/0/device-model/%u/%s", domid, subpath) == -1) {
> + "device-model/%u/%s", domid, subpath) == -1) {
> fprintf(logfile, "out of memory recording dm \n");
> goto out;
> }
> @@ -1521,7 +1521,7 @@ char *xenstore_device_model_read(int domid, const char *key, unsigned int *len)
> {
> char *path = NULL, *value = NULL;
>
> - if (pasprintf(&path, "/local/domain/0/device-model/%d/%s", domid, key) == -1)
> + if (pasprintf(&path, "device-model/%d/%s", domid, key) == -1)
> return NULL;
>
> value = xs_read(xsh, XBT_NULL, path, len);
next prev parent reply other threads:[~2015-03-30 12:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 12:37 [PATCH] qemu-trad: xenstore: use relative path for device-model node Wei Liu
2015-03-30 12:43 ` Andrew Cooper [this message]
2015-04-09 16:47 ` Ian Jackson
2015-04-09 17:08 ` Wei Liu
2015-04-09 17:46 ` Ian Jackson
2015-04-09 17:54 ` Wei Liu
2015-04-09 18:11 ` Ian Jackson
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=551944F9.1030908@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.