* [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend
@ 2016-10-04 6:43 Emil Condrea
2016-10-04 6:43 ` Emil Condrea
` (16 more replies)
0 siblings, 17 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
This patch series was splitted from QEMU:Xen stubdom vTPM for HVM virtual machine
http://markmail.org/message/fkix7g3a5zdj7lvr
It contains a reorganization of xen backend and frontend functions together
with code style fixes.
Common functions shared by backends and frontends are moved to xen_pvdev file.
Emil Condrea (15):
xen: Fix coding style errors
xen: Fix coding style warnings
xen: Create a new file xen_pvdev.c
xen: Create a new file xen_frontend.c
xen: Move xenstore_update to xen_pvdev.c
xen: Move evtchn functions to xen_pvdev.c
xen: Prepare xendev qtail to be shared with frontends
xen: Move xenstore cleanup and mkdir functions
xen: Rename xen_be_printf to xen_pv_printf
xen: Rename xen_be_unbind_evtchn
xen: Rename xen_be_send_notify
xen: Rename xen_be_evtchn_event
xen: Rename xen_be_find_xendev
xen: Rename xen_be_del_xendev
xen: Rename xen_be_frontend_changed
hw/block/xen_disk.c | 66 +++----
hw/char/xen_console.c | 32 ++--
hw/display/xenfb.c | 128 ++++++++------
hw/net/xen_nic.c | 37 ++--
hw/usb/xen-usb.c | 47 ++---
hw/xen/Makefile.objs | 2 +-
hw/xen/xen_backend.c | 400 ++++--------------------------------------
hw/xen/xen_devconfig.c | 4 +-
hw/xen/xen_frontend.c | 90 ++++++++++
hw/xen/xen_pvdev.c | 317 +++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 71 +-------
include/hw/xen/xen_frontend.h | 14 ++
include/hw/xen/xen_pvdev.h | 78 ++++++++
xen-common.c | 4 +-
14 files changed, 704 insertions(+), 586 deletions(-)
create mode 100644 hw/xen/xen_frontend.c
create mode 100644 hw/xen/xen_pvdev.c
create mode 100644 include/hw/xen/xen_frontend.h
create mode 100644 include/hw/xen/xen_pvdev.h
--
1.9.1
^ permalink raw reply [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 01/15] xen: Fix coding style errors
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
Fixes the following errors:
* ERROR: line over 90 characters
* ERROR: code indent should never use tabs
* ERROR: space prohibited after that open square bracket '['
* ERROR: do not initialise statics to 0 or NULL
* ERROR: "(foo*)" should be "(foo *)"
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/char/xen_console.c | 20 ++++++-------
hw/display/xenfb.c | 83 ++++++++++++++++++++++++++-------------------------
hw/net/xen_nic.c | 8 +++--
hw/xen/xen_backend.c | 20 ++++++-------
4 files changed, 67 insertions(+), 64 deletions(-)
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 83108b0..4e35c82 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -154,16 +154,16 @@ static void xencons_send(struct XenConsole *con)
else
len = size;
if (len < 1) {
- if (!con->backlog) {
- con->backlog = 1;
- xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
- }
+ if (!con->backlog) {
+ con->backlog = 1;
+ xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
+ }
} else {
- buffer_advance(&con->buffer, len);
- if (con->backlog && len == size) {
- con->backlog = 0;
- xen_be_printf(&con->xendev, 1, "backlog is gone\n");
- }
+ buffer_advance(&con->buffer, len);
+ if (con->backlog && len == size) {
+ con->backlog = 0;
+ xen_be_printf(&con->xendev, 1, "backlog is gone\n");
+ }
}
}
@@ -187,7 +187,7 @@ static int con_init(struct XenDevice *xendev)
type = xenstore_read_str(con->console, "type");
if (!type || strcmp(type, "ioemu") != 0) {
- xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
+ xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
ret = -1;
goto out;
}
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 46b7d5e..a9a93f9 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -90,21 +90,22 @@ static int common_bind(struct common *c)
xen_pfn_t mfn;
if (xenstore_read_fe_uint64(&c->xendev, "page-ref", &val) == -1)
- return -1;
+ return -1;
mfn = (xen_pfn_t)val;
assert(val == mfn);
if (xenstore_read_fe_int(&c->xendev, "event-channel", &c->xendev.remote_port) == -1)
- return -1;
+ return -1;
c->page = xenforeignmemory_map(xen_fmem, c->xendev.dom,
PROT_READ | PROT_WRITE, 1, &mfn, NULL);
if (c->page == NULL)
- return -1;
+ return -1;
xen_be_bind_evtchn(&c->xendev);
- xen_be_printf(&c->xendev, 1, "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n",
- mfn, c->xendev.remote_port, c->xendev.local_port);
+ xen_be_printf(&c->xendev, 1,
+ "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n",
+ mfn, c->xendev.remote_port, c->xendev.local_port);
return 0;
}
@@ -500,8 +501,8 @@ out:
}
static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
- int width, int height, int depth,
- size_t fb_len, int offset, int row_stride)
+ int width, int height, int depth,
+ size_t fb_len, int offset, int row_stride)
{
size_t mfn_sz = sizeof(*((struct xenfb_page *)0)->pd);
size_t pd_len = sizeof(((struct xenfb_page *)0)->pd) / mfn_sz;
@@ -510,40 +511,40 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
int max_width, max_height;
if (fb_len_lim > fb_len_max) {
- xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n",
- fb_len_lim, fb_len_max);
- fb_len_lim = fb_len_max;
+ xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n",
+ fb_len_lim, fb_len_max);
+ fb_len_lim = fb_len_max;
}
if (fb_len_lim && fb_len > fb_len_lim) {
- xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n",
- fb_len, fb_len_lim);
- fb_len = fb_len_lim;
+ xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n",
+ fb_len, fb_len_lim);
+ fb_len = fb_len_lim;
}
if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
- xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n",
- depth);
- return -1;
+ xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n",
+ depth);
+ return -1;
}
if (row_stride <= 0 || row_stride > fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride);
- return -1;
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride);
+ return -1;
}
max_width = row_stride / (depth / 8);
if (width < 0 || width > max_width) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend width %d limited to %d\n",
- width, max_width);
- width = max_width;
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend width %d limited to %d\n",
+ width, max_width);
+ width = max_width;
}
if (offset < 0 || offset >= fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend offset %d (max %zu)\n",
- offset, fb_len - 1);
- return -1;
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend offset %d (max %zu)\n",
+ offset, fb_len - 1);
+ return -1;
}
max_height = (fb_len - offset) / row_stride;
if (height < 0 || height > max_height) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend height %d limited to %d\n",
- height, max_height);
- height = max_height;
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend height %d limited to %d\n",
+ height, max_height);
+ height = max_height;
}
xenfb->fb_len = fb_len;
xenfb->row_stride = row_stride;
@@ -554,7 +555,7 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
xenfb->up_fullscreen = 1;
xenfb->do_resize = 1;
xen_be_printf(&xenfb->c.xendev, 1, "framebuffer %dx%dx%d offset %d stride %d\n",
- width, height, depth, offset, row_stride);
+ width, height, depth, offset, row_stride);
return 0;
}
@@ -696,9 +697,9 @@ static void xenfb_update(void *opaque)
return;
if (!xenfb->feature_update) {
- /* we don't get update notifications, thus use the
- * sledge hammer approach ... */
- xenfb->up_fullscreen = 1;
+ /* we don't get update notifications, thus use the
+ * sledge hammer approach ... */
+ xenfb->up_fullscreen = 1;
}
/* resize if needed */
@@ -729,18 +730,18 @@ static void xenfb_update(void *opaque)
/* run queued updates */
if (xenfb->up_fullscreen) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
- xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
+ xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
+ xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
} else if (xenfb->up_count) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", xenfb->up_count);
- for (i = 0; i < xenfb->up_count; i++)
- xenfb_guest_copy(xenfb,
- xenfb->up_rects[i].x,
- xenfb->up_rects[i].y,
- xenfb->up_rects[i].w,
- xenfb->up_rects[i].h);
+ xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", xenfb->up_count);
+ for (i = 0; i < xenfb->up_count; i++)
+ xenfb_guest_copy(xenfb,
+ xenfb->up_rects[i].x,
+ xenfb->up_rects[i].y,
+ xenfb->up_rects[i].w,
+ xenfb->up_rects[i].h);
} else {
- xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n");
+ xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n");
}
xenfb->up_count = 0;
xenfb->up_fullscreen = 0;
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 6856b52..f401cd2 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -151,7 +151,8 @@ static void net_tx_packets(struct XenNetDev *netdev)
continue;
}
- xen_be_printf(&netdev->xendev, 3, "tx packet ref %d, off %d, len %d, flags 0x%x%s%s%s%s\n",
+ xen_be_printf(&netdev->xendev, 3,
+ "tx packet ref %d, off %d, len %d, flags 0x%x%s%s%s%s\n",
txreq.gref, txreq.offset, txreq.size, txreq.flags,
(txreq.flags & NETTXF_csum_blank) ? " csum_blank" : "",
(txreq.flags & NETTXF_data_validated) ? " data_validated" : "",
@@ -162,8 +163,9 @@ static void net_tx_packets(struct XenNetDev *netdev)
netdev->xendev.dom,
txreq.gref, PROT_READ);
if (page == NULL) {
- xen_be_printf(&netdev->xendev, 0, "error: tx gref dereference failed (%d)\n",
- txreq.gref);
+ xen_be_printf(&netdev->xendev, 0,
+ "error: tx gref dereference failed (%d)\n",
+ txreq.gref);
net_tx_error(netdev, &txreq, rc);
continue;
}
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 69a2388..545ee47 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -54,7 +54,7 @@ static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
QTAILQ_HEAD_INITIALIZER(xs_cleanup);
static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = QTAILQ_HEAD_INITIALIZER(xendevs);
-static int debug = 0;
+static int debug;
/* ------------------------------------------------------------- */
@@ -215,13 +215,13 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t
const char *xenbus_strstate(enum xenbus_state state)
{
static const char *const name[] = {
- [ XenbusStateUnknown ] = "Unknown",
- [ XenbusStateInitialising ] = "Initialising",
- [ XenbusStateInitWait ] = "InitWait",
- [ XenbusStateInitialised ] = "Initialised",
- [ XenbusStateConnected ] = "Connected",
- [ XenbusStateClosing ] = "Closing",
- [ XenbusStateClosed ] = "Closed",
+ [XenbusStateUnknown] = "Unknown",
+ [XenbusStateInitialising] = "Initialising",
+ [XenbusStateInitWait] = "InitWait",
+ [XenbusStateInitialised] = "Initialised",
+ [XenbusStateConnected] = "Connected",
+ [XenbusStateClosing] = "Closing",
+ [XenbusStateClosed] = "Closed",
};
return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID";
}
@@ -702,10 +702,10 @@ static void xenstore_update(void *unused)
if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR,
&type, &dom, &ops) == 3) {
- xenstore_update_be(vec[XS_WATCH_PATH], (void*)type, dom, (void*)ops);
+ xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops);
}
if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) {
- xenstore_update_fe(vec[XS_WATCH_PATH], (void*)ptr);
+ xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr);
}
cleanup:
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 01/15] xen: Fix coding style errors
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
Fixes the following errors:
* ERROR: line over 90 characters
* ERROR: code indent should never use tabs
* ERROR: space prohibited after that open square bracket '['
* ERROR: do not initialise statics to 0 or NULL
* ERROR: "(foo*)" should be "(foo *)"
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/char/xen_console.c | 20 ++++++-------
hw/display/xenfb.c | 83 ++++++++++++++++++++++++++-------------------------
hw/net/xen_nic.c | 8 +++--
hw/xen/xen_backend.c | 20 ++++++-------
4 files changed, 67 insertions(+), 64 deletions(-)
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 83108b0..4e35c82 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -154,16 +154,16 @@ static void xencons_send(struct XenConsole *con)
else
len = size;
if (len < 1) {
- if (!con->backlog) {
- con->backlog = 1;
- xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
- }
+ if (!con->backlog) {
+ con->backlog = 1;
+ xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
+ }
} else {
- buffer_advance(&con->buffer, len);
- if (con->backlog && len == size) {
- con->backlog = 0;
- xen_be_printf(&con->xendev, 1, "backlog is gone\n");
- }
+ buffer_advance(&con->buffer, len);
+ if (con->backlog && len == size) {
+ con->backlog = 0;
+ xen_be_printf(&con->xendev, 1, "backlog is gone\n");
+ }
}
}
@@ -187,7 +187,7 @@ static int con_init(struct XenDevice *xendev)
type = xenstore_read_str(con->console, "type");
if (!type || strcmp(type, "ioemu") != 0) {
- xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
+ xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
ret = -1;
goto out;
}
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 46b7d5e..a9a93f9 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -90,21 +90,22 @@ static int common_bind(struct common *c)
xen_pfn_t mfn;
if (xenstore_read_fe_uint64(&c->xendev, "page-ref", &val) == -1)
- return -1;
+ return -1;
mfn = (xen_pfn_t)val;
assert(val == mfn);
if (xenstore_read_fe_int(&c->xendev, "event-channel", &c->xendev.remote_port) == -1)
- return -1;
+ return -1;
c->page = xenforeignmemory_map(xen_fmem, c->xendev.dom,
PROT_READ | PROT_WRITE, 1, &mfn, NULL);
if (c->page == NULL)
- return -1;
+ return -1;
xen_be_bind_evtchn(&c->xendev);
- xen_be_printf(&c->xendev, 1, "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n",
- mfn, c->xendev.remote_port, c->xendev.local_port);
+ xen_be_printf(&c->xendev, 1,
+ "ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n",
+ mfn, c->xendev.remote_port, c->xendev.local_port);
return 0;
}
@@ -500,8 +501,8 @@ out:
}
static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
- int width, int height, int depth,
- size_t fb_len, int offset, int row_stride)
+ int width, int height, int depth,
+ size_t fb_len, int offset, int row_stride)
{
size_t mfn_sz = sizeof(*((struct xenfb_page *)0)->pd);
size_t pd_len = sizeof(((struct xenfb_page *)0)->pd) / mfn_sz;
@@ -510,40 +511,40 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
int max_width, max_height;
if (fb_len_lim > fb_len_max) {
- xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n",
- fb_len_lim, fb_len_max);
- fb_len_lim = fb_len_max;
+ xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n",
+ fb_len_lim, fb_len_max);
+ fb_len_lim = fb_len_max;
}
if (fb_len_lim && fb_len > fb_len_lim) {
- xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n",
- fb_len, fb_len_lim);
- fb_len = fb_len_lim;
+ xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n",
+ fb_len, fb_len_lim);
+ fb_len = fb_len_lim;
}
if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
- xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n",
- depth);
- return -1;
+ xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n",
+ depth);
+ return -1;
}
if (row_stride <= 0 || row_stride > fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride);
- return -1;
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride);
+ return -1;
}
max_width = row_stride / (depth / 8);
if (width < 0 || width > max_width) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend width %d limited to %d\n",
- width, max_width);
- width = max_width;
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend width %d limited to %d\n",
+ width, max_width);
+ width = max_width;
}
if (offset < 0 || offset >= fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend offset %d (max %zu)\n",
- offset, fb_len - 1);
- return -1;
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend offset %d (max %zu)\n",
+ offset, fb_len - 1);
+ return -1;
}
max_height = (fb_len - offset) / row_stride;
if (height < 0 || height > max_height) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend height %d limited to %d\n",
- height, max_height);
- height = max_height;
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend height %d limited to %d\n",
+ height, max_height);
+ height = max_height;
}
xenfb->fb_len = fb_len;
xenfb->row_stride = row_stride;
@@ -554,7 +555,7 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
xenfb->up_fullscreen = 1;
xenfb->do_resize = 1;
xen_be_printf(&xenfb->c.xendev, 1, "framebuffer %dx%dx%d offset %d stride %d\n",
- width, height, depth, offset, row_stride);
+ width, height, depth, offset, row_stride);
return 0;
}
@@ -696,9 +697,9 @@ static void xenfb_update(void *opaque)
return;
if (!xenfb->feature_update) {
- /* we don't get update notifications, thus use the
- * sledge hammer approach ... */
- xenfb->up_fullscreen = 1;
+ /* we don't get update notifications, thus use the
+ * sledge hammer approach ... */
+ xenfb->up_fullscreen = 1;
}
/* resize if needed */
@@ -729,18 +730,18 @@ static void xenfb_update(void *opaque)
/* run queued updates */
if (xenfb->up_fullscreen) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
- xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
+ xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
+ xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
} else if (xenfb->up_count) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", xenfb->up_count);
- for (i = 0; i < xenfb->up_count; i++)
- xenfb_guest_copy(xenfb,
- xenfb->up_rects[i].x,
- xenfb->up_rects[i].y,
- xenfb->up_rects[i].w,
- xenfb->up_rects[i].h);
+ xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", xenfb->up_count);
+ for (i = 0; i < xenfb->up_count; i++)
+ xenfb_guest_copy(xenfb,
+ xenfb->up_rects[i].x,
+ xenfb->up_rects[i].y,
+ xenfb->up_rects[i].w,
+ xenfb->up_rects[i].h);
} else {
- xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n");
+ xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n");
}
xenfb->up_count = 0;
xenfb->up_fullscreen = 0;
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 6856b52..f401cd2 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -151,7 +151,8 @@ static void net_tx_packets(struct XenNetDev *netdev)
continue;
}
- xen_be_printf(&netdev->xendev, 3, "tx packet ref %d, off %d, len %d, flags 0x%x%s%s%s%s\n",
+ xen_be_printf(&netdev->xendev, 3,
+ "tx packet ref %d, off %d, len %d, flags 0x%x%s%s%s%s\n",
txreq.gref, txreq.offset, txreq.size, txreq.flags,
(txreq.flags & NETTXF_csum_blank) ? " csum_blank" : "",
(txreq.flags & NETTXF_data_validated) ? " data_validated" : "",
@@ -162,8 +163,9 @@ static void net_tx_packets(struct XenNetDev *netdev)
netdev->xendev.dom,
txreq.gref, PROT_READ);
if (page == NULL) {
- xen_be_printf(&netdev->xendev, 0, "error: tx gref dereference failed (%d)\n",
- txreq.gref);
+ xen_be_printf(&netdev->xendev, 0,
+ "error: tx gref dereference failed (%d)\n",
+ txreq.gref);
net_tx_error(netdev, &txreq, rc);
continue;
}
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 69a2388..545ee47 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -54,7 +54,7 @@ static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
QTAILQ_HEAD_INITIALIZER(xs_cleanup);
static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = QTAILQ_HEAD_INITIALIZER(xendevs);
-static int debug = 0;
+static int debug;
/* ------------------------------------------------------------- */
@@ -215,13 +215,13 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t
const char *xenbus_strstate(enum xenbus_state state)
{
static const char *const name[] = {
- [ XenbusStateUnknown ] = "Unknown",
- [ XenbusStateInitialising ] = "Initialising",
- [ XenbusStateInitWait ] = "InitWait",
- [ XenbusStateInitialised ] = "Initialised",
- [ XenbusStateConnected ] = "Connected",
- [ XenbusStateClosing ] = "Closing",
- [ XenbusStateClosed ] = "Closed",
+ [XenbusStateUnknown] = "Unknown",
+ [XenbusStateInitialising] = "Initialising",
+ [XenbusStateInitWait] = "InitWait",
+ [XenbusStateInitialised] = "Initialised",
+ [XenbusStateConnected] = "Connected",
+ [XenbusStateClosing] = "Closing",
+ [XenbusStateClosed] = "Closed",
};
return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID";
}
@@ -702,10 +702,10 @@ static void xenstore_update(void *unused)
if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR,
&type, &dom, &ops) == 3) {
- xenstore_update_be(vec[XS_WATCH_PATH], (void*)type, dom, (void*)ops);
+ xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops);
}
if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) {
- xenstore_update_fe(vec[XS_WATCH_PATH], (void*)ptr);
+ xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr);
}
cleanup:
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
2016-10-04 6:43 ` Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-11 14:20 ` Anthony PERARD
2016-10-04 6:43 ` Emil Condrea
` (14 subsequent siblings)
16 siblings, 1 reply; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
Fixes:
* WARNING: line over 80 characters
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 3 ++-
hw/char/xen_console.c | 6 ++++--
hw/display/xenfb.c | 30 ++++++++++++++++++++----------
hw/net/xen_nic.c | 12 ++++++++----
hw/xen/xen_backend.c | 15 ++++++++++-----
include/hw/xen/xen_backend.h | 8 +++++---
6 files changed, 49 insertions(+), 25 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 5aa350a..24edeb2 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
blk_set_enable_write_cache(blkdev->blk, !writethrough);
} else {
/* setup via qemu cmdline -> already setup for us */
- xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
+ xen_be_printf(&blkdev->xendev, 2,
+ "get configured bdrv (cmdline setup)\n");
blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo);
if (blk_is_read_only(blkdev->blk) && !readonly) {
xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 4e35c82..399bb5d 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -156,7 +156,8 @@ static void xencons_send(struct XenConsole *con)
if (len < 1) {
if (!con->backlog) {
con->backlog = 1;
- xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
+ xen_be_printf(&con->xendev, 1,
+ "backlog piling up, nobody listening?\n");
}
} else {
buffer_advance(&con->buffer, len);
@@ -247,7 +248,8 @@ static int con_initialise(struct XenDevice *xendev)
}
}
- xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n",
+ xen_be_printf(xendev, 1,
+ "ring mfn %d, remote port %d, local port %d, limit %zd\n",
con->ring_ref,
con->xendev.remote_port,
con->xendev.local_port,
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index a9a93f9..9bcf60b 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -511,38 +511,45 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
int max_width, max_height;
if (fb_len_lim > fb_len_max) {
- xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "fb size limit %zu exceeds %zu, corrected\n",
fb_len_lim, fb_len_max);
fb_len_lim = fb_len_max;
}
if (fb_len_lim && fb_len > fb_len_lim) {
- xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "frontend fb size %zu limited to %zu\n",
fb_len, fb_len_lim);
fb_len = fb_len_lim;
}
if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
- xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "can't handle frontend fb depth %d\n",
depth);
return -1;
}
if (row_stride <= 0 || row_stride > fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride);
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n",
+ row_stride);
return -1;
}
max_width = row_stride / (depth / 8);
if (width < 0 || width > max_width) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend width %d limited to %d\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "invalid frontend width %d limited to %d\n",
width, max_width);
width = max_width;
}
if (offset < 0 || offset >= fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend offset %d (max %zu)\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "invalid frontend offset %d (max %zu)\n",
offset, fb_len - 1);
return -1;
}
max_height = (fb_len - offset) / row_stride;
if (height < 0 || height > max_height) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend height %d limited to %d\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "invalid frontend height %d limited to %d\n",
height, max_height);
height = max_height;
}
@@ -554,7 +561,8 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
xenfb->offset = offset;
xenfb->up_fullscreen = 1;
xenfb->do_resize = 1;
- xen_be_printf(&xenfb->c.xendev, 1, "framebuffer %dx%dx%d offset %d stride %d\n",
+ xen_be_printf(&xenfb->c.xendev, 1,
+ "framebuffer %dx%dx%d offset %d stride %d\n",
width, height, depth, offset, row_stride);
return 0;
}
@@ -722,7 +730,8 @@ static void xenfb_update(void *opaque)
break;
}
dpy_gfx_replace_surface(xenfb->c.con, surface);
- xen_be_printf(&xenfb->c.xendev, 1, "update: resizing: %dx%d @ %d bpp%s\n",
+ xen_be_printf(&xenfb->c.xendev, 1,
+ "update: resizing: %dx%d @ %d bpp%s\n",
xenfb->width, xenfb->height, xenfb->depth,
is_buffer_shared(surface) ? " (shared)" : "");
xenfb->up_fullscreen = 1;
@@ -733,7 +742,8 @@ static void xenfb_update(void *opaque)
xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
} else if (xenfb->up_count) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", xenfb->up_count);
+ xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n",
+ xenfb->up_count);
for (i = 0; i < xenfb->up_count; i++)
xenfb_guest_copy(xenfb,
xenfb->up_rects[i].x,
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index f401cd2..30efe47 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -140,7 +140,8 @@ static void net_tx_packets(struct XenNetDev *netdev)
#endif
if (txreq.size < 14) {
- xen_be_printf(&netdev->xendev, 0, "bad packet size: %d\n", txreq.size);
+ xen_be_printf(&netdev->xendev, 0, "bad packet size: %d\n",
+ txreq.size);
net_tx_error(netdev, &txreq, rc);
continue;
}
@@ -213,7 +214,8 @@ static void net_rx_response(struct XenNetDev *netdev,
resp->status = (int16_t)st;
}
- xen_be_printf(&netdev->xendev, 3, "rx response: idx %d, status %d, flags 0x%x\n",
+ xen_be_printf(&netdev->xendev, 3,
+ "rx response: idx %d, status %d, flags 0x%x\n",
i, resp->status, resp->flags);
netdev->rx_ring.rsp_prod_pvt = ++i;
@@ -256,7 +258,8 @@ static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size
netdev->xendev.dom,
rxreq.gref, PROT_WRITE);
if (page == NULL) {
- xen_be_printf(&netdev->xendev, 0, "error: rx gref dereference failed (%d)\n",
+ xen_be_printf(&netdev->xendev, 0,
+ "error: rx gref dereference failed (%d)\n",
rxreq.gref);
net_rx_response(netdev, &rxreq, NETIF_RSP_ERROR, 0, 0, 0);
return -1;
@@ -330,7 +333,8 @@ static int net_connect(struct XenDevice *xendev)
rx_copy = 0;
}
if (rx_copy == 0) {
- xen_be_printf(&netdev->xendev, 0, "frontend doesn't support rx-copy.\n");
+ xen_be_printf(&netdev->xendev, 0,
+ "frontend doesn't support rx-copy.\n");
return -1;
}
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 545ee47..0aca6ae 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -53,7 +53,8 @@ struct xs_dirs {
static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
QTAILQ_HEAD_INITIALIZER(xs_cleanup);
-static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = QTAILQ_HEAD_INITIALIZER(xendevs);
+static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
+ QTAILQ_HEAD_INITIALIZER(xendevs);
static int debug;
/* ------------------------------------------------------------- */
@@ -205,7 +206,8 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
return xenstore_read_int(xendev->fe, node, ival);
}
-int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval)
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
+ uint64_t *uval)
{
return xenstore_read_uint64(xendev->fe, node, uval);
}
@@ -385,7 +387,8 @@ static void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
g_free(xendev->protocol);
xendev->protocol = xenstore_read_fe_str(xendev, "protocol");
if (xendev->protocol) {
- xen_be_printf(xendev, 1, "frontend protocol: %s\n", xendev->protocol);
+ xen_be_printf(xendev, 1, "frontend protocol: %s\n",
+ xendev->protocol);
}
}
@@ -617,7 +620,8 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops)
snprintf(token, sizeof(token), "be:%p:%d:%p", type, dom, ops);
snprintf(path, sizeof(path), "backend/%s/%d", type, dom);
if (!xs_watch(xenstore, path, token)) {
- xen_be_printf(NULL, 0, "xen be: watching backend path (%s) failed\n", path);
+ xen_be_printf(NULL, 0, "xen be: watching backend path (%s) failed\n",
+ path);
return -1;
}
@@ -830,7 +834,8 @@ int xen_be_send_notify(struct XenDevice *xendev)
* 2 == noisy debug messages (logfile only).
* 3 == will flood your log (logfile only).
*/
-void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...)
+void xen_be_printf(struct XenDevice *xendev, int msg_level,
+ const char *fmt, ...)
{
va_list args;
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 0df282a..0ccbc0f 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -79,7 +79,8 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
-int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval);
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
+ uint64_t *uval);
const char *xenbus_strstate(enum xenbus_state state);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
@@ -93,8 +94,9 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state);
int xen_be_bind_evtchn(struct XenDevice *xendev);
void xen_be_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
-void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...)
- GCC_FMT_ATTR(3, 4);
+void xen_be_printf(struct XenDevice *xendev, int msg_level,
+ const char *fmt, ...) GCC_FMT_ATTR(3, 4);
+
/* actual backend drivers */
extern struct XenDevOps xen_console_ops; /* xen_console.c */
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 02/15] xen: Fix coding style warnings
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` Emil Condrea
` (13 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
Fixes:
* WARNING: line over 80 characters
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 3 ++-
hw/char/xen_console.c | 6 ++++--
hw/display/xenfb.c | 30 ++++++++++++++++++++----------
hw/net/xen_nic.c | 12 ++++++++----
hw/xen/xen_backend.c | 15 ++++++++++-----
include/hw/xen/xen_backend.h | 8 +++++---
6 files changed, 49 insertions(+), 25 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 5aa350a..24edeb2 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
blk_set_enable_write_cache(blkdev->blk, !writethrough);
} else {
/* setup via qemu cmdline -> already setup for us */
- xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
+ xen_be_printf(&blkdev->xendev, 2,
+ "get configured bdrv (cmdline setup)\n");
blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo);
if (blk_is_read_only(blkdev->blk) && !readonly) {
xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 4e35c82..399bb5d 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -156,7 +156,8 @@ static void xencons_send(struct XenConsole *con)
if (len < 1) {
if (!con->backlog) {
con->backlog = 1;
- xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
+ xen_be_printf(&con->xendev, 1,
+ "backlog piling up, nobody listening?\n");
}
} else {
buffer_advance(&con->buffer, len);
@@ -247,7 +248,8 @@ static int con_initialise(struct XenDevice *xendev)
}
}
- xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n",
+ xen_be_printf(xendev, 1,
+ "ring mfn %d, remote port %d, local port %d, limit %zd\n",
con->ring_ref,
con->xendev.remote_port,
con->xendev.local_port,
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index a9a93f9..9bcf60b 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -511,38 +511,45 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
int max_width, max_height;
if (fb_len_lim > fb_len_max) {
- xen_be_printf(&xenfb->c.xendev, 0, "fb size limit %zu exceeds %zu, corrected\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "fb size limit %zu exceeds %zu, corrected\n",
fb_len_lim, fb_len_max);
fb_len_lim = fb_len_max;
}
if (fb_len_lim && fb_len > fb_len_lim) {
- xen_be_printf(&xenfb->c.xendev, 0, "frontend fb size %zu limited to %zu\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "frontend fb size %zu limited to %zu\n",
fb_len, fb_len_lim);
fb_len = fb_len_lim;
}
if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
- xen_be_printf(&xenfb->c.xendev, 0, "can't handle frontend fb depth %d\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "can't handle frontend fb depth %d\n",
depth);
return -1;
}
if (row_stride <= 0 || row_stride > fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n", row_stride);
+ xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n",
+ row_stride);
return -1;
}
max_width = row_stride / (depth / 8);
if (width < 0 || width > max_width) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend width %d limited to %d\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "invalid frontend width %d limited to %d\n",
width, max_width);
width = max_width;
}
if (offset < 0 || offset >= fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend offset %d (max %zu)\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "invalid frontend offset %d (max %zu)\n",
offset, fb_len - 1);
return -1;
}
max_height = (fb_len - offset) / row_stride;
if (height < 0 || height > max_height) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend height %d limited to %d\n",
+ xen_be_printf(&xenfb->c.xendev, 0,
+ "invalid frontend height %d limited to %d\n",
height, max_height);
height = max_height;
}
@@ -554,7 +561,8 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
xenfb->offset = offset;
xenfb->up_fullscreen = 1;
xenfb->do_resize = 1;
- xen_be_printf(&xenfb->c.xendev, 1, "framebuffer %dx%dx%d offset %d stride %d\n",
+ xen_be_printf(&xenfb->c.xendev, 1,
+ "framebuffer %dx%dx%d offset %d stride %d\n",
width, height, depth, offset, row_stride);
return 0;
}
@@ -722,7 +730,8 @@ static void xenfb_update(void *opaque)
break;
}
dpy_gfx_replace_surface(xenfb->c.con, surface);
- xen_be_printf(&xenfb->c.xendev, 1, "update: resizing: %dx%d @ %d bpp%s\n",
+ xen_be_printf(&xenfb->c.xendev, 1,
+ "update: resizing: %dx%d @ %d bpp%s\n",
xenfb->width, xenfb->height, xenfb->depth,
is_buffer_shared(surface) ? " (shared)" : "");
xenfb->up_fullscreen = 1;
@@ -733,7 +742,8 @@ static void xenfb_update(void *opaque)
xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
} else if (xenfb->up_count) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n", xenfb->up_count);
+ xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n",
+ xenfb->up_count);
for (i = 0; i < xenfb->up_count; i++)
xenfb_guest_copy(xenfb,
xenfb->up_rects[i].x,
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index f401cd2..30efe47 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -140,7 +140,8 @@ static void net_tx_packets(struct XenNetDev *netdev)
#endif
if (txreq.size < 14) {
- xen_be_printf(&netdev->xendev, 0, "bad packet size: %d\n", txreq.size);
+ xen_be_printf(&netdev->xendev, 0, "bad packet size: %d\n",
+ txreq.size);
net_tx_error(netdev, &txreq, rc);
continue;
}
@@ -213,7 +214,8 @@ static void net_rx_response(struct XenNetDev *netdev,
resp->status = (int16_t)st;
}
- xen_be_printf(&netdev->xendev, 3, "rx response: idx %d, status %d, flags 0x%x\n",
+ xen_be_printf(&netdev->xendev, 3,
+ "rx response: idx %d, status %d, flags 0x%x\n",
i, resp->status, resp->flags);
netdev->rx_ring.rsp_prod_pvt = ++i;
@@ -256,7 +258,8 @@ static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size
netdev->xendev.dom,
rxreq.gref, PROT_WRITE);
if (page == NULL) {
- xen_be_printf(&netdev->xendev, 0, "error: rx gref dereference failed (%d)\n",
+ xen_be_printf(&netdev->xendev, 0,
+ "error: rx gref dereference failed (%d)\n",
rxreq.gref);
net_rx_response(netdev, &rxreq, NETIF_RSP_ERROR, 0, 0, 0);
return -1;
@@ -330,7 +333,8 @@ static int net_connect(struct XenDevice *xendev)
rx_copy = 0;
}
if (rx_copy == 0) {
- xen_be_printf(&netdev->xendev, 0, "frontend doesn't support rx-copy.\n");
+ xen_be_printf(&netdev->xendev, 0,
+ "frontend doesn't support rx-copy.\n");
return -1;
}
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 545ee47..0aca6ae 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -53,7 +53,8 @@ struct xs_dirs {
static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
QTAILQ_HEAD_INITIALIZER(xs_cleanup);
-static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs = QTAILQ_HEAD_INITIALIZER(xendevs);
+static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
+ QTAILQ_HEAD_INITIALIZER(xendevs);
static int debug;
/* ------------------------------------------------------------- */
@@ -205,7 +206,8 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
return xenstore_read_int(xendev->fe, node, ival);
}
-int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval)
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
+ uint64_t *uval)
{
return xenstore_read_uint64(xendev->fe, node, uval);
}
@@ -385,7 +387,8 @@ static void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
g_free(xendev->protocol);
xendev->protocol = xenstore_read_fe_str(xendev, "protocol");
if (xendev->protocol) {
- xen_be_printf(xendev, 1, "frontend protocol: %s\n", xendev->protocol);
+ xen_be_printf(xendev, 1, "frontend protocol: %s\n",
+ xendev->protocol);
}
}
@@ -617,7 +620,8 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops)
snprintf(token, sizeof(token), "be:%p:%d:%p", type, dom, ops);
snprintf(path, sizeof(path), "backend/%s/%d", type, dom);
if (!xs_watch(xenstore, path, token)) {
- xen_be_printf(NULL, 0, "xen be: watching backend path (%s) failed\n", path);
+ xen_be_printf(NULL, 0, "xen be: watching backend path (%s) failed\n",
+ path);
return -1;
}
@@ -830,7 +834,8 @@ int xen_be_send_notify(struct XenDevice *xendev)
* 2 == noisy debug messages (logfile only).
* 3 == will flood your log (logfile only).
*/
-void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...)
+void xen_be_printf(struct XenDevice *xendev, int msg_level,
+ const char *fmt, ...)
{
va_list args;
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 0df282a..0ccbc0f 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -79,7 +79,8 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
-int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval);
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
+ uint64_t *uval);
const char *xenbus_strstate(enum xenbus_state state);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
@@ -93,8 +94,9 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state);
int xen_be_bind_evtchn(struct XenDevice *xendev);
void xen_be_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
-void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...)
- GCC_FMT_ATTR(3, 4);
+void xen_be_printf(struct XenDevice *xendev, int msg_level,
+ const char *fmt, ...) GCC_FMT_ATTR(3, 4);
+
/* actual backend drivers */
extern struct XenDevOps xen_console_ops; /* xen_console.c */
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 03/15] xen: Create a new file xen_pvdev.c
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea, Quan Xu
The purpose of the new file is to store generic functions shared by frontend
and backends such as xenstore operations, xendevs.
Signed-off-by: Quan Xu <quan.xu@intel.com>
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/Makefile.objs | 2 +-
hw/xen/xen_backend.c | 126 +-----------------------------------
hw/xen/xen_pvdev.c | 150 +++++++++++++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 64 +-----------------
include/hw/xen/xen_pvdev.h | 69 ++++++++++++++++++++
5 files changed, 222 insertions(+), 189 deletions(-)
create mode 100644 hw/xen/xen_pvdev.c
create mode 100644 include/hw/xen/xen_pvdev.h
diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs
index d367094..591cdc2 100644
--- a/hw/xen/Makefile.objs
+++ b/hw/xen/Makefile.objs
@@ -1,5 +1,5 @@
# xen backend driver support
-common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
+common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o xen_pvdev.o
obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o
obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 0aca6ae..84142d8 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -30,6 +30,7 @@
#include "sysemu/char.h"
#include "qemu/log.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_pvdev.h"
#include <xen/grant_table.h>
@@ -57,8 +58,6 @@ static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
QTAILQ_HEAD_INITIALIZER(xendevs);
static int debug;
-/* ------------------------------------------------------------- */
-
static void xenstore_cleanup_dir(char *dir)
{
struct xs_dirs *d;
@@ -77,34 +76,6 @@ void xen_config_cleanup(void)
}
}
-int xenstore_write_str(const char *base, const char *node, const char *val)
-{
- char abspath[XEN_BUFSIZE];
-
- snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
- if (!xs_write(xenstore, 0, abspath, val, strlen(val))) {
- return -1;
- }
- return 0;
-}
-
-char *xenstore_read_str(const char *base, const char *node)
-{
- char abspath[XEN_BUFSIZE];
- unsigned int len;
- char *str, *ret = NULL;
-
- snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
- str = xs_read(xenstore, 0, abspath, &len);
- if (str != NULL) {
- /* move to qemu-allocated memory to make sure
- * callers can savely g_free() stuff. */
- ret = g_strdup(str);
- free(str);
- }
- return ret;
-}
-
int xenstore_mkdir(char *path, int p)
{
struct xs_permissions perms[2] = {
@@ -129,48 +100,6 @@ int xenstore_mkdir(char *path, int p)
return 0;
}
-int xenstore_write_int(const char *base, const char *node, int ival)
-{
- char val[12];
-
- snprintf(val, sizeof(val), "%d", ival);
- return xenstore_write_str(base, node, val);
-}
-
-int xenstore_write_int64(const char *base, const char *node, int64_t ival)
-{
- char val[21];
-
- snprintf(val, sizeof(val), "%"PRId64, ival);
- return xenstore_write_str(base, node, val);
-}
-
-int xenstore_read_int(const char *base, const char *node, int *ival)
-{
- char *val;
- int rc = -1;
-
- val = xenstore_read_str(base, node);
- if (val && 1 == sscanf(val, "%d", ival)) {
- rc = 0;
- }
- g_free(val);
- return rc;
-}
-
-int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
-{
- char *val;
- int rc = -1;
-
- val = xenstore_read_str(base, node);
- if (val && 1 == sscanf(val, "%"SCNu64, uval)) {
- rc = 0;
- }
- g_free(val);
- return rc;
-}
-
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val)
{
return xenstore_write_str(xendev->be, node, val);
@@ -214,20 +143,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
/* ------------------------------------------------------------- */
-const char *xenbus_strstate(enum xenbus_state state)
-{
- static const char *const name[] = {
- [XenbusStateUnknown] = "Unknown",
- [XenbusStateInitialising] = "Initialising",
- [XenbusStateInitWait] = "InitWait",
- [XenbusStateInitialised] = "Initialised",
- [XenbusStateConnected] = "Connected",
- [XenbusStateClosing] = "Closing",
- [XenbusStateClosed] = "Closed",
- };
- return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID";
-}
-
int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state)
{
int rc;
@@ -827,45 +742,6 @@ int xen_be_send_notify(struct XenDevice *xendev)
return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
}
-/*
- * msg_level:
- * 0 == errors (stderr + logfile).
- * 1 == informative debug messages (logfile only).
- * 2 == noisy debug messages (logfile only).
- * 3 == will flood your log (logfile only).
- */
-void xen_be_printf(struct XenDevice *xendev, int msg_level,
- const char *fmt, ...)
-{
- va_list args;
-
- if (xendev) {
- if (msg_level > xendev->debug) {
- return;
- }
- qemu_log("xen be: %s: ", xendev->name);
- if (msg_level == 0) {
- fprintf(stderr, "xen be: %s: ", xendev->name);
- }
- } else {
- if (msg_level > debug) {
- return;
- }
- qemu_log("xen be core: ");
- if (msg_level == 0) {
- fprintf(stderr, "xen be core: ");
- }
- }
- va_start(args, fmt);
- qemu_log_vprintf(fmt, args);
- va_end(args);
- if (msg_level == 0) {
- va_start(args, fmt);
- vfprintf(stderr, fmt, args);
- va_end(args);
- }
- qemu_log_flush();
-}
static int xen_sysdev_init(SysBusDevice *dev)
{
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
new file mode 100644
index 0000000..78960a9
--- /dev/null
+++ b/hw/xen/xen_pvdev.c
@@ -0,0 +1,150 @@
+/*
+ * Xen para-virtualization device
+ *
+ * (c) 2008 Gerd Hoffmann <kraxel@redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu/osdep.h"
+
+#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_pvdev.h"
+
+static int debug;
+/* ------------------------------------------------------------- */
+
+int xenstore_write_str(const char *base, const char *node, const char *val)
+{
+ char abspath[XEN_BUFSIZE];
+
+ snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
+ if (!xs_write(xenstore, 0, abspath, val, strlen(val))) {
+ return -1;
+ }
+ return 0;
+}
+
+char *xenstore_read_str(const char *base, const char *node)
+{
+ char abspath[XEN_BUFSIZE];
+ unsigned int len;
+ char *str, *ret = NULL;
+
+ snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
+ str = xs_read(xenstore, 0, abspath, &len);
+ if (str != NULL) {
+ /* move to qemu-allocated memory to make sure
+ * callers can savely g_free() stuff. */
+ ret = g_strdup(str);
+ free(str);
+ }
+ return ret;
+}
+
+int xenstore_write_int(const char *base, const char *node, int ival)
+{
+ char val[12];
+
+ snprintf(val, sizeof(val), "%d", ival);
+ return xenstore_write_str(base, node, val);
+}
+
+int xenstore_write_int64(const char *base, const char *node, int64_t ival)
+{
+ char val[21];
+
+ snprintf(val, sizeof(val), "%"PRId64, ival);
+ return xenstore_write_str(base, node, val);
+}
+
+int xenstore_read_int(const char *base, const char *node, int *ival)
+{
+ char *val;
+ int rc = -1;
+
+ val = xenstore_read_str(base, node);
+ if (val && 1 == sscanf(val, "%d", ival)) {
+ rc = 0;
+ }
+ g_free(val);
+ return rc;
+}
+
+int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
+{
+ char *val;
+ int rc = -1;
+
+ val = xenstore_read_str(base, node);
+ if (val && 1 == sscanf(val, "%"SCNu64, uval)) {
+ rc = 0;
+ }
+ g_free(val);
+ return rc;
+}
+
+const char *xenbus_strstate(enum xenbus_state state)
+{
+ static const char *const name[] = {
+ [XenbusStateUnknown] = "Unknown",
+ [XenbusStateInitialising] = "Initialising",
+ [XenbusStateInitWait] = "InitWait",
+ [XenbusStateInitialised] = "Initialised",
+ [XenbusStateConnected] = "Connected",
+ [XenbusStateClosing] = "Closing",
+ [XenbusStateClosed] = "Closed",
+ };
+ return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID";
+}
+
+/*
+ * msg_level:
+ * 0 == errors (stderr + logfile).
+ * 1 == informative debug messages (logfile only).
+ * 2 == noisy debug messages (logfile only).
+ * 3 == will flood your log (logfile only).
+ */
+void xen_be_printf(struct XenDevice *xendev, int msg_level,
+ const char *fmt, ...)
+{
+ va_list args;
+
+ if (xendev) {
+ if (msg_level > xendev->debug) {
+ return;
+ }
+ qemu_log("xen be: %s: ", xendev->name);
+ if (msg_level == 0) {
+ fprintf(stderr, "xen be: %s: ", xendev->name);
+ }
+ } else {
+ if (msg_level > debug) {
+ return;
+ }
+ qemu_log("xen be core: ");
+ if (msg_level == 0) {
+ fprintf(stderr, "xen be core: ");
+ }
+ }
+ va_start(args, fmt);
+ qemu_log_vprintf(fmt, args);
+ va_end(args);
+ if (msg_level == 0) {
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+ }
+ qemu_log_flush();
+}
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 0ccbc0f..2b8da3f 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -2,60 +2,10 @@
#define QEMU_HW_XEN_BACKEND_H
#include "hw/xen/xen_common.h"
+#include "hw/xen/xen_pvdev.h"
#include "sysemu/sysemu.h"
#include "net/net.h"
-/* ------------------------------------------------------------- */
-
-#define XEN_BUFSIZE 1024
-
-struct XenDevice;
-
-/* driver uses grant tables -> open gntdev device (xendev->gnttabdev) */
-#define DEVOPS_FLAG_NEED_GNTDEV 1
-/* don't expect frontend doing correct state transitions (aka console quirk) */
-#define DEVOPS_FLAG_IGNORE_STATE 2
-
-struct XenDevOps {
- size_t size;
- uint32_t flags;
- void (*alloc)(struct XenDevice *xendev);
- int (*init)(struct XenDevice *xendev);
- int (*initialise)(struct XenDevice *xendev);
- void (*connected)(struct XenDevice *xendev);
- void (*event)(struct XenDevice *xendev);
- void (*disconnect)(struct XenDevice *xendev);
- int (*free)(struct XenDevice *xendev);
- void (*backend_changed)(struct XenDevice *xendev, const char *node);
- void (*frontend_changed)(struct XenDevice *xendev, const char *node);
- int (*backend_register)(void);
-};
-
-struct XenDevice {
- const char *type;
- int dom;
- int dev;
- char name[64];
- int debug;
-
- enum xenbus_state be_state;
- enum xenbus_state fe_state;
- int online;
- char be[XEN_BUFSIZE];
- char *fe;
- char *protocol;
- int remote_port;
- int local_port;
-
- xenevtchn_handle *evtchndev;
- xengnttab_handle *gnttabdev;
-
- struct XenDevOps *ops;
- QTAILQ_ENTRY(XenDevice) next;
-};
-
-/* ------------------------------------------------------------- */
-
/* variables */
extern xc_interface *xen_xc;
extern xenforeignmemory_handle *xen_fmem;
@@ -63,14 +13,7 @@ extern struct xs_handle *xenstore;
extern const char *xen_protocol;
extern DeviceState *xen_sysdev;
-/* xenstore helper functions */
int xenstore_mkdir(char *path, int p);
-int xenstore_write_str(const char *base, const char *node, const char *val);
-int xenstore_write_int(const char *base, const char *node, int ival);
-int xenstore_write_int64(const char *base, const char *node, int64_t ival);
-char *xenstore_read_str(const char *base, const char *node);
-int xenstore_read_int(const char *base, const char *node, int *ival);
-
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val);
int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
@@ -78,11 +21,9 @@ char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
-int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
uint64_t *uval);
-const char *xenbus_strstate(enum xenbus_state state);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_check_state(struct XenDevice *xendev);
@@ -94,9 +35,6 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state);
int xen_be_bind_evtchn(struct XenDevice *xendev);
void xen_be_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
-void xen_be_printf(struct XenDevice *xendev, int msg_level,
- const char *fmt, ...) GCC_FMT_ATTR(3, 4);
-
/* actual backend drivers */
extern struct XenDevOps xen_console_ops; /* xen_console.c */
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
new file mode 100644
index 0000000..5c445a3
--- /dev/null
+++ b/include/hw/xen/xen_pvdev.h
@@ -0,0 +1,69 @@
+#ifndef QEMU_HW_XEN_PVDEV_H
+#define QEMU_HW_XEN_PVDEV_H
+
+#include "hw/xen/xen_common.h"
+/* ------------------------------------------------------------- */
+
+#define XEN_BUFSIZE 1024
+
+struct XenDevice;
+
+/* driver uses grant tables -> open gntdev device (xendev->gnttabdev) */
+#define DEVOPS_FLAG_NEED_GNTDEV 1
+/* don't expect frontend doing correct state transitions (aka console quirk) */
+#define DEVOPS_FLAG_IGNORE_STATE 2
+
+struct XenDevOps {
+ size_t size;
+ uint32_t flags;
+ void (*alloc)(struct XenDevice *xendev);
+ int (*init)(struct XenDevice *xendev);
+ int (*initialise)(struct XenDevice *xendev);
+ void (*connected)(struct XenDevice *xendev);
+ void (*event)(struct XenDevice *xendev);
+ void (*disconnect)(struct XenDevice *xendev);
+ int (*free)(struct XenDevice *xendev);
+ void (*backend_changed)(struct XenDevice *xendev, const char *node);
+ void (*frontend_changed)(struct XenDevice *xendev, const char *node);
+ int (*backend_register)(void);
+};
+
+struct XenDevice {
+ const char *type;
+ int dom;
+ int dev;
+ char name[64];
+ int debug;
+
+ enum xenbus_state be_state;
+ enum xenbus_state fe_state;
+ int online;
+ char be[XEN_BUFSIZE];
+ char *fe;
+ char *protocol;
+ int remote_port;
+ int local_port;
+
+ xenevtchn_handle *evtchndev;
+ xengnttab_handle *gnttabdev;
+
+ struct XenDevOps *ops;
+ QTAILQ_ENTRY(XenDevice) next;
+};
+
+/* ------------------------------------------------------------- */
+
+/* xenstore helper functions */
+int xenstore_write_str(const char *base, const char *node, const char *val);
+int xenstore_write_int(const char *base, const char *node, int ival);
+int xenstore_write_int64(const char *base, const char *node, int64_t ival);
+char *xenstore_read_str(const char *base, const char *node);
+int xenstore_read_int(const char *base, const char *node, int *ival);
+int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
+
+const char *xenbus_strstate(enum xenbus_state state);
+
+void xen_be_printf(struct XenDevice *xendev, int msg_level,
+ const char *fmt, ...) GCC_FMT_ATTR(3, 4);
+
+#endif /* QEMU_HW_XEN_PVDEV_H */
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 03/15] xen: Create a new file xen_pvdev.c
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel, Quan Xu,
anthony.perard, dgdegra, eblake, Emil Condrea
The purpose of the new file is to store generic functions shared by frontend
and backends such as xenstore operations, xendevs.
Signed-off-by: Quan Xu <quan.xu@intel.com>
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/Makefile.objs | 2 +-
hw/xen/xen_backend.c | 126 +-----------------------------------
hw/xen/xen_pvdev.c | 150 +++++++++++++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 64 +-----------------
include/hw/xen/xen_pvdev.h | 69 ++++++++++++++++++++
5 files changed, 222 insertions(+), 189 deletions(-)
create mode 100644 hw/xen/xen_pvdev.c
create mode 100644 include/hw/xen/xen_pvdev.h
diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs
index d367094..591cdc2 100644
--- a/hw/xen/Makefile.objs
+++ b/hw/xen/Makefile.objs
@@ -1,5 +1,5 @@
# xen backend driver support
-common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o
+common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o xen_pvdev.o
obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o
obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 0aca6ae..84142d8 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -30,6 +30,7 @@
#include "sysemu/char.h"
#include "qemu/log.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_pvdev.h"
#include <xen/grant_table.h>
@@ -57,8 +58,6 @@ static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
QTAILQ_HEAD_INITIALIZER(xendevs);
static int debug;
-/* ------------------------------------------------------------- */
-
static void xenstore_cleanup_dir(char *dir)
{
struct xs_dirs *d;
@@ -77,34 +76,6 @@ void xen_config_cleanup(void)
}
}
-int xenstore_write_str(const char *base, const char *node, const char *val)
-{
- char abspath[XEN_BUFSIZE];
-
- snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
- if (!xs_write(xenstore, 0, abspath, val, strlen(val))) {
- return -1;
- }
- return 0;
-}
-
-char *xenstore_read_str(const char *base, const char *node)
-{
- char abspath[XEN_BUFSIZE];
- unsigned int len;
- char *str, *ret = NULL;
-
- snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
- str = xs_read(xenstore, 0, abspath, &len);
- if (str != NULL) {
- /* move to qemu-allocated memory to make sure
- * callers can savely g_free() stuff. */
- ret = g_strdup(str);
- free(str);
- }
- return ret;
-}
-
int xenstore_mkdir(char *path, int p)
{
struct xs_permissions perms[2] = {
@@ -129,48 +100,6 @@ int xenstore_mkdir(char *path, int p)
return 0;
}
-int xenstore_write_int(const char *base, const char *node, int ival)
-{
- char val[12];
-
- snprintf(val, sizeof(val), "%d", ival);
- return xenstore_write_str(base, node, val);
-}
-
-int xenstore_write_int64(const char *base, const char *node, int64_t ival)
-{
- char val[21];
-
- snprintf(val, sizeof(val), "%"PRId64, ival);
- return xenstore_write_str(base, node, val);
-}
-
-int xenstore_read_int(const char *base, const char *node, int *ival)
-{
- char *val;
- int rc = -1;
-
- val = xenstore_read_str(base, node);
- if (val && 1 == sscanf(val, "%d", ival)) {
- rc = 0;
- }
- g_free(val);
- return rc;
-}
-
-int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
-{
- char *val;
- int rc = -1;
-
- val = xenstore_read_str(base, node);
- if (val && 1 == sscanf(val, "%"SCNu64, uval)) {
- rc = 0;
- }
- g_free(val);
- return rc;
-}
-
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val)
{
return xenstore_write_str(xendev->be, node, val);
@@ -214,20 +143,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
/* ------------------------------------------------------------- */
-const char *xenbus_strstate(enum xenbus_state state)
-{
- static const char *const name[] = {
- [XenbusStateUnknown] = "Unknown",
- [XenbusStateInitialising] = "Initialising",
- [XenbusStateInitWait] = "InitWait",
- [XenbusStateInitialised] = "Initialised",
- [XenbusStateConnected] = "Connected",
- [XenbusStateClosing] = "Closing",
- [XenbusStateClosed] = "Closed",
- };
- return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID";
-}
-
int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state)
{
int rc;
@@ -827,45 +742,6 @@ int xen_be_send_notify(struct XenDevice *xendev)
return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
}
-/*
- * msg_level:
- * 0 == errors (stderr + logfile).
- * 1 == informative debug messages (logfile only).
- * 2 == noisy debug messages (logfile only).
- * 3 == will flood your log (logfile only).
- */
-void xen_be_printf(struct XenDevice *xendev, int msg_level,
- const char *fmt, ...)
-{
- va_list args;
-
- if (xendev) {
- if (msg_level > xendev->debug) {
- return;
- }
- qemu_log("xen be: %s: ", xendev->name);
- if (msg_level == 0) {
- fprintf(stderr, "xen be: %s: ", xendev->name);
- }
- } else {
- if (msg_level > debug) {
- return;
- }
- qemu_log("xen be core: ");
- if (msg_level == 0) {
- fprintf(stderr, "xen be core: ");
- }
- }
- va_start(args, fmt);
- qemu_log_vprintf(fmt, args);
- va_end(args);
- if (msg_level == 0) {
- va_start(args, fmt);
- vfprintf(stderr, fmt, args);
- va_end(args);
- }
- qemu_log_flush();
-}
static int xen_sysdev_init(SysBusDevice *dev)
{
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
new file mode 100644
index 0000000..78960a9
--- /dev/null
+++ b/hw/xen/xen_pvdev.c
@@ -0,0 +1,150 @@
+/*
+ * Xen para-virtualization device
+ *
+ * (c) 2008 Gerd Hoffmann <kraxel@redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu/osdep.h"
+
+#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_pvdev.h"
+
+static int debug;
+/* ------------------------------------------------------------- */
+
+int xenstore_write_str(const char *base, const char *node, const char *val)
+{
+ char abspath[XEN_BUFSIZE];
+
+ snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
+ if (!xs_write(xenstore, 0, abspath, val, strlen(val))) {
+ return -1;
+ }
+ return 0;
+}
+
+char *xenstore_read_str(const char *base, const char *node)
+{
+ char abspath[XEN_BUFSIZE];
+ unsigned int len;
+ char *str, *ret = NULL;
+
+ snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
+ str = xs_read(xenstore, 0, abspath, &len);
+ if (str != NULL) {
+ /* move to qemu-allocated memory to make sure
+ * callers can savely g_free() stuff. */
+ ret = g_strdup(str);
+ free(str);
+ }
+ return ret;
+}
+
+int xenstore_write_int(const char *base, const char *node, int ival)
+{
+ char val[12];
+
+ snprintf(val, sizeof(val), "%d", ival);
+ return xenstore_write_str(base, node, val);
+}
+
+int xenstore_write_int64(const char *base, const char *node, int64_t ival)
+{
+ char val[21];
+
+ snprintf(val, sizeof(val), "%"PRId64, ival);
+ return xenstore_write_str(base, node, val);
+}
+
+int xenstore_read_int(const char *base, const char *node, int *ival)
+{
+ char *val;
+ int rc = -1;
+
+ val = xenstore_read_str(base, node);
+ if (val && 1 == sscanf(val, "%d", ival)) {
+ rc = 0;
+ }
+ g_free(val);
+ return rc;
+}
+
+int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
+{
+ char *val;
+ int rc = -1;
+
+ val = xenstore_read_str(base, node);
+ if (val && 1 == sscanf(val, "%"SCNu64, uval)) {
+ rc = 0;
+ }
+ g_free(val);
+ return rc;
+}
+
+const char *xenbus_strstate(enum xenbus_state state)
+{
+ static const char *const name[] = {
+ [XenbusStateUnknown] = "Unknown",
+ [XenbusStateInitialising] = "Initialising",
+ [XenbusStateInitWait] = "InitWait",
+ [XenbusStateInitialised] = "Initialised",
+ [XenbusStateConnected] = "Connected",
+ [XenbusStateClosing] = "Closing",
+ [XenbusStateClosed] = "Closed",
+ };
+ return (state < ARRAY_SIZE(name)) ? name[state] : "INVALID";
+}
+
+/*
+ * msg_level:
+ * 0 == errors (stderr + logfile).
+ * 1 == informative debug messages (logfile only).
+ * 2 == noisy debug messages (logfile only).
+ * 3 == will flood your log (logfile only).
+ */
+void xen_be_printf(struct XenDevice *xendev, int msg_level,
+ const char *fmt, ...)
+{
+ va_list args;
+
+ if (xendev) {
+ if (msg_level > xendev->debug) {
+ return;
+ }
+ qemu_log("xen be: %s: ", xendev->name);
+ if (msg_level == 0) {
+ fprintf(stderr, "xen be: %s: ", xendev->name);
+ }
+ } else {
+ if (msg_level > debug) {
+ return;
+ }
+ qemu_log("xen be core: ");
+ if (msg_level == 0) {
+ fprintf(stderr, "xen be core: ");
+ }
+ }
+ va_start(args, fmt);
+ qemu_log_vprintf(fmt, args);
+ va_end(args);
+ if (msg_level == 0) {
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+ }
+ qemu_log_flush();
+}
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 0ccbc0f..2b8da3f 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -2,60 +2,10 @@
#define QEMU_HW_XEN_BACKEND_H
#include "hw/xen/xen_common.h"
+#include "hw/xen/xen_pvdev.h"
#include "sysemu/sysemu.h"
#include "net/net.h"
-/* ------------------------------------------------------------- */
-
-#define XEN_BUFSIZE 1024
-
-struct XenDevice;
-
-/* driver uses grant tables -> open gntdev device (xendev->gnttabdev) */
-#define DEVOPS_FLAG_NEED_GNTDEV 1
-/* don't expect frontend doing correct state transitions (aka console quirk) */
-#define DEVOPS_FLAG_IGNORE_STATE 2
-
-struct XenDevOps {
- size_t size;
- uint32_t flags;
- void (*alloc)(struct XenDevice *xendev);
- int (*init)(struct XenDevice *xendev);
- int (*initialise)(struct XenDevice *xendev);
- void (*connected)(struct XenDevice *xendev);
- void (*event)(struct XenDevice *xendev);
- void (*disconnect)(struct XenDevice *xendev);
- int (*free)(struct XenDevice *xendev);
- void (*backend_changed)(struct XenDevice *xendev, const char *node);
- void (*frontend_changed)(struct XenDevice *xendev, const char *node);
- int (*backend_register)(void);
-};
-
-struct XenDevice {
- const char *type;
- int dom;
- int dev;
- char name[64];
- int debug;
-
- enum xenbus_state be_state;
- enum xenbus_state fe_state;
- int online;
- char be[XEN_BUFSIZE];
- char *fe;
- char *protocol;
- int remote_port;
- int local_port;
-
- xenevtchn_handle *evtchndev;
- xengnttab_handle *gnttabdev;
-
- struct XenDevOps *ops;
- QTAILQ_ENTRY(XenDevice) next;
-};
-
-/* ------------------------------------------------------------- */
-
/* variables */
extern xc_interface *xen_xc;
extern xenforeignmemory_handle *xen_fmem;
@@ -63,14 +13,7 @@ extern struct xs_handle *xenstore;
extern const char *xen_protocol;
extern DeviceState *xen_sysdev;
-/* xenstore helper functions */
int xenstore_mkdir(char *path, int p);
-int xenstore_write_str(const char *base, const char *node, const char *val);
-int xenstore_write_int(const char *base, const char *node, int ival);
-int xenstore_write_int64(const char *base, const char *node, int64_t ival);
-char *xenstore_read_str(const char *base, const char *node);
-int xenstore_read_int(const char *base, const char *node, int *ival);
-
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val);
int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
@@ -78,11 +21,9 @@ char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
-int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
uint64_t *uval);
-const char *xenbus_strstate(enum xenbus_state state);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_check_state(struct XenDevice *xendev);
@@ -94,9 +35,6 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state);
int xen_be_bind_evtchn(struct XenDevice *xendev);
void xen_be_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
-void xen_be_printf(struct XenDevice *xendev, int msg_level,
- const char *fmt, ...) GCC_FMT_ATTR(3, 4);
-
/* actual backend drivers */
extern struct XenDevOps xen_console_ops; /* xen_console.c */
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
new file mode 100644
index 0000000..5c445a3
--- /dev/null
+++ b/include/hw/xen/xen_pvdev.h
@@ -0,0 +1,69 @@
+#ifndef QEMU_HW_XEN_PVDEV_H
+#define QEMU_HW_XEN_PVDEV_H
+
+#include "hw/xen/xen_common.h"
+/* ------------------------------------------------------------- */
+
+#define XEN_BUFSIZE 1024
+
+struct XenDevice;
+
+/* driver uses grant tables -> open gntdev device (xendev->gnttabdev) */
+#define DEVOPS_FLAG_NEED_GNTDEV 1
+/* don't expect frontend doing correct state transitions (aka console quirk) */
+#define DEVOPS_FLAG_IGNORE_STATE 2
+
+struct XenDevOps {
+ size_t size;
+ uint32_t flags;
+ void (*alloc)(struct XenDevice *xendev);
+ int (*init)(struct XenDevice *xendev);
+ int (*initialise)(struct XenDevice *xendev);
+ void (*connected)(struct XenDevice *xendev);
+ void (*event)(struct XenDevice *xendev);
+ void (*disconnect)(struct XenDevice *xendev);
+ int (*free)(struct XenDevice *xendev);
+ void (*backend_changed)(struct XenDevice *xendev, const char *node);
+ void (*frontend_changed)(struct XenDevice *xendev, const char *node);
+ int (*backend_register)(void);
+};
+
+struct XenDevice {
+ const char *type;
+ int dom;
+ int dev;
+ char name[64];
+ int debug;
+
+ enum xenbus_state be_state;
+ enum xenbus_state fe_state;
+ int online;
+ char be[XEN_BUFSIZE];
+ char *fe;
+ char *protocol;
+ int remote_port;
+ int local_port;
+
+ xenevtchn_handle *evtchndev;
+ xengnttab_handle *gnttabdev;
+
+ struct XenDevOps *ops;
+ QTAILQ_ENTRY(XenDevice) next;
+};
+
+/* ------------------------------------------------------------- */
+
+/* xenstore helper functions */
+int xenstore_write_str(const char *base, const char *node, const char *val);
+int xenstore_write_int(const char *base, const char *node, int ival);
+int xenstore_write_int64(const char *base, const char *node, int64_t ival);
+char *xenstore_read_str(const char *base, const char *node);
+int xenstore_read_int(const char *base, const char *node, int *ival);
+int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
+
+const char *xenbus_strstate(enum xenbus_state state);
+
+void xen_be_printf(struct XenDevice *xendev, int msg_level,
+ const char *fmt, ...) GCC_FMT_ATTR(3, 4);
+
+#endif /* QEMU_HW_XEN_PVDEV_H */
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 04/15] xen: Create a new file xen_frontend.c
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea, Quan Xu
Its purpose is to store frontend related functions.
Signed-off-by: Quan Xu <quan.xu@intel.com>
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 1 +
hw/display/xenfb.c | 1 +
hw/net/xen_nic.c | 1 +
hw/usb/xen-usb.c | 1 +
hw/xen/Makefile.objs | 2 +-
hw/xen/xen_backend.c | 49 +----------------------------
hw/xen/xen_frontend.c | 72 +++++++++++++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 4 ---
include/hw/xen/xen_frontend.h | 11 +++++++
9 files changed, 89 insertions(+), 53 deletions(-)
create mode 100644 hw/xen/xen_frontend.c
create mode 100644 include/hw/xen/xen_frontend.h
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 24edeb2..0b2db3b 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -25,6 +25,7 @@
#include "hw/hw.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include "xen_blkif.h"
#include "sysemu/blockdev.h"
#include "sysemu/block-backend.h"
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 9bcf60b..9b10b35 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -30,6 +30,7 @@
#include "ui/console.h"
#include "sysemu/char.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include <xen/event_channel.h>
#include <xen/io/fbif.h>
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 30efe47..8db3448 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -29,6 +29,7 @@
#include "net/checksum.h"
#include "net/util.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include <xen/io/netif.h>
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 174d715..10773f2 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -28,6 +28,7 @@
#include "hw/sysbus.h"
#include "hw/usb.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include "monitor/qdev.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qint.h"
diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs
index 591cdc2..1000294 100644
--- a/hw/xen/Makefile.objs
+++ b/hw/xen/Makefile.objs
@@ -1,5 +1,5 @@
# xen backend driver support
-common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o xen_pvdev.o
+common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_frontend.o xen_devconfig.o xen_pvdev.o
obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o
obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 84142d8..d4880e1 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -30,6 +30,7 @@
#include "sysemu/char.h"
#include "qemu/log.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include "hw/xen/xen_pvdev.h"
#include <xen/grant_table.h>
@@ -125,22 +126,6 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival)
return xenstore_read_int(xendev->be, node, ival);
}
-char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node)
-{
- return xenstore_read_str(xendev->fe, node);
-}
-
-int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
-{
- return xenstore_read_int(xendev->fe, node, ival);
-}
-
-int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
- uint64_t *uval)
-{
- return xenstore_read_uint64(xendev->fe, node, uval);
-}
-
/* ------------------------------------------------------------- */
int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state)
@@ -283,38 +268,6 @@ static void xen_be_backend_changed(struct XenDevice *xendev, const char *node)
}
}
-static void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
-{
- int fe_state;
-
- if (node == NULL || strcmp(node, "state") == 0) {
- if (xenstore_read_fe_int(xendev, "state", &fe_state) == -1) {
- fe_state = XenbusStateUnknown;
- }
- if (xendev->fe_state != fe_state) {
- xen_be_printf(xendev, 1, "frontend state: %s -> %s\n",
- xenbus_strstate(xendev->fe_state),
- xenbus_strstate(fe_state));
- }
- xendev->fe_state = fe_state;
- }
- if (node == NULL || strcmp(node, "protocol") == 0) {
- g_free(xendev->protocol);
- xendev->protocol = xenstore_read_fe_str(xendev, "protocol");
- if (xendev->protocol) {
- xen_be_printf(xendev, 1, "frontend protocol: %s\n",
- xendev->protocol);
- }
- }
-
- if (node) {
- xen_be_printf(xendev, 2, "frontend update: %s\n", node);
- if (xendev->ops->frontend_changed) {
- xendev->ops->frontend_changed(xendev, node);
- }
- }
-}
-
/* ------------------------------------------------------------- */
/* Check for possible state transitions and perform them. */
diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
new file mode 100644
index 0000000..c8ff9ae
--- /dev/null
+++ b/hw/xen/xen_frontend.c
@@ -0,0 +1,72 @@
+/*
+ * Xen frontend driver infrastructure
+ *
+ * (c) 2008 Gerd Hoffmann <kraxel@redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu/osdep.h"
+
+#include "hw/xen/xen_pvdev.h"
+#include "hw/xen/xen_frontend.h"
+#include "hw/xen/xen_backend.h"
+
+char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node)
+{
+ return xenstore_read_str(xendev->fe, node);
+}
+
+int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
+{
+ return xenstore_read_int(xendev->fe, node, ival);
+}
+
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
+ uint64_t *uval)
+{
+ return xenstore_read_uint64(xendev->fe, node, uval);
+}
+
+void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
+{
+ int fe_state;
+
+ if (node == NULL || strcmp(node, "state") == 0) {
+ if (xenstore_read_fe_int(xendev, "state", &fe_state) == -1) {
+ fe_state = XenbusStateUnknown;
+ }
+ if (xendev->fe_state != fe_state) {
+ xen_be_printf(xendev, 1, "frontend state: %s -> %s\n",
+ xenbus_strstate(xendev->fe_state),
+ xenbus_strstate(fe_state));
+ }
+ xendev->fe_state = fe_state;
+ }
+ if (node == NULL || strcmp(node, "protocol") == 0) {
+ g_free(xendev->protocol);
+ xendev->protocol = xenstore_read_fe_str(xendev, "protocol");
+ if (xendev->protocol) {
+ xen_be_printf(xendev, 1, "frontend protocol: %s\n",
+ xendev->protocol);
+ }
+ }
+
+ if (node) {
+ xen_be_printf(xendev, 2, "frontend update: %s\n", node);
+ if (xendev->ops->frontend_changed) {
+ xendev->ops->frontend_changed(xendev, node);
+ }
+ }
+}
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 2b8da3f..ffd8772 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -19,10 +19,6 @@ int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
-char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
-int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
-int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
- uint64_t *uval);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_check_state(struct XenDevice *xendev);
diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
new file mode 100644
index 0000000..86243b9
--- /dev/null
+++ b/include/hw/xen/xen_frontend.h
@@ -0,0 +1,11 @@
+#ifndef QEMU_HW_XEN_FRONTEND_H
+#define QEMU_HW_XEN_FRONTEND_H
+
+char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
+int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
+ uint64_t *uval);
+
+void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
+
+#endif /* QEMU_HW_XEN_FRONTEND_H */
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 04/15] xen: Create a new file xen_frontend.c
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel, Quan Xu,
anthony.perard, dgdegra, eblake, Emil Condrea
Its purpose is to store frontend related functions.
Signed-off-by: Quan Xu <quan.xu@intel.com>
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 1 +
hw/display/xenfb.c | 1 +
hw/net/xen_nic.c | 1 +
hw/usb/xen-usb.c | 1 +
hw/xen/Makefile.objs | 2 +-
hw/xen/xen_backend.c | 49 +----------------------------
hw/xen/xen_frontend.c | 72 +++++++++++++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 4 ---
include/hw/xen/xen_frontend.h | 11 +++++++
9 files changed, 89 insertions(+), 53 deletions(-)
create mode 100644 hw/xen/xen_frontend.c
create mode 100644 include/hw/xen/xen_frontend.h
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 24edeb2..0b2db3b 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -25,6 +25,7 @@
#include "hw/hw.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include "xen_blkif.h"
#include "sysemu/blockdev.h"
#include "sysemu/block-backend.h"
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 9bcf60b..9b10b35 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -30,6 +30,7 @@
#include "ui/console.h"
#include "sysemu/char.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include <xen/event_channel.h>
#include <xen/io/fbif.h>
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 30efe47..8db3448 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -29,6 +29,7 @@
#include "net/checksum.h"
#include "net/util.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include <xen/io/netif.h>
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 174d715..10773f2 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -28,6 +28,7 @@
#include "hw/sysbus.h"
#include "hw/usb.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include "monitor/qdev.h"
#include "qapi/qmp/qbool.h"
#include "qapi/qmp/qint.h"
diff --git a/hw/xen/Makefile.objs b/hw/xen/Makefile.objs
index 591cdc2..1000294 100644
--- a/hw/xen/Makefile.objs
+++ b/hw/xen/Makefile.objs
@@ -1,5 +1,5 @@
# xen backend driver support
-common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o xen_pvdev.o
+common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_frontend.o xen_devconfig.o xen_pvdev.o
obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o
obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_graphics.o xen_pt_msi.o
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 84142d8..d4880e1 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -30,6 +30,7 @@
#include "sysemu/char.h"
#include "qemu/log.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include "hw/xen/xen_pvdev.h"
#include <xen/grant_table.h>
@@ -125,22 +126,6 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival)
return xenstore_read_int(xendev->be, node, ival);
}
-char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node)
-{
- return xenstore_read_str(xendev->fe, node);
-}
-
-int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
-{
- return xenstore_read_int(xendev->fe, node, ival);
-}
-
-int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
- uint64_t *uval)
-{
- return xenstore_read_uint64(xendev->fe, node, uval);
-}
-
/* ------------------------------------------------------------- */
int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state)
@@ -283,38 +268,6 @@ static void xen_be_backend_changed(struct XenDevice *xendev, const char *node)
}
}
-static void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
-{
- int fe_state;
-
- if (node == NULL || strcmp(node, "state") == 0) {
- if (xenstore_read_fe_int(xendev, "state", &fe_state) == -1) {
- fe_state = XenbusStateUnknown;
- }
- if (xendev->fe_state != fe_state) {
- xen_be_printf(xendev, 1, "frontend state: %s -> %s\n",
- xenbus_strstate(xendev->fe_state),
- xenbus_strstate(fe_state));
- }
- xendev->fe_state = fe_state;
- }
- if (node == NULL || strcmp(node, "protocol") == 0) {
- g_free(xendev->protocol);
- xendev->protocol = xenstore_read_fe_str(xendev, "protocol");
- if (xendev->protocol) {
- xen_be_printf(xendev, 1, "frontend protocol: %s\n",
- xendev->protocol);
- }
- }
-
- if (node) {
- xen_be_printf(xendev, 2, "frontend update: %s\n", node);
- if (xendev->ops->frontend_changed) {
- xendev->ops->frontend_changed(xendev, node);
- }
- }
-}
-
/* ------------------------------------------------------------- */
/* Check for possible state transitions and perform them. */
diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
new file mode 100644
index 0000000..c8ff9ae
--- /dev/null
+++ b/hw/xen/xen_frontend.c
@@ -0,0 +1,72 @@
+/*
+ * Xen frontend driver infrastructure
+ *
+ * (c) 2008 Gerd Hoffmann <kraxel@redhat.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>
+ */
+
+#include "qemu/osdep.h"
+
+#include "hw/xen/xen_pvdev.h"
+#include "hw/xen/xen_frontend.h"
+#include "hw/xen/xen_backend.h"
+
+char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node)
+{
+ return xenstore_read_str(xendev->fe, node);
+}
+
+int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
+{
+ return xenstore_read_int(xendev->fe, node, ival);
+}
+
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
+ uint64_t *uval)
+{
+ return xenstore_read_uint64(xendev->fe, node, uval);
+}
+
+void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
+{
+ int fe_state;
+
+ if (node == NULL || strcmp(node, "state") == 0) {
+ if (xenstore_read_fe_int(xendev, "state", &fe_state) == -1) {
+ fe_state = XenbusStateUnknown;
+ }
+ if (xendev->fe_state != fe_state) {
+ xen_be_printf(xendev, 1, "frontend state: %s -> %s\n",
+ xenbus_strstate(xendev->fe_state),
+ xenbus_strstate(fe_state));
+ }
+ xendev->fe_state = fe_state;
+ }
+ if (node == NULL || strcmp(node, "protocol") == 0) {
+ g_free(xendev->protocol);
+ xendev->protocol = xenstore_read_fe_str(xendev, "protocol");
+ if (xendev->protocol) {
+ xen_be_printf(xendev, 1, "frontend protocol: %s\n",
+ xendev->protocol);
+ }
+ }
+
+ if (node) {
+ xen_be_printf(xendev, 2, "frontend update: %s\n", node);
+ if (xendev->ops->frontend_changed) {
+ xendev->ops->frontend_changed(xendev, node);
+ }
+ }
+}
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 2b8da3f..ffd8772 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -19,10 +19,6 @@ int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
-char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
-int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
-int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
- uint64_t *uval);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_check_state(struct XenDevice *xendev);
diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
new file mode 100644
index 0000000..86243b9
--- /dev/null
+++ b/include/hw/xen/xen_frontend.h
@@ -0,0 +1,11 @@
+#ifndef QEMU_HW_XEN_FRONTEND_H
+#define QEMU_HW_XEN_FRONTEND_H
+
+char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
+int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
+int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
+ uint64_t *uval);
+
+void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
+
+#endif /* QEMU_HW_XEN_FRONTEND_H */
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 05/15] xen: Move xenstore_update to xen_pvdev.c
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
* xenstore_update -> xen_pvdev.c
* xenstore_update_fe -> xen_frontend.c
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 43 +------------------------------------------
hw/xen/xen_frontend.c | 18 ++++++++++++++++++
hw/xen/xen_pvdev.c | 24 ++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 2 ++
include/hw/xen/xen_frontend.h | 1 +
include/hw/xen/xen_pvdev.h | 1 +
6 files changed, 47 insertions(+), 42 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index d4880e1..6b03c50 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -509,7 +509,7 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops)
return 0;
}
-static void xenstore_update_be(char *watch, char *type, int dom,
+void xenstore_update_be(char *watch, char *type, int dom,
struct XenDevOps *ops)
{
struct XenDevice *xendev;
@@ -543,47 +543,6 @@ static void xenstore_update_be(char *watch, char *type, int dom,
}
}
-static void xenstore_update_fe(char *watch, struct XenDevice *xendev)
-{
- char *node;
- unsigned int len;
-
- len = strlen(xendev->fe);
- if (strncmp(xendev->fe, watch, len) != 0) {
- return;
- }
- if (watch[len] != '/') {
- return;
- }
- node = watch + len + 1;
-
- xen_be_frontend_changed(xendev, node);
- xen_be_check_state(xendev);
-}
-
-static void xenstore_update(void *unused)
-{
- char **vec = NULL;
- intptr_t type, ops, ptr;
- unsigned int dom, count;
-
- vec = xs_read_watch(xenstore, &count);
- if (vec == NULL) {
- goto cleanup;
- }
-
- if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR,
- &type, &dom, &ops) == 3) {
- xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops);
- }
- if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) {
- xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr);
- }
-
-cleanup:
- free(vec);
-}
-
static void xen_be_evtchn_event(void *opaque)
{
struct XenDevice *xendev = opaque;
diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
index c8ff9ae..d42e57b 100644
--- a/hw/xen/xen_frontend.c
+++ b/hw/xen/xen_frontend.c
@@ -70,3 +70,21 @@ void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
}
}
}
+
+void xenstore_update_fe(char *watch, struct XenDevice *xendev)
+{
+ char *node;
+ unsigned int len;
+
+ len = strlen(xendev->fe);
+ if (strncmp(xendev->fe, watch, len) != 0) {
+ return;
+ }
+ if (watch[len] != '/') {
+ return;
+ }
+ node = watch + len + 1;
+
+ xen_be_frontend_changed(xendev, node);
+ xen_be_check_state(xendev);
+}
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 78960a9..35d3be6 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include "hw/xen/xen_pvdev.h"
static int debug;
@@ -95,6 +96,29 @@ int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
return rc;
}
+void xenstore_update(void *unused)
+{
+ char **vec = NULL;
+ intptr_t type, ops, ptr;
+ unsigned int dom, count;
+
+ vec = xs_read_watch(xenstore, &count);
+ if (vec == NULL) {
+ goto cleanup;
+ }
+
+ if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR,
+ &type, &dom, &ops) == 3) {
+ xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops);
+ }
+ if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) {
+ xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr);
+ }
+
+cleanup:
+ free(vec);
+}
+
const char *xenbus_strstate(enum xenbus_state state)
{
static const char *const name[] = {
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index ffd8772..965a39a 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -19,6 +19,8 @@ int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
+void xenstore_update_be(char *watch, char *type, int dom,
+ struct XenDevOps *ops);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_check_state(struct XenDevice *xendev);
diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
index 86243b9..69a7694 100644
--- a/include/hw/xen/xen_frontend.h
+++ b/include/hw/xen/xen_frontend.h
@@ -5,6 +5,7 @@ char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
uint64_t *uval);
+void xenstore_update_fe(char *watch, struct XenDevice *xendev);
void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 5c445a3..3a9a4a4 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -60,6 +60,7 @@ int xenstore_write_int64(const char *base, const char *node, int64_t ival);
char *xenstore_read_str(const char *base, const char *node);
int xenstore_read_int(const char *base, const char *node, int *ival);
int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
+void xenstore_update(void *unused);
const char *xenbus_strstate(enum xenbus_state state);
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 05/15] xen: Move xenstore_update to xen_pvdev.c
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
* xenstore_update -> xen_pvdev.c
* xenstore_update_fe -> xen_frontend.c
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 43 +------------------------------------------
hw/xen/xen_frontend.c | 18 ++++++++++++++++++
hw/xen/xen_pvdev.c | 24 ++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 2 ++
include/hw/xen/xen_frontend.h | 1 +
include/hw/xen/xen_pvdev.h | 1 +
6 files changed, 47 insertions(+), 42 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index d4880e1..6b03c50 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -509,7 +509,7 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops)
return 0;
}
-static void xenstore_update_be(char *watch, char *type, int dom,
+void xenstore_update_be(char *watch, char *type, int dom,
struct XenDevOps *ops)
{
struct XenDevice *xendev;
@@ -543,47 +543,6 @@ static void xenstore_update_be(char *watch, char *type, int dom,
}
}
-static void xenstore_update_fe(char *watch, struct XenDevice *xendev)
-{
- char *node;
- unsigned int len;
-
- len = strlen(xendev->fe);
- if (strncmp(xendev->fe, watch, len) != 0) {
- return;
- }
- if (watch[len] != '/') {
- return;
- }
- node = watch + len + 1;
-
- xen_be_frontend_changed(xendev, node);
- xen_be_check_state(xendev);
-}
-
-static void xenstore_update(void *unused)
-{
- char **vec = NULL;
- intptr_t type, ops, ptr;
- unsigned int dom, count;
-
- vec = xs_read_watch(xenstore, &count);
- if (vec == NULL) {
- goto cleanup;
- }
-
- if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR,
- &type, &dom, &ops) == 3) {
- xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops);
- }
- if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) {
- xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr);
- }
-
-cleanup:
- free(vec);
-}
-
static void xen_be_evtchn_event(void *opaque)
{
struct XenDevice *xendev = opaque;
diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
index c8ff9ae..d42e57b 100644
--- a/hw/xen/xen_frontend.c
+++ b/hw/xen/xen_frontend.c
@@ -70,3 +70,21 @@ void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
}
}
}
+
+void xenstore_update_fe(char *watch, struct XenDevice *xendev)
+{
+ char *node;
+ unsigned int len;
+
+ len = strlen(xendev->fe);
+ if (strncmp(xendev->fe, watch, len) != 0) {
+ return;
+ }
+ if (watch[len] != '/') {
+ return;
+ }
+ node = watch + len + 1;
+
+ xen_be_frontend_changed(xendev, node);
+ xen_be_check_state(xendev);
+}
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 78960a9..35d3be6 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -20,6 +20,7 @@
#include "qemu/osdep.h"
#include "hw/xen/xen_backend.h"
+#include "hw/xen/xen_frontend.h"
#include "hw/xen/xen_pvdev.h"
static int debug;
@@ -95,6 +96,29 @@ int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval)
return rc;
}
+void xenstore_update(void *unused)
+{
+ char **vec = NULL;
+ intptr_t type, ops, ptr;
+ unsigned int dom, count;
+
+ vec = xs_read_watch(xenstore, &count);
+ if (vec == NULL) {
+ goto cleanup;
+ }
+
+ if (sscanf(vec[XS_WATCH_TOKEN], "be:%" PRIxPTR ":%d:%" PRIxPTR,
+ &type, &dom, &ops) == 3) {
+ xenstore_update_be(vec[XS_WATCH_PATH], (void *)type, dom, (void*)ops);
+ }
+ if (sscanf(vec[XS_WATCH_TOKEN], "fe:%" PRIxPTR, &ptr) == 1) {
+ xenstore_update_fe(vec[XS_WATCH_PATH], (void *)ptr);
+ }
+
+cleanup:
+ free(vec);
+}
+
const char *xenbus_strstate(enum xenbus_state state)
{
static const char *const name[] = {
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index ffd8772..965a39a 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -19,6 +19,8 @@ int xenstore_write_be_int(struct XenDevice *xendev, const char *node, int ival);
int xenstore_write_be_int64(struct XenDevice *xendev, const char *node, int64_t ival);
char *xenstore_read_be_str(struct XenDevice *xendev, const char *node);
int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
+void xenstore_update_be(char *watch, char *type, int dom,
+ struct XenDevOps *ops);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_check_state(struct XenDevice *xendev);
diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
index 86243b9..69a7694 100644
--- a/include/hw/xen/xen_frontend.h
+++ b/include/hw/xen/xen_frontend.h
@@ -5,6 +5,7 @@ char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
uint64_t *uval);
+void xenstore_update_fe(char *watch, struct XenDevice *xendev);
void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 5c445a3..3a9a4a4 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -60,6 +60,7 @@ int xenstore_write_int64(const char *base, const char *node, int64_t ival);
char *xenstore_read_str(const char *base, const char *node);
int xenstore_read_int(const char *base, const char *node, int *ival);
int xenstore_read_uint64(const char *base, const char *node, uint64_t *uval);
+void xenstore_update(void *unused);
const char *xenbus_strstate(enum xenbus_state state);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 06/15] xen: Move evtchn functions to xen_pvdev.c
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
The name of the functions moved:
* xen_be_evtchn_event
* xen_be_unbind_evtchn
* xen_be_send_notify
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 35 -----------------------------------
hw/xen/xen_pvdev.c | 35 +++++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 2 --
include/hw/xen/xen_pvdev.h | 4 ++++
4 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 6b03c50..c7db068 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -543,25 +543,6 @@ void xenstore_update_be(char *watch, char *type, int dom,
}
}
-static void xen_be_evtchn_event(void *opaque)
-{
- struct XenDevice *xendev = opaque;
- evtchn_port_t port;
-
- port = xenevtchn_pending(xendev->evtchndev);
- if (port != xendev->local_port) {
- xen_be_printf(xendev, 0,
- "xenevtchn_pending returned %d (expected %d)\n",
- port, xendev->local_port);
- return;
- }
- xenevtchn_unmask(xendev->evtchndev, port);
-
- if (xendev->ops->event) {
- xendev->ops->event(xendev);
- }
-}
-
/* -------------------------------------------------------------------- */
int xen_be_init(void)
@@ -638,22 +619,6 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
return 0;
}
-void xen_be_unbind_evtchn(struct XenDevice *xendev)
-{
- if (xendev->local_port == -1) {
- return;
- }
- qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
- xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
- xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
- xendev->local_port = -1;
-}
-
-int xen_be_send_notify(struct XenDevice *xendev)
-{
- return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
-}
-
static int xen_sysdev_init(SysBusDevice *dev)
{
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 35d3be6..91101fd 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -172,3 +172,38 @@ void xen_be_printf(struct XenDevice *xendev, int msg_level,
}
qemu_log_flush();
}
+
+void xen_be_evtchn_event(void *opaque)
+{
+ struct XenDevice *xendev = opaque;
+ evtchn_port_t port;
+
+ port = xenevtchn_pending(xendev->evtchndev);
+ if (port != xendev->local_port) {
+ xen_be_printf(xendev, 0,
+ "xenevtchn_pending returned %d (expected %d)\n",
+ port, xendev->local_port);
+ return;
+ }
+ xenevtchn_unmask(xendev->evtchndev, port);
+
+ if (xendev->ops->event) {
+ xendev->ops->event(xendev);
+ }
+}
+
+void xen_be_unbind_evtchn(struct XenDevice *xendev)
+{
+ if (xendev->local_port == -1) {
+ return;
+ }
+ qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
+ xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
+ xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
+ xendev->local_port = -1;
+}
+
+int xen_be_send_notify(struct XenDevice *xendev)
+{
+ return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
+}
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 965a39a..d0dbee5 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -31,8 +31,6 @@ void xen_be_register_common(void);
int xen_be_register(const char *type, struct XenDevOps *ops);
int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state);
int xen_be_bind_evtchn(struct XenDevice *xendev);
-void xen_be_unbind_evtchn(struct XenDevice *xendev);
-int xen_be_send_notify(struct XenDevice *xendev);
/* actual backend drivers */
extern struct XenDevOps xen_console_ops; /* xen_console.c */
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 3a9a4a4..cf44a87 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -64,6 +64,10 @@ void xenstore_update(void *unused);
const char *xenbus_strstate(enum xenbus_state state);
+void xen_be_evtchn_event(void *opaque);
+void xen_be_unbind_evtchn(struct XenDevice *xendev);
+int xen_be_send_notify(struct XenDevice *xendev);
+
void xen_be_printf(struct XenDevice *xendev, int msg_level,
const char *fmt, ...) GCC_FMT_ATTR(3, 4);
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 06/15] xen: Move evtchn functions to xen_pvdev.c
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
The name of the functions moved:
* xen_be_evtchn_event
* xen_be_unbind_evtchn
* xen_be_send_notify
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 35 -----------------------------------
hw/xen/xen_pvdev.c | 35 +++++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 2 --
include/hw/xen/xen_pvdev.h | 4 ++++
4 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 6b03c50..c7db068 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -543,25 +543,6 @@ void xenstore_update_be(char *watch, char *type, int dom,
}
}
-static void xen_be_evtchn_event(void *opaque)
-{
- struct XenDevice *xendev = opaque;
- evtchn_port_t port;
-
- port = xenevtchn_pending(xendev->evtchndev);
- if (port != xendev->local_port) {
- xen_be_printf(xendev, 0,
- "xenevtchn_pending returned %d (expected %d)\n",
- port, xendev->local_port);
- return;
- }
- xenevtchn_unmask(xendev->evtchndev, port);
-
- if (xendev->ops->event) {
- xendev->ops->event(xendev);
- }
-}
-
/* -------------------------------------------------------------------- */
int xen_be_init(void)
@@ -638,22 +619,6 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
return 0;
}
-void xen_be_unbind_evtchn(struct XenDevice *xendev)
-{
- if (xendev->local_port == -1) {
- return;
- }
- qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
- xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
- xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
- xendev->local_port = -1;
-}
-
-int xen_be_send_notify(struct XenDevice *xendev)
-{
- return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
-}
-
static int xen_sysdev_init(SysBusDevice *dev)
{
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 35d3be6..91101fd 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -172,3 +172,38 @@ void xen_be_printf(struct XenDevice *xendev, int msg_level,
}
qemu_log_flush();
}
+
+void xen_be_evtchn_event(void *opaque)
+{
+ struct XenDevice *xendev = opaque;
+ evtchn_port_t port;
+
+ port = xenevtchn_pending(xendev->evtchndev);
+ if (port != xendev->local_port) {
+ xen_be_printf(xendev, 0,
+ "xenevtchn_pending returned %d (expected %d)\n",
+ port, xendev->local_port);
+ return;
+ }
+ xenevtchn_unmask(xendev->evtchndev, port);
+
+ if (xendev->ops->event) {
+ xendev->ops->event(xendev);
+ }
+}
+
+void xen_be_unbind_evtchn(struct XenDevice *xendev)
+{
+ if (xendev->local_port == -1) {
+ return;
+ }
+ qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
+ xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
+ xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
+ xendev->local_port = -1;
+}
+
+int xen_be_send_notify(struct XenDevice *xendev)
+{
+ return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
+}
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index 965a39a..d0dbee5 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -31,8 +31,6 @@ void xen_be_register_common(void);
int xen_be_register(const char *type, struct XenDevOps *ops);
int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state);
int xen_be_bind_evtchn(struct XenDevice *xendev);
-void xen_be_unbind_evtchn(struct XenDevice *xendev);
-int xen_be_send_notify(struct XenDevice *xendev);
/* actual backend drivers */
extern struct XenDevOps xen_console_ops; /* xen_console.c */
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 3a9a4a4..cf44a87 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -64,6 +64,10 @@ void xenstore_update(void *unused);
const char *xenbus_strstate(enum xenbus_state state);
+void xen_be_evtchn_event(void *opaque);
+void xen_be_unbind_evtchn(struct XenDevice *xendev);
+int xen_be_send_notify(struct XenDevice *xendev);
+
void xen_be_printf(struct XenDevice *xendev, int msg_level,
const char *fmt, ...) GCC_FMT_ATTR(3, 4);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 07/15] xen: Prepare xendev qtail to be shared with frontends
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
* move xendevs qtail to xen_pvdev.c
* change xen_be_get_xendev to use a new function: xen_pv_insert_xendev
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 51 +-------------------------------------
hw/xen/xen_pvdev.c | 57 +++++++++++++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 1 -
include/hw/xen/xen_frontend.h | 2 ++
include/hw/xen/xen_pvdev.h | 4 +++
5 files changed, 64 insertions(+), 51 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index c7db068..d572cd0 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -55,8 +55,6 @@ struct xs_dirs {
static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
QTAILQ_HEAD_INITIALIZER(xs_cleanup);
-static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
- QTAILQ_HEAD_INITIALIZER(xendevs);
static int debug;
static void xenstore_cleanup_dir(char *dir)
@@ -142,27 +140,6 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state)
return 0;
}
-/* ------------------------------------------------------------- */
-
-struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev)
-{
- struct XenDevice *xendev;
-
- QTAILQ_FOREACH(xendev, &xendevs, next) {
- if (xendev->dom != dom) {
- continue;
- }
- if (xendev->dev != dev) {
- continue;
- }
- if (strcmp(xendev->type, type) != 0) {
- continue;
- }
- return xendev;
- }
- return NULL;
-}
-
/*
* get xen backend device, allocate a new one if it doesn't exist.
*/
@@ -211,7 +188,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
xendev->gnttabdev = NULL;
}
- QTAILQ_INSERT_TAIL(&xendevs, xendev, next);
+ xen_pv_insert_xendev(xendev);
if (xendev->ops->alloc) {
xendev->ops->alloc(xendev);
@@ -220,32 +197,6 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
return xendev;
}
-/*
- * release xen backend device.
- */
-static void xen_be_del_xendev(struct XenDevice *xendev)
-{
- if (xendev->ops->free) {
- xendev->ops->free(xendev);
- }
-
- if (xendev->fe) {
- char token[XEN_BUFSIZE];
- snprintf(token, sizeof(token), "fe:%p", xendev);
- xs_unwatch(xenstore, xendev->fe, token);
- g_free(xendev->fe);
- }
-
- if (xendev->evtchndev != NULL) {
- xenevtchn_close(xendev->evtchndev);
- }
- if (xendev->gnttabdev != NULL) {
- xengnttab_close(xendev->gnttabdev);
- }
-
- QTAILQ_REMOVE(&xendevs, xendev, next);
- g_free(xendev);
-}
/*
* Sync internal data structures on xenstore updates.
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 91101fd..72e2e79 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -23,7 +23,11 @@
#include "hw/xen/xen_frontend.h"
#include "hw/xen/xen_pvdev.h"
+/* private */
static int debug;
+static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
+ QTAILQ_HEAD_INITIALIZER(xendevs);
+
/* ------------------------------------------------------------- */
int xenstore_write_str(const char *base, const char *node, const char *val)
@@ -207,3 +211,56 @@ int xen_be_send_notify(struct XenDevice *xendev)
{
return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
}
+
+/* ------------------------------------------------------------- */
+
+struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev)
+{
+ struct XenDevice *xendev;
+
+ QTAILQ_FOREACH(xendev, &xendevs, next) {
+ if (xendev->dom != dom) {
+ continue;
+ }
+ if (xendev->dev != dev) {
+ continue;
+ }
+ if (strcmp(xendev->type, type) != 0) {
+ continue;
+ }
+ return xendev;
+ }
+ return NULL;
+}
+
+/*
+ * release xen backend device.
+ */
+void xen_be_del_xendev(struct XenDevice *xendev)
+{
+ if (xendev->ops->free) {
+ xendev->ops->free(xendev);
+ }
+
+ if (xendev->fe) {
+ char token[XEN_BUFSIZE];
+ snprintf(token, sizeof(token), "fe:%p", xendev);
+ xs_unwatch(xenstore, xendev->fe, token);
+ g_free(xendev->fe);
+ }
+
+ if (xendev->evtchndev != NULL) {
+ xenevtchn_close(xendev->evtchndev);
+ }
+ if (xendev->gnttabdev != NULL) {
+ xengnttab_close(xendev->gnttabdev);
+ }
+
+ QTAILQ_REMOVE(&xendevs, xendev, next);
+ g_free(xendev);
+}
+
+void xen_pv_insert_xendev(struct XenDevice *xendev)
+{
+ QTAILQ_INSERT_TAIL(&xendevs, xendev, next);
+}
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index d0dbee5..64d4fe3 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -22,7 +22,6 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
void xenstore_update_be(char *watch, char *type, int dom,
struct XenDevOps *ops);
-struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_check_state(struct XenDevice *xendev);
/* xen backend driver bits */
diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
index 69a7694..bb0bc23 100644
--- a/include/hw/xen/xen_frontend.h
+++ b/include/hw/xen/xen_frontend.h
@@ -1,6 +1,8 @@
#ifndef QEMU_HW_XEN_FRONTEND_H
#define QEMU_HW_XEN_FRONTEND_H
+#include "hw/xen/xen_pvdev.h"
+
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index cf44a87..337457e 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -65,6 +65,10 @@ void xenstore_update(void *unused);
const char *xenbus_strstate(enum xenbus_state state);
void xen_be_evtchn_event(void *opaque);
+void xen_pv_insert_xendev(struct XenDevice *xendev);
+void xen_be_del_xendev(struct XenDevice *xendev);
+struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
+
void xen_be_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 07/15] xen: Prepare xendev qtail to be shared with frontends
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
* move xendevs qtail to xen_pvdev.c
* change xen_be_get_xendev to use a new function: xen_pv_insert_xendev
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 51 +-------------------------------------
hw/xen/xen_pvdev.c | 57 +++++++++++++++++++++++++++++++++++++++++++
include/hw/xen/xen_backend.h | 1 -
include/hw/xen/xen_frontend.h | 2 ++
include/hw/xen/xen_pvdev.h | 4 +++
5 files changed, 64 insertions(+), 51 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index c7db068..d572cd0 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -55,8 +55,6 @@ struct xs_dirs {
static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
QTAILQ_HEAD_INITIALIZER(xs_cleanup);
-static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
- QTAILQ_HEAD_INITIALIZER(xendevs);
static int debug;
static void xenstore_cleanup_dir(char *dir)
@@ -142,27 +140,6 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state)
return 0;
}
-/* ------------------------------------------------------------- */
-
-struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev)
-{
- struct XenDevice *xendev;
-
- QTAILQ_FOREACH(xendev, &xendevs, next) {
- if (xendev->dom != dom) {
- continue;
- }
- if (xendev->dev != dev) {
- continue;
- }
- if (strcmp(xendev->type, type) != 0) {
- continue;
- }
- return xendev;
- }
- return NULL;
-}
-
/*
* get xen backend device, allocate a new one if it doesn't exist.
*/
@@ -211,7 +188,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
xendev->gnttabdev = NULL;
}
- QTAILQ_INSERT_TAIL(&xendevs, xendev, next);
+ xen_pv_insert_xendev(xendev);
if (xendev->ops->alloc) {
xendev->ops->alloc(xendev);
@@ -220,32 +197,6 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
return xendev;
}
-/*
- * release xen backend device.
- */
-static void xen_be_del_xendev(struct XenDevice *xendev)
-{
- if (xendev->ops->free) {
- xendev->ops->free(xendev);
- }
-
- if (xendev->fe) {
- char token[XEN_BUFSIZE];
- snprintf(token, sizeof(token), "fe:%p", xendev);
- xs_unwatch(xenstore, xendev->fe, token);
- g_free(xendev->fe);
- }
-
- if (xendev->evtchndev != NULL) {
- xenevtchn_close(xendev->evtchndev);
- }
- if (xendev->gnttabdev != NULL) {
- xengnttab_close(xendev->gnttabdev);
- }
-
- QTAILQ_REMOVE(&xendevs, xendev, next);
- g_free(xendev);
-}
/*
* Sync internal data structures on xenstore updates.
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 91101fd..72e2e79 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -23,7 +23,11 @@
#include "hw/xen/xen_frontend.h"
#include "hw/xen/xen_pvdev.h"
+/* private */
static int debug;
+static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
+ QTAILQ_HEAD_INITIALIZER(xendevs);
+
/* ------------------------------------------------------------- */
int xenstore_write_str(const char *base, const char *node, const char *val)
@@ -207,3 +211,56 @@ int xen_be_send_notify(struct XenDevice *xendev)
{
return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
}
+
+/* ------------------------------------------------------------- */
+
+struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev)
+{
+ struct XenDevice *xendev;
+
+ QTAILQ_FOREACH(xendev, &xendevs, next) {
+ if (xendev->dom != dom) {
+ continue;
+ }
+ if (xendev->dev != dev) {
+ continue;
+ }
+ if (strcmp(xendev->type, type) != 0) {
+ continue;
+ }
+ return xendev;
+ }
+ return NULL;
+}
+
+/*
+ * release xen backend device.
+ */
+void xen_be_del_xendev(struct XenDevice *xendev)
+{
+ if (xendev->ops->free) {
+ xendev->ops->free(xendev);
+ }
+
+ if (xendev->fe) {
+ char token[XEN_BUFSIZE];
+ snprintf(token, sizeof(token), "fe:%p", xendev);
+ xs_unwatch(xenstore, xendev->fe, token);
+ g_free(xendev->fe);
+ }
+
+ if (xendev->evtchndev != NULL) {
+ xenevtchn_close(xendev->evtchndev);
+ }
+ if (xendev->gnttabdev != NULL) {
+ xengnttab_close(xendev->gnttabdev);
+ }
+
+ QTAILQ_REMOVE(&xendevs, xendev, next);
+ g_free(xendev);
+}
+
+void xen_pv_insert_xendev(struct XenDevice *xendev)
+{
+ QTAILQ_INSERT_TAIL(&xendevs, xendev, next);
+}
diff --git a/include/hw/xen/xen_backend.h b/include/hw/xen/xen_backend.h
index d0dbee5..64d4fe3 100644
--- a/include/hw/xen/xen_backend.h
+++ b/include/hw/xen/xen_backend.h
@@ -22,7 +22,6 @@ int xenstore_read_be_int(struct XenDevice *xendev, const char *node, int *ival);
void xenstore_update_be(char *watch, char *type, int dom,
struct XenDevOps *ops);
-struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_check_state(struct XenDevice *xendev);
/* xen backend driver bits */
diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
index 69a7694..bb0bc23 100644
--- a/include/hw/xen/xen_frontend.h
+++ b/include/hw/xen/xen_frontend.h
@@ -1,6 +1,8 @@
#ifndef QEMU_HW_XEN_FRONTEND_H
#define QEMU_HW_XEN_FRONTEND_H
+#include "hw/xen/xen_pvdev.h"
+
char *xenstore_read_fe_str(struct XenDevice *xendev, const char *node);
int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival);
int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index cf44a87..337457e 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -65,6 +65,10 @@ void xenstore_update(void *unused);
const char *xenbus_strstate(enum xenbus_state state);
void xen_be_evtchn_event(void *opaque);
+void xen_pv_insert_xendev(struct XenDevice *xendev);
+void xen_be_del_xendev(struct XenDevice *xendev);
+struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
+
void xen_be_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 08/15] xen: Move xenstore cleanup and mkdir functions
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
The name of the functions moved to xen_pvdev.c:
* xenstore_cleanup_dir
* xen_config_cleanup
* xenstore_mkdir
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 49 -------------------------------------------------
hw/xen/xen_pvdev.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index d572cd0..3518aac 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -48,57 +48,8 @@ struct xs_handle *xenstore = NULL;
const char *xen_protocol;
/* private */
-struct xs_dirs {
- char *xs_dir;
- QTAILQ_ENTRY(xs_dirs) list;
-};
-static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
- QTAILQ_HEAD_INITIALIZER(xs_cleanup);
-
static int debug;
-static void xenstore_cleanup_dir(char *dir)
-{
- struct xs_dirs *d;
-
- d = g_malloc(sizeof(*d));
- d->xs_dir = dir;
- QTAILQ_INSERT_TAIL(&xs_cleanup, d, list);
-}
-
-void xen_config_cleanup(void)
-{
- struct xs_dirs *d;
-
- QTAILQ_FOREACH(d, &xs_cleanup, list) {
- xs_rm(xenstore, 0, d->xs_dir);
- }
-}
-
-int xenstore_mkdir(char *path, int p)
-{
- struct xs_permissions perms[2] = {
- {
- .id = 0, /* set owner: dom0 */
- }, {
- .id = xen_domid,
- .perms = p,
- }
- };
-
- if (!xs_mkdir(xenstore, 0, path)) {
- xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
- return -1;
- }
- xenstore_cleanup_dir(g_strdup(path));
-
- if (!xs_set_permissions(xenstore, 0, path, perms, 2)) {
- xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", path);
- return -1;
- }
- return 0;
-}
-
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val)
{
return xenstore_write_str(xendev->be, node, val);
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 72e2e79..6c92624 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -25,11 +25,62 @@
/* private */
static int debug;
+
+struct xs_dirs {
+ char *xs_dir;
+ QTAILQ_ENTRY(xs_dirs) list;
+};
+
+static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
+ QTAILQ_HEAD_INITIALIZER(xs_cleanup);
+
static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
QTAILQ_HEAD_INITIALIZER(xendevs);
/* ------------------------------------------------------------- */
+static void xenstore_cleanup_dir(char *dir)
+{
+ struct xs_dirs *d;
+
+ d = g_malloc(sizeof(*d));
+ d->xs_dir = dir;
+ QTAILQ_INSERT_TAIL(&xs_cleanup, d, list);
+}
+
+void xen_config_cleanup(void)
+{
+ struct xs_dirs *d;
+
+ QTAILQ_FOREACH(d, &xs_cleanup, list) {
+ xs_rm(xenstore, 0, d->xs_dir);
+ }
+}
+
+int xenstore_mkdir(char *path, int p)
+{
+ struct xs_permissions perms[2] = {
+ {
+ .id = 0, /* set owner: dom0 */
+ }, {
+ .id = xen_domid,
+ .perms = p,
+ }
+ };
+
+ if (!xs_mkdir(xenstore, 0, path)) {
+ xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
+ return -1;
+ }
+ xenstore_cleanup_dir(g_strdup(path));
+
+ if (!xs_set_permissions(xenstore, 0, path, perms, 2)) {
+ xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", path);
+ return -1;
+ }
+ return 0;
+}
+
int xenstore_write_str(const char *base, const char *node, const char *val)
{
char abspath[XEN_BUFSIZE];
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 08/15] xen: Move xenstore cleanup and mkdir functions
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
The name of the functions moved to xen_pvdev.c:
* xenstore_cleanup_dir
* xen_config_cleanup
* xenstore_mkdir
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 49 -------------------------------------------------
hw/xen/xen_pvdev.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index d572cd0..3518aac 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -48,57 +48,8 @@ struct xs_handle *xenstore = NULL;
const char *xen_protocol;
/* private */
-struct xs_dirs {
- char *xs_dir;
- QTAILQ_ENTRY(xs_dirs) list;
-};
-static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
- QTAILQ_HEAD_INITIALIZER(xs_cleanup);
-
static int debug;
-static void xenstore_cleanup_dir(char *dir)
-{
- struct xs_dirs *d;
-
- d = g_malloc(sizeof(*d));
- d->xs_dir = dir;
- QTAILQ_INSERT_TAIL(&xs_cleanup, d, list);
-}
-
-void xen_config_cleanup(void)
-{
- struct xs_dirs *d;
-
- QTAILQ_FOREACH(d, &xs_cleanup, list) {
- xs_rm(xenstore, 0, d->xs_dir);
- }
-}
-
-int xenstore_mkdir(char *path, int p)
-{
- struct xs_permissions perms[2] = {
- {
- .id = 0, /* set owner: dom0 */
- }, {
- .id = xen_domid,
- .perms = p,
- }
- };
-
- if (!xs_mkdir(xenstore, 0, path)) {
- xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
- return -1;
- }
- xenstore_cleanup_dir(g_strdup(path));
-
- if (!xs_set_permissions(xenstore, 0, path, perms, 2)) {
- xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", path);
- return -1;
- }
- return 0;
-}
-
int xenstore_write_be_str(struct XenDevice *xendev, const char *node, const char *val)
{
return xenstore_write_str(xendev->be, node, val);
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 72e2e79..6c92624 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -25,11 +25,62 @@
/* private */
static int debug;
+
+struct xs_dirs {
+ char *xs_dir;
+ QTAILQ_ENTRY(xs_dirs) list;
+};
+
+static QTAILQ_HEAD(xs_dirs_head, xs_dirs) xs_cleanup =
+ QTAILQ_HEAD_INITIALIZER(xs_cleanup);
+
static QTAILQ_HEAD(XenDeviceHead, XenDevice) xendevs =
QTAILQ_HEAD_INITIALIZER(xendevs);
/* ------------------------------------------------------------- */
+static void xenstore_cleanup_dir(char *dir)
+{
+ struct xs_dirs *d;
+
+ d = g_malloc(sizeof(*d));
+ d->xs_dir = dir;
+ QTAILQ_INSERT_TAIL(&xs_cleanup, d, list);
+}
+
+void xen_config_cleanup(void)
+{
+ struct xs_dirs *d;
+
+ QTAILQ_FOREACH(d, &xs_cleanup, list) {
+ xs_rm(xenstore, 0, d->xs_dir);
+ }
+}
+
+int xenstore_mkdir(char *path, int p)
+{
+ struct xs_permissions perms[2] = {
+ {
+ .id = 0, /* set owner: dom0 */
+ }, {
+ .id = xen_domid,
+ .perms = p,
+ }
+ };
+
+ if (!xs_mkdir(xenstore, 0, path)) {
+ xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
+ return -1;
+ }
+ xenstore_cleanup_dir(g_strdup(path));
+
+ if (!xs_set_permissions(xenstore, 0, path, perms, 2)) {
+ xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", path);
+ return -1;
+ }
+ return 0;
+}
+
int xenstore_write_str(const char *base, const char *node, const char *val)
{
char abspath[XEN_BUFSIZE];
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 09/15] xen: Rename xen_be_printf to xen_pv_printf
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
Prepare xen_be_printf to be used by both backend and frontends:
* xen_be_printf -> xen_pv_printf
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 58 +++++++++++++++++++++++-----------------------
hw/char/xen_console.c | 10 ++++----
hw/display/xenfb.c | 42 ++++++++++++++++-----------------
hw/net/xen_nic.c | 22 +++++++++---------
hw/usb/xen-usb.c | 38 +++++++++++++++---------------
hw/xen/xen_backend.c | 40 ++++++++++++++++----------------
hw/xen/xen_devconfig.c | 4 ++--
hw/xen/xen_frontend.c | 6 ++---
hw/xen/xen_pvdev.c | 10 ++++----
include/hw/xen/xen_pvdev.h | 2 +-
xen-common.c | 4 ++--
11 files changed, 118 insertions(+), 118 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 0b2db3b..425efba 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -168,12 +168,12 @@ static void destroy_grant(gpointer pgnt)
xengnttab_handle *gnt = grant->blkdev->xendev.gnttabdev;
if (xengnttab_unmap(gnt, grant->page, 1) != 0) {
- xen_be_printf(&grant->blkdev->xendev, 0,
+ xen_pv_printf(&grant->blkdev->xendev, 0,
"xengnttab_unmap failed: %s\n",
strerror(errno));
}
grant->blkdev->persistent_gnt_count--;
- xen_be_printf(&grant->blkdev->xendev, 3,
+ xen_pv_printf(&grant->blkdev->xendev, 3,
"unmapped grant %p\n", grant->page);
g_free(grant);
}
@@ -185,11 +185,11 @@ static void remove_persistent_region(gpointer data, gpointer dev)
xengnttab_handle *gnt = blkdev->xendev.gnttabdev;
if (xengnttab_unmap(gnt, region->addr, region->num) != 0) {
- xen_be_printf(&blkdev->xendev, 0,
+ xen_pv_printf(&blkdev->xendev, 0,
"xengnttab_unmap region %p failed: %s\n",
region->addr, strerror(errno));
}
- xen_be_printf(&blkdev->xendev, 3,
+ xen_pv_printf(&blkdev->xendev, 3,
"unmapped grant region %p with %d pages\n",
region->addr, region->num);
g_free(region);
@@ -256,7 +256,7 @@ static int ioreq_parse(struct ioreq *ioreq)
size_t len;
int i;
- xen_be_printf(&blkdev->xendev, 3,
+ xen_pv_printf(&blkdev->xendev, 3,
"op %d, nr %d, handle %d, id %" PRId64 ", sector %" PRId64 "\n",
ioreq->req.operation, ioreq->req.nr_segments,
ioreq->req.handle, ioreq->req.id, ioreq->req.sector_number);
@@ -276,28 +276,28 @@ static int ioreq_parse(struct ioreq *ioreq)
case BLKIF_OP_DISCARD:
return 0;
default:
- xen_be_printf(&blkdev->xendev, 0, "error: unknown operation (%d)\n",
+ xen_pv_printf(&blkdev->xendev, 0, "error: unknown operation (%d)\n",
ioreq->req.operation);
goto err;
};
if (ioreq->req.operation != BLKIF_OP_READ && blkdev->mode[0] != 'w') {
- xen_be_printf(&blkdev->xendev, 0, "error: write req for ro device\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: write req for ro device\n");
goto err;
}
ioreq->start = ioreq->req.sector_number * blkdev->file_blk;
for (i = 0; i < ioreq->req.nr_segments; i++) {
if (i == BLKIF_MAX_SEGMENTS_PER_REQUEST) {
- xen_be_printf(&blkdev->xendev, 0, "error: nr_segments too big\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: nr_segments too big\n");
goto err;
}
if (ioreq->req.seg[i].first_sect > ioreq->req.seg[i].last_sect) {
- xen_be_printf(&blkdev->xendev, 0, "error: first > last sector\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: first > last sector\n");
goto err;
}
if (ioreq->req.seg[i].last_sect * BLOCK_SIZE >= XC_PAGE_SIZE) {
- xen_be_printf(&blkdev->xendev, 0, "error: page crossing\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: page crossing\n");
goto err;
}
@@ -309,7 +309,7 @@ static int ioreq_parse(struct ioreq *ioreq)
qemu_iovec_add(&ioreq->v, (void*)mem, len);
}
if (ioreq->start + ioreq->v.size > blkdev->file_size) {
- xen_be_printf(&blkdev->xendev, 0, "error: access beyond end of file\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: access beyond end of file\n");
goto err;
}
return 0;
@@ -332,7 +332,7 @@ static void ioreq_unmap(struct ioreq *ioreq)
return;
}
if (xengnttab_unmap(gnt, ioreq->pages, ioreq->num_unmap) != 0) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"xengnttab_unmap failed: %s\n",
strerror(errno));
}
@@ -344,7 +344,7 @@ static void ioreq_unmap(struct ioreq *ioreq)
continue;
}
if (xengnttab_unmap(gnt, ioreq->page[i], 1) != 0) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"xengnttab_unmap failed: %s\n",
strerror(errno));
}
@@ -382,7 +382,7 @@ static int ioreq_map(struct ioreq *ioreq)
if (grant != NULL) {
page[i] = grant->page;
- xen_be_printf(&ioreq->blkdev->xendev, 3,
+ xen_pv_printf(&ioreq->blkdev->xendev, 3,
"using persistent-grant %" PRIu32 "\n",
ioreq->refs[i]);
} else {
@@ -411,7 +411,7 @@ static int ioreq_map(struct ioreq *ioreq)
ioreq->pages = xengnttab_map_grant_refs
(gnt, new_maps, domids, refs, ioreq->prot);
if (ioreq->pages == NULL) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"can't map %d grant refs (%s, %d maps)\n",
new_maps, strerror(errno), ioreq->blkdev->cnt_map);
return -1;
@@ -427,7 +427,7 @@ static int ioreq_map(struct ioreq *ioreq)
ioreq->page[i] = xengnttab_map_grant_ref
(gnt, domids[i], refs[i], ioreq->prot);
if (ioreq->page[i] == NULL) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"can't map grant ref %d (%s, %d maps)\n",
refs[i], strerror(errno), ioreq->blkdev->cnt_map);
ioreq->mapped = 1;
@@ -475,7 +475,7 @@ static int ioreq_map(struct ioreq *ioreq)
grant->page = ioreq->page[new_maps];
}
grant->blkdev = ioreq->blkdev;
- xen_be_printf(&ioreq->blkdev->xendev, 3,
+ xen_pv_printf(&ioreq->blkdev->xendev, 3,
"adding grant %" PRIu32 " page: %p\n",
refs[new_maps], grant->page);
g_tree_insert(ioreq->blkdev->persistent_gnts,
@@ -558,7 +558,7 @@ static int ioreq_grant_copy(struct ioreq *ioreq)
rc = xengnttab_grant_copy(gnt, count, segs);
if (rc) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"failed to copy data %d\n", rc);
ioreq->aio_errors++;
return -1;
@@ -566,7 +566,7 @@ static int ioreq_grant_copy(struct ioreq *ioreq)
for (i = 0; i < count; i++) {
if (segs[i].status != GNTST_okay) {
- xen_be_printf(&ioreq->blkdev->xendev, 3,
+ xen_pv_printf(&ioreq->blkdev->xendev, 3,
"failed to copy data %d for gref %d, domid %d\n",
segs[i].status, ioreq->refs[i], ioreq->domids[i]);
ioreq->aio_errors++;
@@ -600,7 +600,7 @@ static void qemu_aio_complete(void *opaque, int ret)
struct ioreq *ioreq = opaque;
if (ret != 0) {
- xen_be_printf(&ioreq->blkdev->xendev, 0, "%s I/O error\n",
+ xen_pv_printf(&ioreq->blkdev->xendev, 0, "%s I/O error\n",
ioreq->req.operation == BLKIF_OP_READ ? "read" : "write");
ioreq->aio_errors++;
}
@@ -911,7 +911,7 @@ static void blk_alloc(struct XenDevice *xendev)
}
if (xengnttab_set_max_grants(xendev->gnttabdev,
MAX_GRANTS(max_requests, BLKIF_MAX_SEGMENTS_PER_REQUEST)) < 0) {
- xen_be_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
+ xen_pv_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
strerror(errno));
}
}
@@ -1057,11 +1057,11 @@ static int blk_connect(struct XenDevice *xendev)
}
/* setup via xenbus -> create new block driver instance */
- xen_be_printf(&blkdev->xendev, 2, "create new bdrv (xenbus setup)\n");
+ xen_pv_printf(&blkdev->xendev, 2, "create new bdrv (xenbus setup)\n");
blkdev->blk = blk_new_open(blkdev->filename, NULL, options,
qflags, &local_err);
if (!blkdev->blk) {
- xen_be_printf(&blkdev->xendev, 0, "error: %s\n",
+ xen_pv_printf(&blkdev->xendev, 0, "error: %s\n",
error_get_pretty(local_err));
error_free(local_err);
return -1;
@@ -1069,11 +1069,11 @@ static int blk_connect(struct XenDevice *xendev)
blk_set_enable_write_cache(blkdev->blk, !writethrough);
} else {
/* setup via qemu cmdline -> already setup for us */
- xen_be_printf(&blkdev->xendev, 2,
+ xen_pv_printf(&blkdev->xendev, 2,
"get configured bdrv (cmdline setup)\n");
blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo);
if (blk_is_read_only(blkdev->blk) && !readonly) {
- xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
+ xen_pv_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
blkdev->blk = NULL;
return -1;
}
@@ -1086,13 +1086,13 @@ static int blk_connect(struct XenDevice *xendev)
if (blkdev->file_size < 0) {
BlockDriverState *bs = blk_bs(blkdev->blk);
const char *drv_name = bs ? bdrv_get_format_name(bs) : NULL;
- xen_be_printf(&blkdev->xendev, 1, "blk_getlength: %d (%s) | drv %s\n",
+ xen_pv_printf(&blkdev->xendev, 1, "blk_getlength: %d (%s) | drv %s\n",
(int)blkdev->file_size, strerror(-blkdev->file_size),
drv_name ?: "-");
blkdev->file_size = 0;
}
- xen_be_printf(xendev, 1, "type \"%s\", fileproto \"%s\", filename \"%s\","
+ xen_pv_printf(xendev, 1, "type \"%s\", fileproto \"%s\", filename \"%s\","
" size %" PRId64 " (%" PRId64 " MB)\n",
blkdev->type, blkdev->fileproto, blkdev->filename,
blkdev->file_size, blkdev->file_size >> 20);
@@ -1176,10 +1176,10 @@ static int blk_connect(struct XenDevice *xendev)
blkdev->feature_grant_copy =
(xengnttab_grant_copy(blkdev->xendev.gnttabdev, 0, NULL) == 0);
- xen_be_printf(&blkdev->xendev, 3, "grant copy operation %s\n",
+ xen_pv_printf(&blkdev->xendev, 3, "grant copy operation %s\n",
blkdev->feature_grant_copy ? "enabled" : "disabled");
- xen_be_printf(&blkdev->xendev, 1, "ok: proto %s, ring-ref %d, "
+ xen_pv_printf(&blkdev->xendev, 1, "ok: proto %s, ring-ref %d, "
"remote port %d, local port %d\n",
blkdev->xendev.protocol, blkdev->ring_ref,
blkdev->xendev.remote_port, blkdev->xendev.local_port);
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 399bb5d..b705a06 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -156,14 +156,14 @@ static void xencons_send(struct XenConsole *con)
if (len < 1) {
if (!con->backlog) {
con->backlog = 1;
- xen_be_printf(&con->xendev, 1,
+ xen_pv_printf(&con->xendev, 1,
"backlog piling up, nobody listening?\n");
}
} else {
buffer_advance(&con->buffer, len);
if (con->backlog && len == size) {
con->backlog = 0;
- xen_be_printf(&con->xendev, 1, "backlog is gone\n");
+ xen_pv_printf(&con->xendev, 1, "backlog is gone\n");
}
}
}
@@ -188,7 +188,7 @@ static int con_init(struct XenDevice *xendev)
type = xenstore_read_str(con->console, "type");
if (!type || strcmp(type, "ioemu") != 0) {
- xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
+ xen_pv_printf(xendev, 1, "not for me (type=%s)\n", type);
ret = -1;
goto out;
}
@@ -241,14 +241,14 @@ static int con_initialise(struct XenDevice *xendev)
qemu_chr_add_handlers(con->chr, xencons_can_receive,
xencons_receive, NULL, con);
} else {
- xen_be_printf(xendev, 0,
+ xen_pv_printf(xendev, 0,
"xen_console_init error chardev %s already used\n",
con->chr->label);
con->chr = NULL;
}
}
- xen_be_printf(xendev, 1,
+ xen_pv_printf(xendev, 1,
"ring mfn %d, remote port %d, local port %d, limit %zd\n",
con->ring_ref,
con->xendev.remote_port,
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 9b10b35..55aca85 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -104,7 +104,7 @@ static int common_bind(struct common *c)
return -1;
xen_be_bind_evtchn(&c->xendev);
- xen_be_printf(&c->xendev, 1,
+ xen_pv_printf(&c->xendev, 1,
"ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n",
mfn, c->xendev.remote_port, c->xendev.local_port);
@@ -347,7 +347,7 @@ static int input_initialise(struct XenDevice *xendev)
int rc;
if (!in->c.con) {
- xen_be_printf(xendev, 1, "ds not set (yet)\n");
+ xen_pv_printf(xendev, 1, "ds not set (yet)\n");
return -1;
}
@@ -512,44 +512,44 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
int max_width, max_height;
if (fb_len_lim > fb_len_max) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"fb size limit %zu exceeds %zu, corrected\n",
fb_len_lim, fb_len_max);
fb_len_lim = fb_len_max;
}
if (fb_len_lim && fb_len > fb_len_lim) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"frontend fb size %zu limited to %zu\n",
fb_len, fb_len_lim);
fb_len = fb_len_lim;
}
if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"can't handle frontend fb depth %d\n",
depth);
return -1;
}
if (row_stride <= 0 || row_stride > fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n",
+ xen_pv_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n",
row_stride);
return -1;
}
max_width = row_stride / (depth / 8);
if (width < 0 || width > max_width) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"invalid frontend width %d limited to %d\n",
width, max_width);
width = max_width;
}
if (offset < 0 || offset >= fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"invalid frontend offset %d (max %zu)\n",
offset, fb_len - 1);
return -1;
}
max_height = (fb_len - offset) / row_stride;
if (height < 0 || height > max_height) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"invalid frontend height %d limited to %d\n",
height, max_height);
height = max_height;
@@ -562,7 +562,7 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
xenfb->offset = offset;
xenfb->up_fullscreen = 1;
xenfb->do_resize = 1;
- xen_be_printf(&xenfb->c.xendev, 1,
+ xen_pv_printf(&xenfb->c.xendev, 1,
"framebuffer %dx%dx%d offset %d stride %d\n",
width, height, depth, offset, row_stride);
return 0;
@@ -641,7 +641,7 @@ static void xenfb_guest_copy(struct XenFB *xenfb, int x, int y, int w, int h)
}
}
if (oops) /* should not happen */
- xen_be_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp?\n",
+ xen_pv_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp?\n",
__FUNCTION__, xenfb->depth, bpp);
dpy_gfx_update(xenfb->c.con, x, y, w, h);
@@ -731,7 +731,7 @@ static void xenfb_update(void *opaque)
break;
}
dpy_gfx_replace_surface(xenfb->c.con, surface);
- xen_be_printf(&xenfb->c.xendev, 1,
+ xen_pv_printf(&xenfb->c.xendev, 1,
"update: resizing: %dx%d @ %d bpp%s\n",
xenfb->width, xenfb->height, xenfb->depth,
is_buffer_shared(surface) ? " (shared)" : "");
@@ -740,10 +740,10 @@ static void xenfb_update(void *opaque)
/* run queued updates */
if (xenfb->up_fullscreen) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
+ xen_pv_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
} else if (xenfb->up_count) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n",
+ xen_pv_printf(&xenfb->c.xendev, 3, "update: %d rects\n",
xenfb->up_count);
for (i = 0; i < xenfb->up_count; i++)
xenfb_guest_copy(xenfb,
@@ -752,7 +752,7 @@ static void xenfb_update(void *opaque)
xenfb->up_rects[i].w,
xenfb->up_rects[i].h);
} else {
- xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n");
+ xen_pv_printf(&xenfb->c.xendev, 3, "update: nothing\n");
}
xenfb->up_count = 0;
xenfb->up_fullscreen = 0;
@@ -806,14 +806,14 @@ static void xenfb_handle_events(struct XenFB *xenfb)
w = MIN(event->update.width, xenfb->width - x);
h = MIN(event->update.height, xenfb->height - y);
if (w < 0 || h < 0) {
- xen_be_printf(&xenfb->c.xendev, 1, "bogus update ignored\n");
+ xen_pv_printf(&xenfb->c.xendev, 1, "bogus update ignored\n");
break;
}
if (x != event->update.x ||
y != event->update.y ||
w != event->update.width ||
h != event->update.height) {
- xen_be_printf(&xenfb->c.xendev, 1, "bogus update clipped\n");
+ xen_pv_printf(&xenfb->c.xendev, 1, "bogus update clipped\n");
}
if (w == xenfb->width && h > xenfb->height / 2) {
/* scroll detector: updated more than 50% of the lines,
@@ -895,7 +895,7 @@ static int fb_initialise(struct XenDevice *xendev)
if (fb->feature_update)
xenstore_write_be_int(xendev, "request-update", 1);
- xen_be_printf(xendev, 1, "feature-update=%d, videoram=%d\n",
+ xen_pv_printf(xendev, 1, "feature-update=%d, videoram=%d\n",
fb->feature_update, videoram);
return 0;
}
@@ -914,7 +914,7 @@ static void fb_disconnect(struct XenDevice *xendev)
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON,
-1, 0);
if (fb->pixels == MAP_FAILED) {
- xen_be_printf(xendev, 0,
+ xen_pv_printf(xendev, 0,
"Couldn't replace the framebuffer with anonymous memory errno=%d\n",
errno);
}
@@ -935,7 +935,7 @@ static void fb_frontend_changed(struct XenDevice *xendev, const char *node)
if (fb->bug_trigger == 0 && strcmp(node, "state") == 0 &&
xendev->fe_state == XenbusStateConnected &&
xendev->be_state == XenbusStateConnected) {
- xen_be_printf(xendev, 2, "re-trigger connected (frontend bug)\n");
+ xen_pv_printf(xendev, 2, "re-trigger connected (frontend bug)\n");
xen_be_set_state(xendev, XenbusStateConnected);
fb->bug_trigger = 1; /* only once */
}
@@ -996,7 +996,7 @@ wait_more:
usleep(10000);
goto wait_more;
}
- xen_be_printf(NULL, 1, "displaystate setup failed\n");
+ xen_pv_printf(NULL, 1, "displaystate setup failed\n");
return;
}
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 8db3448..7418a7b 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -129,31 +129,31 @@ static void net_tx_packets(struct XenNetDev *netdev)
/* should not happen in theory, we don't announce the *
* feature-{sg,gso,whatelse} flags in xenstore (yet?) */
if (txreq.flags & NETTXF_extra_info) {
- xen_be_printf(&netdev->xendev, 0, "FIXME: extra info flag\n");
+ xen_pv_printf(&netdev->xendev, 0, "FIXME: extra info flag\n");
net_tx_error(netdev, &txreq, rc);
continue;
}
if (txreq.flags & NETTXF_more_data) {
- xen_be_printf(&netdev->xendev, 0, "FIXME: more data flag\n");
+ xen_pv_printf(&netdev->xendev, 0, "FIXME: more data flag\n");
net_tx_error(netdev, &txreq, rc);
continue;
}
#endif
if (txreq.size < 14) {
- xen_be_printf(&netdev->xendev, 0, "bad packet size: %d\n",
+ xen_pv_printf(&netdev->xendev, 0, "bad packet size: %d\n",
txreq.size);
net_tx_error(netdev, &txreq, rc);
continue;
}
if ((txreq.offset + txreq.size) > XC_PAGE_SIZE) {
- xen_be_printf(&netdev->xendev, 0, "error: page crossing\n");
+ xen_pv_printf(&netdev->xendev, 0, "error: page crossing\n");
net_tx_error(netdev, &txreq, rc);
continue;
}
- xen_be_printf(&netdev->xendev, 3,
+ xen_pv_printf(&netdev->xendev, 3,
"tx packet ref %d, off %d, len %d, flags 0x%x%s%s%s%s\n",
txreq.gref, txreq.offset, txreq.size, txreq.flags,
(txreq.flags & NETTXF_csum_blank) ? " csum_blank" : "",
@@ -165,7 +165,7 @@ static void net_tx_packets(struct XenNetDev *netdev)
netdev->xendev.dom,
txreq.gref, PROT_READ);
if (page == NULL) {
- xen_be_printf(&netdev->xendev, 0,
+ xen_pv_printf(&netdev->xendev, 0,
"error: tx gref dereference failed (%d)\n",
txreq.gref);
net_tx_error(netdev, &txreq, rc);
@@ -215,7 +215,7 @@ static void net_rx_response(struct XenNetDev *netdev,
resp->status = (int16_t)st;
}
- xen_be_printf(&netdev->xendev, 3,
+ xen_pv_printf(&netdev->xendev, 3,
"rx response: idx %d, status %d, flags 0x%x\n",
i, resp->status, resp->flags);
@@ -247,7 +247,7 @@ static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size
return 0;
}
if (size > XC_PAGE_SIZE - NET_IP_ALIGN) {
- xen_be_printf(&netdev->xendev, 0, "packet too big (%lu > %ld)",
+ xen_pv_printf(&netdev->xendev, 0, "packet too big (%lu > %ld)",
(unsigned long)size, XC_PAGE_SIZE - NET_IP_ALIGN);
return -1;
}
@@ -259,7 +259,7 @@ static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size
netdev->xendev.dom,
rxreq.gref, PROT_WRITE);
if (page == NULL) {
- xen_be_printf(&netdev->xendev, 0,
+ xen_pv_printf(&netdev->xendev, 0,
"error: rx gref dereference failed (%d)\n",
rxreq.gref);
net_rx_response(netdev, &rxreq, NETIF_RSP_ERROR, 0, 0, 0);
@@ -334,7 +334,7 @@ static int net_connect(struct XenDevice *xendev)
rx_copy = 0;
}
if (rx_copy == 0) {
- xen_be_printf(&netdev->xendev, 0,
+ xen_pv_printf(&netdev->xendev, 0,
"frontend doesn't support rx-copy.\n");
return -1;
}
@@ -360,7 +360,7 @@ static int net_connect(struct XenDevice *xendev)
xen_be_bind_evtchn(&netdev->xendev);
- xen_be_printf(&netdev->xendev, 1, "ok: tx-ring-ref %d, rx-ring-ref %d, "
+ xen_pv_printf(&netdev->xendev, 1, "ok: tx-ring-ref %d, rx-ring-ref %d, "
"remote port %d, local port %d\n",
netdev->tx_ring_ref, netdev->rx_ring_ref,
netdev->xendev.remote_port, netdev->xendev.local_port);
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 10773f2..a245355 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -48,7 +48,7 @@
struct timeval tv; \
\
gettimeofday(&tv, NULL); \
- xen_be_printf(xendev, lvl, "%8ld.%06ld xen-usb(%s):" fmt, \
+ xen_pv_printf(xendev, lvl, "%8ld.%06ld xen-usb(%s):" fmt, \
tv.tv_sec, tv.tv_usec, __func__, ##args); \
}
#define TR_BUS(xendev, fmt, args...) TR(xendev, 2, fmt, ##args)
@@ -154,7 +154,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req)
}
if (nr_segs > USBIF_MAX_SEGMENTS_PER_REQUEST) {
- xen_be_printf(xendev, 0, "bad number of segments in request (%d)\n",
+ xen_pv_printf(xendev, 0, "bad number of segments in request (%d)\n",
nr_segs);
return -EINVAL;
}
@@ -162,7 +162,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req)
for (i = 0; i < nr_segs; i++) {
if ((unsigned)usbback_req->req.seg[i].offset +
(unsigned)usbback_req->req.seg[i].length > PAGE_SIZE) {
- xen_be_printf(xendev, 0, "segment crosses page boundary\n");
+ xen_pv_printf(xendev, 0, "segment crosses page boundary\n");
return -EINVAL;
}
}
@@ -200,7 +200,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req)
*/
if (!usbback_req->nr_extra_segs) {
- xen_be_printf(xendev, 0, "iso request without descriptor segments\n");
+ xen_pv_printf(xendev, 0, "iso request without descriptor segments\n");
return -EINVAL;
}
@@ -552,14 +552,14 @@ static void usbback_dispatch(struct usbback_req *usbback_req)
ret = usbback_init_packet(usbback_req);
if (ret) {
- xen_be_printf(&usbif->xendev, 0, "invalid request\n");
+ xen_pv_printf(&usbif->xendev, 0, "invalid request\n");
ret = -ESHUTDOWN;
goto fail_free_urb;
}
ret = usbback_gnttab_map(usbback_req);
if (ret) {
- xen_be_printf(&usbif->xendev, 0, "invalid buffer, ret=%d\n", ret);
+ xen_pv_printf(&usbif->xendev, 0, "invalid buffer, ret=%d\n", ret);
ret = -ESHUTDOWN;
goto fail_free_urb;
}
@@ -647,7 +647,7 @@ static void usbback_bh(void *opaque)
if (RING_REQUEST_PROD_OVERFLOW(urb_ring, rp)) {
rc = urb_ring->rsp_prod_pvt;
- xen_be_printf(&usbif->xendev, 0, "domU provided bogus ring requests "
+ xen_pv_printf(&usbif->xendev, 0, "domU provided bogus ring requests "
"(%#x - %#x = %u). Halting ring processing.\n",
rp, rc, rp - rc);
usbif->ring_error = true;
@@ -745,7 +745,7 @@ static void usbback_portid_add(struct usbback_info *usbif, unsigned port,
portname = strchr(busid, '-');
if (!portname) {
- xen_be_printf(&usbif->xendev, 0, "device %s illegal specification\n",
+ xen_pv_printf(&usbif->xendev, 0, "device %s illegal specification\n",
busid);
return;
}
@@ -784,7 +784,7 @@ static void usbback_portid_add(struct usbback_info *usbif, unsigned port,
break;
}
if (speed == USBIF_SPEED_NONE) {
- xen_be_printf(&usbif->xendev, 0, "device %s wrong speed\n", busid);
+ xen_pv_printf(&usbif->xendev, 0, "device %s wrong speed\n", busid);
object_unparent(OBJECT(usbif->ports[port - 1].dev));
usbif->ports[port - 1].dev = NULL;
return;
@@ -801,7 +801,7 @@ static void usbback_portid_add(struct usbback_info *usbif, unsigned port,
err:
QDECREF(qdict);
snprintf(p->path, sizeof(p->path), "%d", 99);
- xen_be_printf(&usbif->xendev, 0, "device %s could not be opened\n", busid);
+ xen_pv_printf(&usbif->xendev, 0, "device %s could not be opened\n", busid);
}
static void usbback_process_port(struct usbback_info *usbif, unsigned port)
@@ -812,7 +812,7 @@ static void usbback_process_port(struct usbback_info *usbif, unsigned port)
snprintf(node, sizeof(node), "port/%d", port);
busid = xenstore_read_be_str(&usbif->xendev, node);
if (busid == NULL) {
- xen_be_printf(&usbif->xendev, 0, "xenstore_read %s failed\n", node);
+ xen_pv_printf(&usbif->xendev, 0, "xenstore_read %s failed\n", node);
return;
}
@@ -869,15 +869,15 @@ static int usbback_connect(struct XenDevice *xendev)
usbif = container_of(xendev, struct usbback_info, xendev);
if (xenstore_read_fe_int(xendev, "urb-ring-ref", &urb_ring_ref)) {
- xen_be_printf(xendev, 0, "error reading urb-ring-ref\n");
+ xen_pv_printf(xendev, 0, "error reading urb-ring-ref\n");
return -1;
}
if (xenstore_read_fe_int(xendev, "conn-ring-ref", &conn_ring_ref)) {
- xen_be_printf(xendev, 0, "error reading conn-ring-ref\n");
+ xen_pv_printf(xendev, 0, "error reading conn-ring-ref\n");
return -1;
}
if (xenstore_read_fe_int(xendev, "event-channel", &xendev->remote_port)) {
- xen_be_printf(xendev, 0, "error reading event-channel\n");
+ xen_pv_printf(xendev, 0, "error reading event-channel\n");
return -1;
}
@@ -888,7 +888,7 @@ static int usbback_connect(struct XenDevice *xendev)
conn_ring_ref,
PROT_READ | PROT_WRITE);
if (!usbif->urb_sring || !usbif->conn_sring) {
- xen_be_printf(xendev, 0, "error mapping rings\n");
+ xen_pv_printf(xendev, 0, "error mapping rings\n");
usbback_disconnect(xendev);
return -1;
}
@@ -900,7 +900,7 @@ static int usbback_connect(struct XenDevice *xendev)
xen_be_bind_evtchn(xendev);
- xen_be_printf(xendev, 1, "urb-ring-ref %d, conn-ring-ref %d, "
+ xen_pv_printf(xendev, 1, "urb-ring-ref %d, conn-ring-ref %d, "
"remote port %d, local port %d\n", urb_ring_ref,
conn_ring_ref, xendev->remote_port, xendev->local_port);
@@ -936,12 +936,12 @@ static int usbback_init(struct XenDevice *xendev)
if (xenstore_read_be_int(xendev, "num-ports", &usbif->num_ports) ||
usbif->num_ports < 1 || usbif->num_ports > USBBACK_MAXPORTS) {
- xen_be_printf(xendev, 0, "num-ports not readable or out of bounds\n");
+ xen_pv_printf(xendev, 0, "num-ports not readable or out of bounds\n");
return -1;
}
if (xenstore_read_be_int(xendev, "usb-ver", &usbif->usb_ver) ||
(usbif->usb_ver != USB_VER_USB11 && usbif->usb_ver != USB_VER_USB20)) {
- xen_be_printf(xendev, 0, "usb-ver not readable or out of bounds\n");
+ xen_pv_printf(xendev, 0, "usb-ver not readable or out of bounds\n");
return -1;
}
@@ -1029,7 +1029,7 @@ static void usbback_alloc(struct XenDevice *xendev)
/* max_grants: for each request and for the rings (request and connect). */
max_grants = USBIF_MAX_SEGMENTS_PER_REQUEST * USB_URB_RING_SIZE + 2;
if (xengnttab_set_max_grants(xendev->gnttabdev, max_grants) < 0) {
- xen_be_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
+ xen_pv_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
strerror(errno));
}
}
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 3518aac..97869cf 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -85,7 +85,7 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state)
if (rc < 0) {
return rc;
}
- xen_be_printf(xendev, 1, "backend state: %s -> %s\n",
+ xen_pv_printf(xendev, 1, "backend state: %s -> %s\n",
xenbus_strstate(xendev->be_state), xenbus_strstate(state));
xendev->be_state = state;
return 0;
@@ -121,7 +121,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
xendev->evtchndev = xenevtchn_open(NULL, 0);
if (xendev->evtchndev == NULL) {
- xen_be_printf(NULL, 0, "can't open evtchn device\n");
+ xen_pv_printf(NULL, 0, "can't open evtchn device\n");
g_free(xendev);
return NULL;
}
@@ -130,7 +130,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) {
xendev->gnttabdev = xengnttab_open(NULL, 0);
if (xendev->gnttabdev == NULL) {
- xen_be_printf(NULL, 0, "can't open gnttab device\n");
+ xen_pv_printf(NULL, 0, "can't open gnttab device\n");
xenevtchn_close(xendev->evtchndev);
g_free(xendev);
return NULL;
@@ -163,7 +163,7 @@ static void xen_be_backend_changed(struct XenDevice *xendev, const char *node)
}
if (node) {
- xen_be_printf(xendev, 2, "backend update: %s\n", node);
+ xen_pv_printf(xendev, 2, "backend update: %s\n", node);
if (xendev->ops->backend_changed) {
xendev->ops->backend_changed(xendev, node);
}
@@ -187,26 +187,26 @@ static int xen_be_try_setup(struct XenDevice *xendev)
int be_state;
if (xenstore_read_be_int(xendev, "state", &be_state) == -1) {
- xen_be_printf(xendev, 0, "reading backend state failed\n");
+ xen_pv_printf(xendev, 0, "reading backend state failed\n");
return -1;
}
if (be_state != XenbusStateInitialising) {
- xen_be_printf(xendev, 0, "initial backend state is wrong (%s)\n",
+ xen_pv_printf(xendev, 0, "initial backend state is wrong (%s)\n",
xenbus_strstate(be_state));
return -1;
}
xendev->fe = xenstore_read_be_str(xendev, "frontend");
if (xendev->fe == NULL) {
- xen_be_printf(xendev, 0, "reading frontend path failed\n");
+ xen_pv_printf(xendev, 0, "reading frontend path failed\n");
return -1;
}
/* setup frontend watch */
snprintf(token, sizeof(token), "fe:%p", xendev);
if (!xs_watch(xenstore, xendev->fe, token)) {
- xen_be_printf(xendev, 0, "watching frontend path (%s) failed\n",
+ xen_pv_printf(xendev, 0, "watching frontend path (%s) failed\n",
xendev->fe);
return -1;
}
@@ -230,7 +230,7 @@ static int xen_be_try_init(struct XenDevice *xendev)
int rc = 0;
if (!xendev->online) {
- xen_be_printf(xendev, 1, "not online\n");
+ xen_pv_printf(xendev, 1, "not online\n");
return -1;
}
@@ -238,7 +238,7 @@ static int xen_be_try_init(struct XenDevice *xendev)
rc = xendev->ops->init(xendev);
}
if (rc != 0) {
- xen_be_printf(xendev, 1, "init() failed\n");
+ xen_pv_printf(xendev, 1, "init() failed\n");
return rc;
}
@@ -261,9 +261,9 @@ static int xen_be_try_initialise(struct XenDevice *xendev)
if (xendev->fe_state != XenbusStateInitialised &&
xendev->fe_state != XenbusStateConnected) {
if (xendev->ops->flags & DEVOPS_FLAG_IGNORE_STATE) {
- xen_be_printf(xendev, 2, "frontend not ready, ignoring\n");
+ xen_pv_printf(xendev, 2, "frontend not ready, ignoring\n");
} else {
- xen_be_printf(xendev, 2, "frontend not ready (yet)\n");
+ xen_pv_printf(xendev, 2, "frontend not ready (yet)\n");
return -1;
}
}
@@ -272,7 +272,7 @@ static int xen_be_try_initialise(struct XenDevice *xendev)
rc = xendev->ops->initialise(xendev);
}
if (rc != 0) {
- xen_be_printf(xendev, 0, "initialise() failed\n");
+ xen_pv_printf(xendev, 0, "initialise() failed\n");
return rc;
}
@@ -293,9 +293,9 @@ static void xen_be_try_connected(struct XenDevice *xendev)
if (xendev->fe_state != XenbusStateConnected) {
if (xendev->ops->flags & DEVOPS_FLAG_IGNORE_STATE) {
- xen_be_printf(xendev, 2, "frontend not ready, ignoring\n");
+ xen_pv_printf(xendev, 2, "frontend not ready, ignoring\n");
} else {
- xen_be_printf(xendev, 2, "frontend not ready (yet)\n");
+ xen_pv_printf(xendev, 2, "frontend not ready (yet)\n");
return;
}
}
@@ -329,7 +329,7 @@ static int xen_be_try_reset(struct XenDevice *xendev)
return -1;
}
- xen_be_printf(xendev, 1, "device reset (for re-connect)\n");
+ xen_pv_printf(xendev, 1, "device reset (for re-connect)\n");
xen_be_set_state(xendev, XenbusStateInitialising);
return 0;
}
@@ -390,7 +390,7 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops)
snprintf(token, sizeof(token), "be:%p:%d:%p", type, dom, ops);
snprintf(path, sizeof(path), "backend/%s/%d", type, dom);
if (!xs_watch(xenstore, path, token)) {
- xen_be_printf(NULL, 0, "xen be: watching backend path (%s) failed\n",
+ xen_pv_printf(NULL, 0, "xen be: watching backend path (%s) failed\n",
path);
return -1;
}
@@ -451,7 +451,7 @@ int xen_be_init(void)
{
xenstore = xs_daemon_open();
if (!xenstore) {
- xen_be_printf(NULL, 0, "can't connect to xenstored\n");
+ xen_pv_printf(NULL, 0, "can't connect to xenstored\n");
return -1;
}
@@ -512,10 +512,10 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
xendev->local_port = xenevtchn_bind_interdomain
(xendev->evtchndev, xendev->dom, xendev->remote_port);
if (xendev->local_port == -1) {
- xen_be_printf(xendev, 0, "xenevtchn_bind_interdomain failed\n");
+ xen_pv_printf(xendev, 0, "xenevtchn_bind_interdomain failed\n");
return -1;
}
- xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
+ xen_pv_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev),
xen_be_evtchn_event, NULL, xendev);
return 0;
diff --git a/hw/xen/xen_devconfig.c b/hw/xen/xen_devconfig.c
index b7d290d..a80e78c 100644
--- a/hw/xen/xen_devconfig.c
+++ b/hw/xen/xen_devconfig.c
@@ -55,7 +55,7 @@ int xen_config_dev_blk(DriveInfo *disk)
const char *filename = qemu_opt_get(disk->opts, "file");
snprintf(device_name, sizeof(device_name), "xvd%c", 'a' + disk->unit);
- xen_be_printf(NULL, 1, "config disk %d [%s]: %s\n",
+ xen_pv_printf(NULL, 1, "config disk %d [%s]: %s\n",
disk->unit, device_name, filename);
xen_config_dev_dirs("vbd", "qdisk", vdev, fe, be, sizeof(fe));
@@ -83,7 +83,7 @@ int xen_config_dev_nic(NICInfo *nic)
snprintf(mac, sizeof(mac), "%02x:%02x:%02x:%02x:%02x:%02x",
nic->macaddr.a[0], nic->macaddr.a[1], nic->macaddr.a[2],
nic->macaddr.a[3], nic->macaddr.a[4], nic->macaddr.a[5]);
- xen_be_printf(NULL, 1, "config nic %d: mac=\"%s\"\n", vlan_id, mac);
+ xen_pv_printf(NULL, 1, "config nic %d: mac=\"%s\"\n", vlan_id, mac);
xen_config_dev_dirs("vif", "qnic", vlan_id, fe, be, sizeof(fe));
/* frontend */
diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
index d42e57b..1407f5f 100644
--- a/hw/xen/xen_frontend.c
+++ b/hw/xen/xen_frontend.c
@@ -48,7 +48,7 @@ void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
fe_state = XenbusStateUnknown;
}
if (xendev->fe_state != fe_state) {
- xen_be_printf(xendev, 1, "frontend state: %s -> %s\n",
+ xen_pv_printf(xendev, 1, "frontend state: %s -> %s\n",
xenbus_strstate(xendev->fe_state),
xenbus_strstate(fe_state));
}
@@ -58,13 +58,13 @@ void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
g_free(xendev->protocol);
xendev->protocol = xenstore_read_fe_str(xendev, "protocol");
if (xendev->protocol) {
- xen_be_printf(xendev, 1, "frontend protocol: %s\n",
+ xen_pv_printf(xendev, 1, "frontend protocol: %s\n",
xendev->protocol);
}
}
if (node) {
- xen_be_printf(xendev, 2, "frontend update: %s\n", node);
+ xen_pv_printf(xendev, 2, "frontend update: %s\n", node);
if (xendev->ops->frontend_changed) {
xendev->ops->frontend_changed(xendev, node);
}
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 6c92624..15bf95c 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -69,13 +69,13 @@ int xenstore_mkdir(char *path, int p)
};
if (!xs_mkdir(xenstore, 0, path)) {
- xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
+ xen_pv_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
return -1;
}
xenstore_cleanup_dir(g_strdup(path));
if (!xs_set_permissions(xenstore, 0, path, perms, 2)) {
- xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", path);
+ xen_pv_printf(NULL, 0, "xs_set_permissions %s: failed\n", path);
return -1;
}
return 0;
@@ -195,7 +195,7 @@ const char *xenbus_strstate(enum xenbus_state state)
* 2 == noisy debug messages (logfile only).
* 3 == will flood your log (logfile only).
*/
-void xen_be_printf(struct XenDevice *xendev, int msg_level,
+void xen_pv_printf(struct XenDevice *xendev, int msg_level,
const char *fmt, ...)
{
va_list args;
@@ -235,7 +235,7 @@ void xen_be_evtchn_event(void *opaque)
port = xenevtchn_pending(xendev->evtchndev);
if (port != xendev->local_port) {
- xen_be_printf(xendev, 0,
+ xen_pv_printf(xendev, 0,
"xenevtchn_pending returned %d (expected %d)\n",
port, xendev->local_port);
return;
@@ -254,7 +254,7 @@ void xen_be_unbind_evtchn(struct XenDevice *xendev)
}
qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
- xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
+ xen_pv_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
xendev->local_port = -1;
}
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 337457e..cf26ce5 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -72,7 +72,7 @@ struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
-void xen_be_printf(struct XenDevice *xendev, int msg_level,
+void xen_pv_printf(struct XenDevice *xendev, int msg_level,
const char *fmt, ...) GCC_FMT_ATTR(3, 4);
#endif /* QEMU_HW_XEN_PVDEV_H */
diff --git a/xen-common.c b/xen-common.c
index e641ad1..9099760 100644
--- a/xen-common.c
+++ b/xen-common.c
@@ -116,12 +116,12 @@ static int xen_init(MachineState *ms)
{
xen_xc = xc_interface_open(0, 0, 0);
if (xen_xc == NULL) {
- xen_be_printf(NULL, 0, "can't open xen interface\n");
+ xen_pv_printf(NULL, 0, "can't open xen interface\n");
return -1;
}
xen_fmem = xenforeignmemory_open(0, 0);
if (xen_fmem == NULL) {
- xen_be_printf(NULL, 0, "can't open xen fmem interface\n");
+ xen_pv_printf(NULL, 0, "can't open xen fmem interface\n");
xc_interface_close(xen_xc);
return -1;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 09/15] xen: Rename xen_be_printf to xen_pv_printf
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
Prepare xen_be_printf to be used by both backend and frontends:
* xen_be_printf -> xen_pv_printf
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 58 +++++++++++++++++++++++-----------------------
hw/char/xen_console.c | 10 ++++----
hw/display/xenfb.c | 42 ++++++++++++++++-----------------
hw/net/xen_nic.c | 22 +++++++++---------
hw/usb/xen-usb.c | 38 +++++++++++++++---------------
hw/xen/xen_backend.c | 40 ++++++++++++++++----------------
hw/xen/xen_devconfig.c | 4 ++--
hw/xen/xen_frontend.c | 6 ++---
hw/xen/xen_pvdev.c | 10 ++++----
include/hw/xen/xen_pvdev.h | 2 +-
xen-common.c | 4 ++--
11 files changed, 118 insertions(+), 118 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 0b2db3b..425efba 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -168,12 +168,12 @@ static void destroy_grant(gpointer pgnt)
xengnttab_handle *gnt = grant->blkdev->xendev.gnttabdev;
if (xengnttab_unmap(gnt, grant->page, 1) != 0) {
- xen_be_printf(&grant->blkdev->xendev, 0,
+ xen_pv_printf(&grant->blkdev->xendev, 0,
"xengnttab_unmap failed: %s\n",
strerror(errno));
}
grant->blkdev->persistent_gnt_count--;
- xen_be_printf(&grant->blkdev->xendev, 3,
+ xen_pv_printf(&grant->blkdev->xendev, 3,
"unmapped grant %p\n", grant->page);
g_free(grant);
}
@@ -185,11 +185,11 @@ static void remove_persistent_region(gpointer data, gpointer dev)
xengnttab_handle *gnt = blkdev->xendev.gnttabdev;
if (xengnttab_unmap(gnt, region->addr, region->num) != 0) {
- xen_be_printf(&blkdev->xendev, 0,
+ xen_pv_printf(&blkdev->xendev, 0,
"xengnttab_unmap region %p failed: %s\n",
region->addr, strerror(errno));
}
- xen_be_printf(&blkdev->xendev, 3,
+ xen_pv_printf(&blkdev->xendev, 3,
"unmapped grant region %p with %d pages\n",
region->addr, region->num);
g_free(region);
@@ -256,7 +256,7 @@ static int ioreq_parse(struct ioreq *ioreq)
size_t len;
int i;
- xen_be_printf(&blkdev->xendev, 3,
+ xen_pv_printf(&blkdev->xendev, 3,
"op %d, nr %d, handle %d, id %" PRId64 ", sector %" PRId64 "\n",
ioreq->req.operation, ioreq->req.nr_segments,
ioreq->req.handle, ioreq->req.id, ioreq->req.sector_number);
@@ -276,28 +276,28 @@ static int ioreq_parse(struct ioreq *ioreq)
case BLKIF_OP_DISCARD:
return 0;
default:
- xen_be_printf(&blkdev->xendev, 0, "error: unknown operation (%d)\n",
+ xen_pv_printf(&blkdev->xendev, 0, "error: unknown operation (%d)\n",
ioreq->req.operation);
goto err;
};
if (ioreq->req.operation != BLKIF_OP_READ && blkdev->mode[0] != 'w') {
- xen_be_printf(&blkdev->xendev, 0, "error: write req for ro device\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: write req for ro device\n");
goto err;
}
ioreq->start = ioreq->req.sector_number * blkdev->file_blk;
for (i = 0; i < ioreq->req.nr_segments; i++) {
if (i == BLKIF_MAX_SEGMENTS_PER_REQUEST) {
- xen_be_printf(&blkdev->xendev, 0, "error: nr_segments too big\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: nr_segments too big\n");
goto err;
}
if (ioreq->req.seg[i].first_sect > ioreq->req.seg[i].last_sect) {
- xen_be_printf(&blkdev->xendev, 0, "error: first > last sector\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: first > last sector\n");
goto err;
}
if (ioreq->req.seg[i].last_sect * BLOCK_SIZE >= XC_PAGE_SIZE) {
- xen_be_printf(&blkdev->xendev, 0, "error: page crossing\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: page crossing\n");
goto err;
}
@@ -309,7 +309,7 @@ static int ioreq_parse(struct ioreq *ioreq)
qemu_iovec_add(&ioreq->v, (void*)mem, len);
}
if (ioreq->start + ioreq->v.size > blkdev->file_size) {
- xen_be_printf(&blkdev->xendev, 0, "error: access beyond end of file\n");
+ xen_pv_printf(&blkdev->xendev, 0, "error: access beyond end of file\n");
goto err;
}
return 0;
@@ -332,7 +332,7 @@ static void ioreq_unmap(struct ioreq *ioreq)
return;
}
if (xengnttab_unmap(gnt, ioreq->pages, ioreq->num_unmap) != 0) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"xengnttab_unmap failed: %s\n",
strerror(errno));
}
@@ -344,7 +344,7 @@ static void ioreq_unmap(struct ioreq *ioreq)
continue;
}
if (xengnttab_unmap(gnt, ioreq->page[i], 1) != 0) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"xengnttab_unmap failed: %s\n",
strerror(errno));
}
@@ -382,7 +382,7 @@ static int ioreq_map(struct ioreq *ioreq)
if (grant != NULL) {
page[i] = grant->page;
- xen_be_printf(&ioreq->blkdev->xendev, 3,
+ xen_pv_printf(&ioreq->blkdev->xendev, 3,
"using persistent-grant %" PRIu32 "\n",
ioreq->refs[i]);
} else {
@@ -411,7 +411,7 @@ static int ioreq_map(struct ioreq *ioreq)
ioreq->pages = xengnttab_map_grant_refs
(gnt, new_maps, domids, refs, ioreq->prot);
if (ioreq->pages == NULL) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"can't map %d grant refs (%s, %d maps)\n",
new_maps, strerror(errno), ioreq->blkdev->cnt_map);
return -1;
@@ -427,7 +427,7 @@ static int ioreq_map(struct ioreq *ioreq)
ioreq->page[i] = xengnttab_map_grant_ref
(gnt, domids[i], refs[i], ioreq->prot);
if (ioreq->page[i] == NULL) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"can't map grant ref %d (%s, %d maps)\n",
refs[i], strerror(errno), ioreq->blkdev->cnt_map);
ioreq->mapped = 1;
@@ -475,7 +475,7 @@ static int ioreq_map(struct ioreq *ioreq)
grant->page = ioreq->page[new_maps];
}
grant->blkdev = ioreq->blkdev;
- xen_be_printf(&ioreq->blkdev->xendev, 3,
+ xen_pv_printf(&ioreq->blkdev->xendev, 3,
"adding grant %" PRIu32 " page: %p\n",
refs[new_maps], grant->page);
g_tree_insert(ioreq->blkdev->persistent_gnts,
@@ -558,7 +558,7 @@ static int ioreq_grant_copy(struct ioreq *ioreq)
rc = xengnttab_grant_copy(gnt, count, segs);
if (rc) {
- xen_be_printf(&ioreq->blkdev->xendev, 0,
+ xen_pv_printf(&ioreq->blkdev->xendev, 0,
"failed to copy data %d\n", rc);
ioreq->aio_errors++;
return -1;
@@ -566,7 +566,7 @@ static int ioreq_grant_copy(struct ioreq *ioreq)
for (i = 0; i < count; i++) {
if (segs[i].status != GNTST_okay) {
- xen_be_printf(&ioreq->blkdev->xendev, 3,
+ xen_pv_printf(&ioreq->blkdev->xendev, 3,
"failed to copy data %d for gref %d, domid %d\n",
segs[i].status, ioreq->refs[i], ioreq->domids[i]);
ioreq->aio_errors++;
@@ -600,7 +600,7 @@ static void qemu_aio_complete(void *opaque, int ret)
struct ioreq *ioreq = opaque;
if (ret != 0) {
- xen_be_printf(&ioreq->blkdev->xendev, 0, "%s I/O error\n",
+ xen_pv_printf(&ioreq->blkdev->xendev, 0, "%s I/O error\n",
ioreq->req.operation == BLKIF_OP_READ ? "read" : "write");
ioreq->aio_errors++;
}
@@ -911,7 +911,7 @@ static void blk_alloc(struct XenDevice *xendev)
}
if (xengnttab_set_max_grants(xendev->gnttabdev,
MAX_GRANTS(max_requests, BLKIF_MAX_SEGMENTS_PER_REQUEST)) < 0) {
- xen_be_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
+ xen_pv_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
strerror(errno));
}
}
@@ -1057,11 +1057,11 @@ static int blk_connect(struct XenDevice *xendev)
}
/* setup via xenbus -> create new block driver instance */
- xen_be_printf(&blkdev->xendev, 2, "create new bdrv (xenbus setup)\n");
+ xen_pv_printf(&blkdev->xendev, 2, "create new bdrv (xenbus setup)\n");
blkdev->blk = blk_new_open(blkdev->filename, NULL, options,
qflags, &local_err);
if (!blkdev->blk) {
- xen_be_printf(&blkdev->xendev, 0, "error: %s\n",
+ xen_pv_printf(&blkdev->xendev, 0, "error: %s\n",
error_get_pretty(local_err));
error_free(local_err);
return -1;
@@ -1069,11 +1069,11 @@ static int blk_connect(struct XenDevice *xendev)
blk_set_enable_write_cache(blkdev->blk, !writethrough);
} else {
/* setup via qemu cmdline -> already setup for us */
- xen_be_printf(&blkdev->xendev, 2,
+ xen_pv_printf(&blkdev->xendev, 2,
"get configured bdrv (cmdline setup)\n");
blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo);
if (blk_is_read_only(blkdev->blk) && !readonly) {
- xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
+ xen_pv_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
blkdev->blk = NULL;
return -1;
}
@@ -1086,13 +1086,13 @@ static int blk_connect(struct XenDevice *xendev)
if (blkdev->file_size < 0) {
BlockDriverState *bs = blk_bs(blkdev->blk);
const char *drv_name = bs ? bdrv_get_format_name(bs) : NULL;
- xen_be_printf(&blkdev->xendev, 1, "blk_getlength: %d (%s) | drv %s\n",
+ xen_pv_printf(&blkdev->xendev, 1, "blk_getlength: %d (%s) | drv %s\n",
(int)blkdev->file_size, strerror(-blkdev->file_size),
drv_name ?: "-");
blkdev->file_size = 0;
}
- xen_be_printf(xendev, 1, "type \"%s\", fileproto \"%s\", filename \"%s\","
+ xen_pv_printf(xendev, 1, "type \"%s\", fileproto \"%s\", filename \"%s\","
" size %" PRId64 " (%" PRId64 " MB)\n",
blkdev->type, blkdev->fileproto, blkdev->filename,
blkdev->file_size, blkdev->file_size >> 20);
@@ -1176,10 +1176,10 @@ static int blk_connect(struct XenDevice *xendev)
blkdev->feature_grant_copy =
(xengnttab_grant_copy(blkdev->xendev.gnttabdev, 0, NULL) == 0);
- xen_be_printf(&blkdev->xendev, 3, "grant copy operation %s\n",
+ xen_pv_printf(&blkdev->xendev, 3, "grant copy operation %s\n",
blkdev->feature_grant_copy ? "enabled" : "disabled");
- xen_be_printf(&blkdev->xendev, 1, "ok: proto %s, ring-ref %d, "
+ xen_pv_printf(&blkdev->xendev, 1, "ok: proto %s, ring-ref %d, "
"remote port %d, local port %d\n",
blkdev->xendev.protocol, blkdev->ring_ref,
blkdev->xendev.remote_port, blkdev->xendev.local_port);
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 399bb5d..b705a06 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -156,14 +156,14 @@ static void xencons_send(struct XenConsole *con)
if (len < 1) {
if (!con->backlog) {
con->backlog = 1;
- xen_be_printf(&con->xendev, 1,
+ xen_pv_printf(&con->xendev, 1,
"backlog piling up, nobody listening?\n");
}
} else {
buffer_advance(&con->buffer, len);
if (con->backlog && len == size) {
con->backlog = 0;
- xen_be_printf(&con->xendev, 1, "backlog is gone\n");
+ xen_pv_printf(&con->xendev, 1, "backlog is gone\n");
}
}
}
@@ -188,7 +188,7 @@ static int con_init(struct XenDevice *xendev)
type = xenstore_read_str(con->console, "type");
if (!type || strcmp(type, "ioemu") != 0) {
- xen_be_printf(xendev, 1, "not for me (type=%s)\n", type);
+ xen_pv_printf(xendev, 1, "not for me (type=%s)\n", type);
ret = -1;
goto out;
}
@@ -241,14 +241,14 @@ static int con_initialise(struct XenDevice *xendev)
qemu_chr_add_handlers(con->chr, xencons_can_receive,
xencons_receive, NULL, con);
} else {
- xen_be_printf(xendev, 0,
+ xen_pv_printf(xendev, 0,
"xen_console_init error chardev %s already used\n",
con->chr->label);
con->chr = NULL;
}
}
- xen_be_printf(xendev, 1,
+ xen_pv_printf(xendev, 1,
"ring mfn %d, remote port %d, local port %d, limit %zd\n",
con->ring_ref,
con->xendev.remote_port,
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 9b10b35..55aca85 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -104,7 +104,7 @@ static int common_bind(struct common *c)
return -1;
xen_be_bind_evtchn(&c->xendev);
- xen_be_printf(&c->xendev, 1,
+ xen_pv_printf(&c->xendev, 1,
"ring mfn %"PRI_xen_pfn", remote-port %d, local-port %d\n",
mfn, c->xendev.remote_port, c->xendev.local_port);
@@ -347,7 +347,7 @@ static int input_initialise(struct XenDevice *xendev)
int rc;
if (!in->c.con) {
- xen_be_printf(xendev, 1, "ds not set (yet)\n");
+ xen_pv_printf(xendev, 1, "ds not set (yet)\n");
return -1;
}
@@ -512,44 +512,44 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
int max_width, max_height;
if (fb_len_lim > fb_len_max) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"fb size limit %zu exceeds %zu, corrected\n",
fb_len_lim, fb_len_max);
fb_len_lim = fb_len_max;
}
if (fb_len_lim && fb_len > fb_len_lim) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"frontend fb size %zu limited to %zu\n",
fb_len, fb_len_lim);
fb_len = fb_len_lim;
}
if (depth != 8 && depth != 16 && depth != 24 && depth != 32) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"can't handle frontend fb depth %d\n",
depth);
return -1;
}
if (row_stride <= 0 || row_stride > fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n",
+ xen_pv_printf(&xenfb->c.xendev, 0, "invalid frontend stride %d\n",
row_stride);
return -1;
}
max_width = row_stride / (depth / 8);
if (width < 0 || width > max_width) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"invalid frontend width %d limited to %d\n",
width, max_width);
width = max_width;
}
if (offset < 0 || offset >= fb_len) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"invalid frontend offset %d (max %zu)\n",
offset, fb_len - 1);
return -1;
}
max_height = (fb_len - offset) / row_stride;
if (height < 0 || height > max_height) {
- xen_be_printf(&xenfb->c.xendev, 0,
+ xen_pv_printf(&xenfb->c.xendev, 0,
"invalid frontend height %d limited to %d\n",
height, max_height);
height = max_height;
@@ -562,7 +562,7 @@ static int xenfb_configure_fb(struct XenFB *xenfb, size_t fb_len_lim,
xenfb->offset = offset;
xenfb->up_fullscreen = 1;
xenfb->do_resize = 1;
- xen_be_printf(&xenfb->c.xendev, 1,
+ xen_pv_printf(&xenfb->c.xendev, 1,
"framebuffer %dx%dx%d offset %d stride %d\n",
width, height, depth, offset, row_stride);
return 0;
@@ -641,7 +641,7 @@ static void xenfb_guest_copy(struct XenFB *xenfb, int x, int y, int w, int h)
}
}
if (oops) /* should not happen */
- xen_be_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp?\n",
+ xen_pv_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp?\n",
__FUNCTION__, xenfb->depth, bpp);
dpy_gfx_update(xenfb->c.con, x, y, w, h);
@@ -731,7 +731,7 @@ static void xenfb_update(void *opaque)
break;
}
dpy_gfx_replace_surface(xenfb->c.con, surface);
- xen_be_printf(&xenfb->c.xendev, 1,
+ xen_pv_printf(&xenfb->c.xendev, 1,
"update: resizing: %dx%d @ %d bpp%s\n",
xenfb->width, xenfb->height, xenfb->depth,
is_buffer_shared(surface) ? " (shared)" : "");
@@ -740,10 +740,10 @@ static void xenfb_update(void *opaque)
/* run queued updates */
if (xenfb->up_fullscreen) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
+ xen_pv_printf(&xenfb->c.xendev, 3, "update: fullscreen\n");
xenfb_guest_copy(xenfb, 0, 0, xenfb->width, xenfb->height);
} else if (xenfb->up_count) {
- xen_be_printf(&xenfb->c.xendev, 3, "update: %d rects\n",
+ xen_pv_printf(&xenfb->c.xendev, 3, "update: %d rects\n",
xenfb->up_count);
for (i = 0; i < xenfb->up_count; i++)
xenfb_guest_copy(xenfb,
@@ -752,7 +752,7 @@ static void xenfb_update(void *opaque)
xenfb->up_rects[i].w,
xenfb->up_rects[i].h);
} else {
- xen_be_printf(&xenfb->c.xendev, 3, "update: nothing\n");
+ xen_pv_printf(&xenfb->c.xendev, 3, "update: nothing\n");
}
xenfb->up_count = 0;
xenfb->up_fullscreen = 0;
@@ -806,14 +806,14 @@ static void xenfb_handle_events(struct XenFB *xenfb)
w = MIN(event->update.width, xenfb->width - x);
h = MIN(event->update.height, xenfb->height - y);
if (w < 0 || h < 0) {
- xen_be_printf(&xenfb->c.xendev, 1, "bogus update ignored\n");
+ xen_pv_printf(&xenfb->c.xendev, 1, "bogus update ignored\n");
break;
}
if (x != event->update.x ||
y != event->update.y ||
w != event->update.width ||
h != event->update.height) {
- xen_be_printf(&xenfb->c.xendev, 1, "bogus update clipped\n");
+ xen_pv_printf(&xenfb->c.xendev, 1, "bogus update clipped\n");
}
if (w == xenfb->width && h > xenfb->height / 2) {
/* scroll detector: updated more than 50% of the lines,
@@ -895,7 +895,7 @@ static int fb_initialise(struct XenDevice *xendev)
if (fb->feature_update)
xenstore_write_be_int(xendev, "request-update", 1);
- xen_be_printf(xendev, 1, "feature-update=%d, videoram=%d\n",
+ xen_pv_printf(xendev, 1, "feature-update=%d, videoram=%d\n",
fb->feature_update, videoram);
return 0;
}
@@ -914,7 +914,7 @@ static void fb_disconnect(struct XenDevice *xendev)
PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON,
-1, 0);
if (fb->pixels == MAP_FAILED) {
- xen_be_printf(xendev, 0,
+ xen_pv_printf(xendev, 0,
"Couldn't replace the framebuffer with anonymous memory errno=%d\n",
errno);
}
@@ -935,7 +935,7 @@ static void fb_frontend_changed(struct XenDevice *xendev, const char *node)
if (fb->bug_trigger == 0 && strcmp(node, "state") == 0 &&
xendev->fe_state == XenbusStateConnected &&
xendev->be_state == XenbusStateConnected) {
- xen_be_printf(xendev, 2, "re-trigger connected (frontend bug)\n");
+ xen_pv_printf(xendev, 2, "re-trigger connected (frontend bug)\n");
xen_be_set_state(xendev, XenbusStateConnected);
fb->bug_trigger = 1; /* only once */
}
@@ -996,7 +996,7 @@ wait_more:
usleep(10000);
goto wait_more;
}
- xen_be_printf(NULL, 1, "displaystate setup failed\n");
+ xen_pv_printf(NULL, 1, "displaystate setup failed\n");
return;
}
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 8db3448..7418a7b 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -129,31 +129,31 @@ static void net_tx_packets(struct XenNetDev *netdev)
/* should not happen in theory, we don't announce the *
* feature-{sg,gso,whatelse} flags in xenstore (yet?) */
if (txreq.flags & NETTXF_extra_info) {
- xen_be_printf(&netdev->xendev, 0, "FIXME: extra info flag\n");
+ xen_pv_printf(&netdev->xendev, 0, "FIXME: extra info flag\n");
net_tx_error(netdev, &txreq, rc);
continue;
}
if (txreq.flags & NETTXF_more_data) {
- xen_be_printf(&netdev->xendev, 0, "FIXME: more data flag\n");
+ xen_pv_printf(&netdev->xendev, 0, "FIXME: more data flag\n");
net_tx_error(netdev, &txreq, rc);
continue;
}
#endif
if (txreq.size < 14) {
- xen_be_printf(&netdev->xendev, 0, "bad packet size: %d\n",
+ xen_pv_printf(&netdev->xendev, 0, "bad packet size: %d\n",
txreq.size);
net_tx_error(netdev, &txreq, rc);
continue;
}
if ((txreq.offset + txreq.size) > XC_PAGE_SIZE) {
- xen_be_printf(&netdev->xendev, 0, "error: page crossing\n");
+ xen_pv_printf(&netdev->xendev, 0, "error: page crossing\n");
net_tx_error(netdev, &txreq, rc);
continue;
}
- xen_be_printf(&netdev->xendev, 3,
+ xen_pv_printf(&netdev->xendev, 3,
"tx packet ref %d, off %d, len %d, flags 0x%x%s%s%s%s\n",
txreq.gref, txreq.offset, txreq.size, txreq.flags,
(txreq.flags & NETTXF_csum_blank) ? " csum_blank" : "",
@@ -165,7 +165,7 @@ static void net_tx_packets(struct XenNetDev *netdev)
netdev->xendev.dom,
txreq.gref, PROT_READ);
if (page == NULL) {
- xen_be_printf(&netdev->xendev, 0,
+ xen_pv_printf(&netdev->xendev, 0,
"error: tx gref dereference failed (%d)\n",
txreq.gref);
net_tx_error(netdev, &txreq, rc);
@@ -215,7 +215,7 @@ static void net_rx_response(struct XenNetDev *netdev,
resp->status = (int16_t)st;
}
- xen_be_printf(&netdev->xendev, 3,
+ xen_pv_printf(&netdev->xendev, 3,
"rx response: idx %d, status %d, flags 0x%x\n",
i, resp->status, resp->flags);
@@ -247,7 +247,7 @@ static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size
return 0;
}
if (size > XC_PAGE_SIZE - NET_IP_ALIGN) {
- xen_be_printf(&netdev->xendev, 0, "packet too big (%lu > %ld)",
+ xen_pv_printf(&netdev->xendev, 0, "packet too big (%lu > %ld)",
(unsigned long)size, XC_PAGE_SIZE - NET_IP_ALIGN);
return -1;
}
@@ -259,7 +259,7 @@ static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size
netdev->xendev.dom,
rxreq.gref, PROT_WRITE);
if (page == NULL) {
- xen_be_printf(&netdev->xendev, 0,
+ xen_pv_printf(&netdev->xendev, 0,
"error: rx gref dereference failed (%d)\n",
rxreq.gref);
net_rx_response(netdev, &rxreq, NETIF_RSP_ERROR, 0, 0, 0);
@@ -334,7 +334,7 @@ static int net_connect(struct XenDevice *xendev)
rx_copy = 0;
}
if (rx_copy == 0) {
- xen_be_printf(&netdev->xendev, 0,
+ xen_pv_printf(&netdev->xendev, 0,
"frontend doesn't support rx-copy.\n");
return -1;
}
@@ -360,7 +360,7 @@ static int net_connect(struct XenDevice *xendev)
xen_be_bind_evtchn(&netdev->xendev);
- xen_be_printf(&netdev->xendev, 1, "ok: tx-ring-ref %d, rx-ring-ref %d, "
+ xen_pv_printf(&netdev->xendev, 1, "ok: tx-ring-ref %d, rx-ring-ref %d, "
"remote port %d, local port %d\n",
netdev->tx_ring_ref, netdev->rx_ring_ref,
netdev->xendev.remote_port, netdev->xendev.local_port);
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index 10773f2..a245355 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -48,7 +48,7 @@
struct timeval tv; \
\
gettimeofday(&tv, NULL); \
- xen_be_printf(xendev, lvl, "%8ld.%06ld xen-usb(%s):" fmt, \
+ xen_pv_printf(xendev, lvl, "%8ld.%06ld xen-usb(%s):" fmt, \
tv.tv_sec, tv.tv_usec, __func__, ##args); \
}
#define TR_BUS(xendev, fmt, args...) TR(xendev, 2, fmt, ##args)
@@ -154,7 +154,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req)
}
if (nr_segs > USBIF_MAX_SEGMENTS_PER_REQUEST) {
- xen_be_printf(xendev, 0, "bad number of segments in request (%d)\n",
+ xen_pv_printf(xendev, 0, "bad number of segments in request (%d)\n",
nr_segs);
return -EINVAL;
}
@@ -162,7 +162,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req)
for (i = 0; i < nr_segs; i++) {
if ((unsigned)usbback_req->req.seg[i].offset +
(unsigned)usbback_req->req.seg[i].length > PAGE_SIZE) {
- xen_be_printf(xendev, 0, "segment crosses page boundary\n");
+ xen_pv_printf(xendev, 0, "segment crosses page boundary\n");
return -EINVAL;
}
}
@@ -200,7 +200,7 @@ static int usbback_gnttab_map(struct usbback_req *usbback_req)
*/
if (!usbback_req->nr_extra_segs) {
- xen_be_printf(xendev, 0, "iso request without descriptor segments\n");
+ xen_pv_printf(xendev, 0, "iso request without descriptor segments\n");
return -EINVAL;
}
@@ -552,14 +552,14 @@ static void usbback_dispatch(struct usbback_req *usbback_req)
ret = usbback_init_packet(usbback_req);
if (ret) {
- xen_be_printf(&usbif->xendev, 0, "invalid request\n");
+ xen_pv_printf(&usbif->xendev, 0, "invalid request\n");
ret = -ESHUTDOWN;
goto fail_free_urb;
}
ret = usbback_gnttab_map(usbback_req);
if (ret) {
- xen_be_printf(&usbif->xendev, 0, "invalid buffer, ret=%d\n", ret);
+ xen_pv_printf(&usbif->xendev, 0, "invalid buffer, ret=%d\n", ret);
ret = -ESHUTDOWN;
goto fail_free_urb;
}
@@ -647,7 +647,7 @@ static void usbback_bh(void *opaque)
if (RING_REQUEST_PROD_OVERFLOW(urb_ring, rp)) {
rc = urb_ring->rsp_prod_pvt;
- xen_be_printf(&usbif->xendev, 0, "domU provided bogus ring requests "
+ xen_pv_printf(&usbif->xendev, 0, "domU provided bogus ring requests "
"(%#x - %#x = %u). Halting ring processing.\n",
rp, rc, rp - rc);
usbif->ring_error = true;
@@ -745,7 +745,7 @@ static void usbback_portid_add(struct usbback_info *usbif, unsigned port,
portname = strchr(busid, '-');
if (!portname) {
- xen_be_printf(&usbif->xendev, 0, "device %s illegal specification\n",
+ xen_pv_printf(&usbif->xendev, 0, "device %s illegal specification\n",
busid);
return;
}
@@ -784,7 +784,7 @@ static void usbback_portid_add(struct usbback_info *usbif, unsigned port,
break;
}
if (speed == USBIF_SPEED_NONE) {
- xen_be_printf(&usbif->xendev, 0, "device %s wrong speed\n", busid);
+ xen_pv_printf(&usbif->xendev, 0, "device %s wrong speed\n", busid);
object_unparent(OBJECT(usbif->ports[port - 1].dev));
usbif->ports[port - 1].dev = NULL;
return;
@@ -801,7 +801,7 @@ static void usbback_portid_add(struct usbback_info *usbif, unsigned port,
err:
QDECREF(qdict);
snprintf(p->path, sizeof(p->path), "%d", 99);
- xen_be_printf(&usbif->xendev, 0, "device %s could not be opened\n", busid);
+ xen_pv_printf(&usbif->xendev, 0, "device %s could not be opened\n", busid);
}
static void usbback_process_port(struct usbback_info *usbif, unsigned port)
@@ -812,7 +812,7 @@ static void usbback_process_port(struct usbback_info *usbif, unsigned port)
snprintf(node, sizeof(node), "port/%d", port);
busid = xenstore_read_be_str(&usbif->xendev, node);
if (busid == NULL) {
- xen_be_printf(&usbif->xendev, 0, "xenstore_read %s failed\n", node);
+ xen_pv_printf(&usbif->xendev, 0, "xenstore_read %s failed\n", node);
return;
}
@@ -869,15 +869,15 @@ static int usbback_connect(struct XenDevice *xendev)
usbif = container_of(xendev, struct usbback_info, xendev);
if (xenstore_read_fe_int(xendev, "urb-ring-ref", &urb_ring_ref)) {
- xen_be_printf(xendev, 0, "error reading urb-ring-ref\n");
+ xen_pv_printf(xendev, 0, "error reading urb-ring-ref\n");
return -1;
}
if (xenstore_read_fe_int(xendev, "conn-ring-ref", &conn_ring_ref)) {
- xen_be_printf(xendev, 0, "error reading conn-ring-ref\n");
+ xen_pv_printf(xendev, 0, "error reading conn-ring-ref\n");
return -1;
}
if (xenstore_read_fe_int(xendev, "event-channel", &xendev->remote_port)) {
- xen_be_printf(xendev, 0, "error reading event-channel\n");
+ xen_pv_printf(xendev, 0, "error reading event-channel\n");
return -1;
}
@@ -888,7 +888,7 @@ static int usbback_connect(struct XenDevice *xendev)
conn_ring_ref,
PROT_READ | PROT_WRITE);
if (!usbif->urb_sring || !usbif->conn_sring) {
- xen_be_printf(xendev, 0, "error mapping rings\n");
+ xen_pv_printf(xendev, 0, "error mapping rings\n");
usbback_disconnect(xendev);
return -1;
}
@@ -900,7 +900,7 @@ static int usbback_connect(struct XenDevice *xendev)
xen_be_bind_evtchn(xendev);
- xen_be_printf(xendev, 1, "urb-ring-ref %d, conn-ring-ref %d, "
+ xen_pv_printf(xendev, 1, "urb-ring-ref %d, conn-ring-ref %d, "
"remote port %d, local port %d\n", urb_ring_ref,
conn_ring_ref, xendev->remote_port, xendev->local_port);
@@ -936,12 +936,12 @@ static int usbback_init(struct XenDevice *xendev)
if (xenstore_read_be_int(xendev, "num-ports", &usbif->num_ports) ||
usbif->num_ports < 1 || usbif->num_ports > USBBACK_MAXPORTS) {
- xen_be_printf(xendev, 0, "num-ports not readable or out of bounds\n");
+ xen_pv_printf(xendev, 0, "num-ports not readable or out of bounds\n");
return -1;
}
if (xenstore_read_be_int(xendev, "usb-ver", &usbif->usb_ver) ||
(usbif->usb_ver != USB_VER_USB11 && usbif->usb_ver != USB_VER_USB20)) {
- xen_be_printf(xendev, 0, "usb-ver not readable or out of bounds\n");
+ xen_pv_printf(xendev, 0, "usb-ver not readable or out of bounds\n");
return -1;
}
@@ -1029,7 +1029,7 @@ static void usbback_alloc(struct XenDevice *xendev)
/* max_grants: for each request and for the rings (request and connect). */
max_grants = USBIF_MAX_SEGMENTS_PER_REQUEST * USB_URB_RING_SIZE + 2;
if (xengnttab_set_max_grants(xendev->gnttabdev, max_grants) < 0) {
- xen_be_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
+ xen_pv_printf(xendev, 0, "xengnttab_set_max_grants failed: %s\n",
strerror(errno));
}
}
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 3518aac..97869cf 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -85,7 +85,7 @@ int xen_be_set_state(struct XenDevice *xendev, enum xenbus_state state)
if (rc < 0) {
return rc;
}
- xen_be_printf(xendev, 1, "backend state: %s -> %s\n",
+ xen_pv_printf(xendev, 1, "backend state: %s -> %s\n",
xenbus_strstate(xendev->be_state), xenbus_strstate(state));
xendev->be_state = state;
return 0;
@@ -121,7 +121,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
xendev->evtchndev = xenevtchn_open(NULL, 0);
if (xendev->evtchndev == NULL) {
- xen_be_printf(NULL, 0, "can't open evtchn device\n");
+ xen_pv_printf(NULL, 0, "can't open evtchn device\n");
g_free(xendev);
return NULL;
}
@@ -130,7 +130,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) {
xendev->gnttabdev = xengnttab_open(NULL, 0);
if (xendev->gnttabdev == NULL) {
- xen_be_printf(NULL, 0, "can't open gnttab device\n");
+ xen_pv_printf(NULL, 0, "can't open gnttab device\n");
xenevtchn_close(xendev->evtchndev);
g_free(xendev);
return NULL;
@@ -163,7 +163,7 @@ static void xen_be_backend_changed(struct XenDevice *xendev, const char *node)
}
if (node) {
- xen_be_printf(xendev, 2, "backend update: %s\n", node);
+ xen_pv_printf(xendev, 2, "backend update: %s\n", node);
if (xendev->ops->backend_changed) {
xendev->ops->backend_changed(xendev, node);
}
@@ -187,26 +187,26 @@ static int xen_be_try_setup(struct XenDevice *xendev)
int be_state;
if (xenstore_read_be_int(xendev, "state", &be_state) == -1) {
- xen_be_printf(xendev, 0, "reading backend state failed\n");
+ xen_pv_printf(xendev, 0, "reading backend state failed\n");
return -1;
}
if (be_state != XenbusStateInitialising) {
- xen_be_printf(xendev, 0, "initial backend state is wrong (%s)\n",
+ xen_pv_printf(xendev, 0, "initial backend state is wrong (%s)\n",
xenbus_strstate(be_state));
return -1;
}
xendev->fe = xenstore_read_be_str(xendev, "frontend");
if (xendev->fe == NULL) {
- xen_be_printf(xendev, 0, "reading frontend path failed\n");
+ xen_pv_printf(xendev, 0, "reading frontend path failed\n");
return -1;
}
/* setup frontend watch */
snprintf(token, sizeof(token), "fe:%p", xendev);
if (!xs_watch(xenstore, xendev->fe, token)) {
- xen_be_printf(xendev, 0, "watching frontend path (%s) failed\n",
+ xen_pv_printf(xendev, 0, "watching frontend path (%s) failed\n",
xendev->fe);
return -1;
}
@@ -230,7 +230,7 @@ static int xen_be_try_init(struct XenDevice *xendev)
int rc = 0;
if (!xendev->online) {
- xen_be_printf(xendev, 1, "not online\n");
+ xen_pv_printf(xendev, 1, "not online\n");
return -1;
}
@@ -238,7 +238,7 @@ static int xen_be_try_init(struct XenDevice *xendev)
rc = xendev->ops->init(xendev);
}
if (rc != 0) {
- xen_be_printf(xendev, 1, "init() failed\n");
+ xen_pv_printf(xendev, 1, "init() failed\n");
return rc;
}
@@ -261,9 +261,9 @@ static int xen_be_try_initialise(struct XenDevice *xendev)
if (xendev->fe_state != XenbusStateInitialised &&
xendev->fe_state != XenbusStateConnected) {
if (xendev->ops->flags & DEVOPS_FLAG_IGNORE_STATE) {
- xen_be_printf(xendev, 2, "frontend not ready, ignoring\n");
+ xen_pv_printf(xendev, 2, "frontend not ready, ignoring\n");
} else {
- xen_be_printf(xendev, 2, "frontend not ready (yet)\n");
+ xen_pv_printf(xendev, 2, "frontend not ready (yet)\n");
return -1;
}
}
@@ -272,7 +272,7 @@ static int xen_be_try_initialise(struct XenDevice *xendev)
rc = xendev->ops->initialise(xendev);
}
if (rc != 0) {
- xen_be_printf(xendev, 0, "initialise() failed\n");
+ xen_pv_printf(xendev, 0, "initialise() failed\n");
return rc;
}
@@ -293,9 +293,9 @@ static void xen_be_try_connected(struct XenDevice *xendev)
if (xendev->fe_state != XenbusStateConnected) {
if (xendev->ops->flags & DEVOPS_FLAG_IGNORE_STATE) {
- xen_be_printf(xendev, 2, "frontend not ready, ignoring\n");
+ xen_pv_printf(xendev, 2, "frontend not ready, ignoring\n");
} else {
- xen_be_printf(xendev, 2, "frontend not ready (yet)\n");
+ xen_pv_printf(xendev, 2, "frontend not ready (yet)\n");
return;
}
}
@@ -329,7 +329,7 @@ static int xen_be_try_reset(struct XenDevice *xendev)
return -1;
}
- xen_be_printf(xendev, 1, "device reset (for re-connect)\n");
+ xen_pv_printf(xendev, 1, "device reset (for re-connect)\n");
xen_be_set_state(xendev, XenbusStateInitialising);
return 0;
}
@@ -390,7 +390,7 @@ static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops)
snprintf(token, sizeof(token), "be:%p:%d:%p", type, dom, ops);
snprintf(path, sizeof(path), "backend/%s/%d", type, dom);
if (!xs_watch(xenstore, path, token)) {
- xen_be_printf(NULL, 0, "xen be: watching backend path (%s) failed\n",
+ xen_pv_printf(NULL, 0, "xen be: watching backend path (%s) failed\n",
path);
return -1;
}
@@ -451,7 +451,7 @@ int xen_be_init(void)
{
xenstore = xs_daemon_open();
if (!xenstore) {
- xen_be_printf(NULL, 0, "can't connect to xenstored\n");
+ xen_pv_printf(NULL, 0, "can't connect to xenstored\n");
return -1;
}
@@ -512,10 +512,10 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
xendev->local_port = xenevtchn_bind_interdomain
(xendev->evtchndev, xendev->dom, xendev->remote_port);
if (xendev->local_port == -1) {
- xen_be_printf(xendev, 0, "xenevtchn_bind_interdomain failed\n");
+ xen_pv_printf(xendev, 0, "xenevtchn_bind_interdomain failed\n");
return -1;
}
- xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
+ xen_pv_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev),
xen_be_evtchn_event, NULL, xendev);
return 0;
diff --git a/hw/xen/xen_devconfig.c b/hw/xen/xen_devconfig.c
index b7d290d..a80e78c 100644
--- a/hw/xen/xen_devconfig.c
+++ b/hw/xen/xen_devconfig.c
@@ -55,7 +55,7 @@ int xen_config_dev_blk(DriveInfo *disk)
const char *filename = qemu_opt_get(disk->opts, "file");
snprintf(device_name, sizeof(device_name), "xvd%c", 'a' + disk->unit);
- xen_be_printf(NULL, 1, "config disk %d [%s]: %s\n",
+ xen_pv_printf(NULL, 1, "config disk %d [%s]: %s\n",
disk->unit, device_name, filename);
xen_config_dev_dirs("vbd", "qdisk", vdev, fe, be, sizeof(fe));
@@ -83,7 +83,7 @@ int xen_config_dev_nic(NICInfo *nic)
snprintf(mac, sizeof(mac), "%02x:%02x:%02x:%02x:%02x:%02x",
nic->macaddr.a[0], nic->macaddr.a[1], nic->macaddr.a[2],
nic->macaddr.a[3], nic->macaddr.a[4], nic->macaddr.a[5]);
- xen_be_printf(NULL, 1, "config nic %d: mac=\"%s\"\n", vlan_id, mac);
+ xen_pv_printf(NULL, 1, "config nic %d: mac=\"%s\"\n", vlan_id, mac);
xen_config_dev_dirs("vif", "qnic", vlan_id, fe, be, sizeof(fe));
/* frontend */
diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
index d42e57b..1407f5f 100644
--- a/hw/xen/xen_frontend.c
+++ b/hw/xen/xen_frontend.c
@@ -48,7 +48,7 @@ void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
fe_state = XenbusStateUnknown;
}
if (xendev->fe_state != fe_state) {
- xen_be_printf(xendev, 1, "frontend state: %s -> %s\n",
+ xen_pv_printf(xendev, 1, "frontend state: %s -> %s\n",
xenbus_strstate(xendev->fe_state),
xenbus_strstate(fe_state));
}
@@ -58,13 +58,13 @@ void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
g_free(xendev->protocol);
xendev->protocol = xenstore_read_fe_str(xendev, "protocol");
if (xendev->protocol) {
- xen_be_printf(xendev, 1, "frontend protocol: %s\n",
+ xen_pv_printf(xendev, 1, "frontend protocol: %s\n",
xendev->protocol);
}
}
if (node) {
- xen_be_printf(xendev, 2, "frontend update: %s\n", node);
+ xen_pv_printf(xendev, 2, "frontend update: %s\n", node);
if (xendev->ops->frontend_changed) {
xendev->ops->frontend_changed(xendev, node);
}
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 6c92624..15bf95c 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -69,13 +69,13 @@ int xenstore_mkdir(char *path, int p)
};
if (!xs_mkdir(xenstore, 0, path)) {
- xen_be_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
+ xen_pv_printf(NULL, 0, "xs_mkdir %s: failed\n", path);
return -1;
}
xenstore_cleanup_dir(g_strdup(path));
if (!xs_set_permissions(xenstore, 0, path, perms, 2)) {
- xen_be_printf(NULL, 0, "xs_set_permissions %s: failed\n", path);
+ xen_pv_printf(NULL, 0, "xs_set_permissions %s: failed\n", path);
return -1;
}
return 0;
@@ -195,7 +195,7 @@ const char *xenbus_strstate(enum xenbus_state state)
* 2 == noisy debug messages (logfile only).
* 3 == will flood your log (logfile only).
*/
-void xen_be_printf(struct XenDevice *xendev, int msg_level,
+void xen_pv_printf(struct XenDevice *xendev, int msg_level,
const char *fmt, ...)
{
va_list args;
@@ -235,7 +235,7 @@ void xen_be_evtchn_event(void *opaque)
port = xenevtchn_pending(xendev->evtchndev);
if (port != xendev->local_port) {
- xen_be_printf(xendev, 0,
+ xen_pv_printf(xendev, 0,
"xenevtchn_pending returned %d (expected %d)\n",
port, xendev->local_port);
return;
@@ -254,7 +254,7 @@ void xen_be_unbind_evtchn(struct XenDevice *xendev)
}
qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
xenevtchn_unbind(xendev->evtchndev, xendev->local_port);
- xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
+ xen_pv_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
xendev->local_port = -1;
}
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 337457e..cf26ce5 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -72,7 +72,7 @@ struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_be_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
-void xen_be_printf(struct XenDevice *xendev, int msg_level,
+void xen_pv_printf(struct XenDevice *xendev, int msg_level,
const char *fmt, ...) GCC_FMT_ATTR(3, 4);
#endif /* QEMU_HW_XEN_PVDEV_H */
diff --git a/xen-common.c b/xen-common.c
index e641ad1..9099760 100644
--- a/xen-common.c
+++ b/xen-common.c
@@ -116,12 +116,12 @@ static int xen_init(MachineState *ms)
{
xen_xc = xc_interface_open(0, 0, 0);
if (xen_xc == NULL) {
- xen_be_printf(NULL, 0, "can't open xen interface\n");
+ xen_pv_printf(NULL, 0, "can't open xen interface\n");
return -1;
}
xen_fmem = xenforeignmemory_open(0, 0);
if (xen_fmem == NULL) {
- xen_be_printf(NULL, 0, "can't open xen fmem interface\n");
+ xen_pv_printf(NULL, 0, "can't open xen fmem interface\n");
xc_interface_close(xen_xc);
return -1;
}
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 10/15] xen: Rename xen_be_unbind_evtchn
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
Prepare xen_be_unbind_evtchn to be shared with frontends:
* xen_be_unbind_evtchn -> xen_pv_unbind_evtchn
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 2 +-
hw/char/xen_console.c | 2 +-
hw/display/xenfb.c | 2 +-
hw/net/xen_nic.c | 2 +-
hw/usb/xen-usb.c | 2 +-
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 425efba..3688a4b 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1195,7 +1195,7 @@ static void blk_disconnect(struct XenDevice *xendev)
blk_unref(blkdev->blk);
blkdev->blk = NULL;
}
- xen_be_unbind_evtchn(&blkdev->xendev);
+ xen_pv_unbind_evtchn(&blkdev->xendev);
if (blkdev->sring) {
xengnttab_unmap(blkdev->xendev.gnttabdev, blkdev->sring, 1);
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index b705a06..6dc2d81 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -265,7 +265,7 @@ static void con_disconnect(struct XenDevice *xendev)
qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
qemu_chr_fe_release(con->chr);
}
- xen_be_unbind_evtchn(&con->xendev);
+ xen_pv_unbind_evtchn(&con->xendev);
if (con->sring) {
if (!xendev->dev) {
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 55aca85..a86d990 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -113,7 +113,7 @@ static int common_bind(struct common *c)
static void common_unbind(struct common *c)
{
- xen_be_unbind_evtchn(&c->xendev);
+ xen_pv_unbind_evtchn(&c->xendev);
if (c->page) {
xenforeignmemory_unmap(xen_fmem, c->page, 1);
c->page = NULL;
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 7418a7b..c6af5dc 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -373,7 +373,7 @@ static void net_disconnect(struct XenDevice *xendev)
{
struct XenNetDev *netdev = container_of(xendev, struct XenNetDev, xendev);
- xen_be_unbind_evtchn(&netdev->xendev);
+ xen_pv_unbind_evtchn(&netdev->xendev);
if (netdev->txs) {
xengnttab_unmap(netdev->xendev.gnttabdev, netdev->txs, 1);
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index a245355..f93c73d 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -835,7 +835,7 @@ static void usbback_disconnect(struct XenDevice *xendev)
usbif = container_of(xendev, struct usbback_info, xendev);
- xen_be_unbind_evtchn(xendev);
+ xen_pv_unbind_evtchn(xendev);
if (usbif->urb_sring) {
xengnttab_unmap(xendev->gnttabdev, usbif->urb_sring, 1);
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 15bf95c..85f7430 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -247,7 +247,7 @@ void xen_be_evtchn_event(void *opaque)
}
}
-void xen_be_unbind_evtchn(struct XenDevice *xendev)
+void xen_pv_unbind_evtchn(struct XenDevice *xendev)
{
if (xendev->local_port == -1) {
return;
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index cf26ce5..bc8a3ea 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -69,7 +69,7 @@ void xen_pv_insert_xendev(struct XenDevice *xendev);
void xen_be_del_xendev(struct XenDevice *xendev);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
-void xen_be_unbind_evtchn(struct XenDevice *xendev);
+void xen_pv_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
void xen_pv_printf(struct XenDevice *xendev, int msg_level,
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 10/15] xen: Rename xen_be_unbind_evtchn
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
Prepare xen_be_unbind_evtchn to be shared with frontends:
* xen_be_unbind_evtchn -> xen_pv_unbind_evtchn
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 2 +-
hw/char/xen_console.c | 2 +-
hw/display/xenfb.c | 2 +-
hw/net/xen_nic.c | 2 +-
hw/usb/xen-usb.c | 2 +-
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 425efba..3688a4b 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -1195,7 +1195,7 @@ static void blk_disconnect(struct XenDevice *xendev)
blk_unref(blkdev->blk);
blkdev->blk = NULL;
}
- xen_be_unbind_evtchn(&blkdev->xendev);
+ xen_pv_unbind_evtchn(&blkdev->xendev);
if (blkdev->sring) {
xengnttab_unmap(blkdev->xendev.gnttabdev, blkdev->sring, 1);
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index b705a06..6dc2d81 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -265,7 +265,7 @@ static void con_disconnect(struct XenDevice *xendev)
qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
qemu_chr_fe_release(con->chr);
}
- xen_be_unbind_evtchn(&con->xendev);
+ xen_pv_unbind_evtchn(&con->xendev);
if (con->sring) {
if (!xendev->dev) {
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 55aca85..a86d990 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -113,7 +113,7 @@ static int common_bind(struct common *c)
static void common_unbind(struct common *c)
{
- xen_be_unbind_evtchn(&c->xendev);
+ xen_pv_unbind_evtchn(&c->xendev);
if (c->page) {
xenforeignmemory_unmap(xen_fmem, c->page, 1);
c->page = NULL;
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index 7418a7b..c6af5dc 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -373,7 +373,7 @@ static void net_disconnect(struct XenDevice *xendev)
{
struct XenNetDev *netdev = container_of(xendev, struct XenNetDev, xendev);
- xen_be_unbind_evtchn(&netdev->xendev);
+ xen_pv_unbind_evtchn(&netdev->xendev);
if (netdev->txs) {
xengnttab_unmap(netdev->xendev.gnttabdev, netdev->txs, 1);
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index a245355..f93c73d 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -835,7 +835,7 @@ static void usbback_disconnect(struct XenDevice *xendev)
usbif = container_of(xendev, struct usbback_info, xendev);
- xen_be_unbind_evtchn(xendev);
+ xen_pv_unbind_evtchn(xendev);
if (usbif->urb_sring) {
xengnttab_unmap(xendev->gnttabdev, usbif->urb_sring, 1);
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 15bf95c..85f7430 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -247,7 +247,7 @@ void xen_be_evtchn_event(void *opaque)
}
}
-void xen_be_unbind_evtchn(struct XenDevice *xendev)
+void xen_pv_unbind_evtchn(struct XenDevice *xendev)
{
if (xendev->local_port == -1) {
return;
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index cf26ce5..bc8a3ea 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -69,7 +69,7 @@ void xen_pv_insert_xendev(struct XenDevice *xendev);
void xen_be_del_xendev(struct XenDevice *xendev);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
-void xen_be_unbind_evtchn(struct XenDevice *xendev);
+void xen_pv_unbind_evtchn(struct XenDevice *xendev);
int xen_be_send_notify(struct XenDevice *xendev);
void xen_pv_printf(struct XenDevice *xendev, int msg_level,
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 11/15] xen: Rename xen_be_send_notify
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
Prepare xen_be_send_notify to be shared with frontends:
* xen_be_send_notify -> xen_pv_send_notify
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 4 ++--
hw/char/xen_console.c | 4 ++--
hw/display/xenfb.c | 8 ++++----
hw/net/xen_nic.c | 4 ++--
hw/usb/xen-usb.c | 6 +++---
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
7 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 3688a4b..799ee25 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -797,7 +797,7 @@ static void blk_send_response_all(struct XenBlkDev *blkdev)
ioreq_release(ioreq, true);
}
if (send_notify) {
- xen_be_send_notify(&blkdev->xendev);
+ xen_pv_send_notify(&blkdev->xendev);
}
}
@@ -867,7 +867,7 @@ static void blk_handle_requests(struct XenBlkDev *blkdev)
};
if (blk_send_response_one(ioreq)) {
- xen_be_send_notify(&blkdev->xendev);
+ xen_pv_send_notify(&blkdev->xendev);
}
ioreq_release(ioreq, false);
continue;
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 6dc2d81..dbe4755 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -72,7 +72,7 @@ static void buffer_append(struct XenConsole *con)
xen_mb();
intf->out_cons = cons;
- xen_be_send_notify(&con->xendev);
+ xen_pv_send_notify(&con->xendev);
if (buffer->max_capacity &&
buffer->size > buffer->max_capacity) {
@@ -140,7 +140,7 @@ static void xencons_receive(void *opaque, const uint8_t *buf, int len)
}
xen_wmb();
intf->in_prod = prod;
- xen_be_send_notify(&con->xendev);
+ xen_pv_send_notify(&con->xendev);
}
static void xencons_send(struct XenConsole *con)
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index a86d990..9a7b298 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -216,7 +216,7 @@ static int xenfb_kbd_event(struct XenInput *xenfb,
XENKBD_IN_RING_REF(page, prod) = *event;
xen_wmb(); /* ensure ring contents visible */
page->in_prod = prod + 1;
- return xen_be_send_notify(&xenfb->c.xendev);
+ return xen_pv_send_notify(&xenfb->c.xendev);
}
/* Send a keyboard (or mouse button) event */
@@ -398,7 +398,7 @@ static void input_event(struct XenDevice *xendev)
if (page->out_prod == page->out_cons)
return;
page->out_cons = page->out_prod;
- xen_be_send_notify(&xenfb->c.xendev);
+ xen_pv_send_notify(&xenfb->c.xendev);
}
/* -------------------------------------------------------------------- */
@@ -673,7 +673,7 @@ static void xenfb_send_event(struct XenFB *xenfb, union xenfb_in_event *event)
xen_wmb(); /* ensure ring contents visible */
page->in_prod = prod + 1;
- xen_be_send_notify(&xenfb->c.xendev);
+ xen_pv_send_notify(&xenfb->c.xendev);
}
static void xenfb_send_refresh_period(struct XenFB *xenfb, int period)
@@ -946,7 +946,7 @@ static void fb_event(struct XenDevice *xendev)
struct XenFB *xenfb = container_of(xendev, struct XenFB, c.xendev);
xenfb_handle_events(xenfb);
- xen_be_send_notify(&xenfb->c.xendev);
+ xen_pv_send_notify(&xenfb->c.xendev);
}
/* -------------------------------------------------------------------- */
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index c6af5dc..89a2f43 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -70,7 +70,7 @@ static void net_tx_response(struct XenNetDev *netdev, netif_tx_request_t *txp, i
netdev->tx_ring.rsp_prod_pvt = ++i;
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netdev->tx_ring, notify);
if (notify) {
- xen_be_send_notify(&netdev->xendev);
+ xen_pv_send_notify(&netdev->xendev);
}
if (i == netdev->tx_ring.req_cons) {
@@ -222,7 +222,7 @@ static void net_rx_response(struct XenNetDev *netdev,
netdev->rx_ring.rsp_prod_pvt = ++i;
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netdev->rx_ring, notify);
if (notify) {
- xen_be_send_notify(&netdev->xendev);
+ xen_pv_send_notify(&netdev->xendev);
}
}
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index f93c73d..7b0abf4 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -315,7 +315,7 @@ static void usbback_do_response(struct usbback_req *usbback_req, int32_t status,
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&usbif->urb_ring, notify);
if (notify) {
- xen_be_send_notify(xendev);
+ xen_pv_send_notify(xendev);
}
}
@@ -591,7 +591,7 @@ static void usbback_hotplug_notify(struct usbback_info *usbif)
/* Check for full ring. */
if ((RING_SIZE(ring) - ring->rsp_prod_pvt - ring->req_cons) == 0) {
- xen_be_send_notify(&usbif->xendev);
+ xen_pv_send_notify(&usbif->xendev);
return;
}
@@ -610,7 +610,7 @@ static void usbback_hotplug_notify(struct usbback_info *usbif)
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(ring, notify);
if (notify) {
- xen_be_send_notify(&usbif->xendev);
+ xen_pv_send_notify(&usbif->xendev);
}
TR_BUS(&usbif->xendev, "hotplug port %d speed %d\n", usb_hp->port,
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 85f7430..61e40c9 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -258,7 +258,7 @@ void xen_pv_unbind_evtchn(struct XenDevice *xendev)
xendev->local_port = -1;
}
-int xen_be_send_notify(struct XenDevice *xendev)
+int xen_pv_send_notify(struct XenDevice *xendev)
{
return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
}
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index bc8a3ea..0ebcda7 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -70,7 +70,7 @@ void xen_be_del_xendev(struct XenDevice *xendev);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_pv_unbind_evtchn(struct XenDevice *xendev);
-int xen_be_send_notify(struct XenDevice *xendev);
+int xen_pv_send_notify(struct XenDevice *xendev);
void xen_pv_printf(struct XenDevice *xendev, int msg_level,
const char *fmt, ...) GCC_FMT_ATTR(3, 4);
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 11/15] xen: Rename xen_be_send_notify
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
Prepare xen_be_send_notify to be shared with frontends:
* xen_be_send_notify -> xen_pv_send_notify
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/block/xen_disk.c | 4 ++--
hw/char/xen_console.c | 4 ++--
hw/display/xenfb.c | 8 ++++----
hw/net/xen_nic.c | 4 ++--
hw/usb/xen-usb.c | 6 +++---
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
7 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 3688a4b..799ee25 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -797,7 +797,7 @@ static void blk_send_response_all(struct XenBlkDev *blkdev)
ioreq_release(ioreq, true);
}
if (send_notify) {
- xen_be_send_notify(&blkdev->xendev);
+ xen_pv_send_notify(&blkdev->xendev);
}
}
@@ -867,7 +867,7 @@ static void blk_handle_requests(struct XenBlkDev *blkdev)
};
if (blk_send_response_one(ioreq)) {
- xen_be_send_notify(&blkdev->xendev);
+ xen_pv_send_notify(&blkdev->xendev);
}
ioreq_release(ioreq, false);
continue;
diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
index 6dc2d81..dbe4755 100644
--- a/hw/char/xen_console.c
+++ b/hw/char/xen_console.c
@@ -72,7 +72,7 @@ static void buffer_append(struct XenConsole *con)
xen_mb();
intf->out_cons = cons;
- xen_be_send_notify(&con->xendev);
+ xen_pv_send_notify(&con->xendev);
if (buffer->max_capacity &&
buffer->size > buffer->max_capacity) {
@@ -140,7 +140,7 @@ static void xencons_receive(void *opaque, const uint8_t *buf, int len)
}
xen_wmb();
intf->in_prod = prod;
- xen_be_send_notify(&con->xendev);
+ xen_pv_send_notify(&con->xendev);
}
static void xencons_send(struct XenConsole *con)
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index a86d990..9a7b298 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -216,7 +216,7 @@ static int xenfb_kbd_event(struct XenInput *xenfb,
XENKBD_IN_RING_REF(page, prod) = *event;
xen_wmb(); /* ensure ring contents visible */
page->in_prod = prod + 1;
- return xen_be_send_notify(&xenfb->c.xendev);
+ return xen_pv_send_notify(&xenfb->c.xendev);
}
/* Send a keyboard (or mouse button) event */
@@ -398,7 +398,7 @@ static void input_event(struct XenDevice *xendev)
if (page->out_prod == page->out_cons)
return;
page->out_cons = page->out_prod;
- xen_be_send_notify(&xenfb->c.xendev);
+ xen_pv_send_notify(&xenfb->c.xendev);
}
/* -------------------------------------------------------------------- */
@@ -673,7 +673,7 @@ static void xenfb_send_event(struct XenFB *xenfb, union xenfb_in_event *event)
xen_wmb(); /* ensure ring contents visible */
page->in_prod = prod + 1;
- xen_be_send_notify(&xenfb->c.xendev);
+ xen_pv_send_notify(&xenfb->c.xendev);
}
static void xenfb_send_refresh_period(struct XenFB *xenfb, int period)
@@ -946,7 +946,7 @@ static void fb_event(struct XenDevice *xendev)
struct XenFB *xenfb = container_of(xendev, struct XenFB, c.xendev);
xenfb_handle_events(xenfb);
- xen_be_send_notify(&xenfb->c.xendev);
+ xen_pv_send_notify(&xenfb->c.xendev);
}
/* -------------------------------------------------------------------- */
diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c
index c6af5dc..89a2f43 100644
--- a/hw/net/xen_nic.c
+++ b/hw/net/xen_nic.c
@@ -70,7 +70,7 @@ static void net_tx_response(struct XenNetDev *netdev, netif_tx_request_t *txp, i
netdev->tx_ring.rsp_prod_pvt = ++i;
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netdev->tx_ring, notify);
if (notify) {
- xen_be_send_notify(&netdev->xendev);
+ xen_pv_send_notify(&netdev->xendev);
}
if (i == netdev->tx_ring.req_cons) {
@@ -222,7 +222,7 @@ static void net_rx_response(struct XenNetDev *netdev,
netdev->rx_ring.rsp_prod_pvt = ++i;
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&netdev->rx_ring, notify);
if (notify) {
- xen_be_send_notify(&netdev->xendev);
+ xen_pv_send_notify(&netdev->xendev);
}
}
diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c
index f93c73d..7b0abf4 100644
--- a/hw/usb/xen-usb.c
+++ b/hw/usb/xen-usb.c
@@ -315,7 +315,7 @@ static void usbback_do_response(struct usbback_req *usbback_req, int32_t status,
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&usbif->urb_ring, notify);
if (notify) {
- xen_be_send_notify(xendev);
+ xen_pv_send_notify(xendev);
}
}
@@ -591,7 +591,7 @@ static void usbback_hotplug_notify(struct usbback_info *usbif)
/* Check for full ring. */
if ((RING_SIZE(ring) - ring->rsp_prod_pvt - ring->req_cons) == 0) {
- xen_be_send_notify(&usbif->xendev);
+ xen_pv_send_notify(&usbif->xendev);
return;
}
@@ -610,7 +610,7 @@ static void usbback_hotplug_notify(struct usbback_info *usbif)
RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(ring, notify);
if (notify) {
- xen_be_send_notify(&usbif->xendev);
+ xen_pv_send_notify(&usbif->xendev);
}
TR_BUS(&usbif->xendev, "hotplug port %d speed %d\n", usb_hp->port,
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 85f7430..61e40c9 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -258,7 +258,7 @@ void xen_pv_unbind_evtchn(struct XenDevice *xendev)
xendev->local_port = -1;
}
-int xen_be_send_notify(struct XenDevice *xendev)
+int xen_pv_send_notify(struct XenDevice *xendev)
{
return xenevtchn_notify(xendev->evtchndev, xendev->local_port);
}
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index bc8a3ea..0ebcda7 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -70,7 +70,7 @@ void xen_be_del_xendev(struct XenDevice *xendev);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
void xen_pv_unbind_evtchn(struct XenDevice *xendev);
-int xen_be_send_notify(struct XenDevice *xendev);
+int xen_pv_send_notify(struct XenDevice *xendev);
void xen_pv_printf(struct XenDevice *xendev, int msg_level,
const char *fmt, ...) GCC_FMT_ATTR(3, 4);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 12/15] xen: Rename xen_be_evtchn_event
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
Prepare xen_be_evtchn_event to be shared with frontends:
* xen_be_evtchn_event -> xen_pv_evtchn_event
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 2 +-
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 97869cf..b6c11a1 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -517,7 +517,7 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
}
xen_pv_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev),
- xen_be_evtchn_event, NULL, xendev);
+ xen_pv_evtchn_event, NULL, xendev);
return 0;
}
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 61e40c9..1c2cb98 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -228,7 +228,7 @@ void xen_pv_printf(struct XenDevice *xendev, int msg_level,
qemu_log_flush();
}
-void xen_be_evtchn_event(void *opaque)
+void xen_pv_evtchn_event(void *opaque)
{
struct XenDevice *xendev = opaque;
evtchn_port_t port;
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 0ebcda7..46560a1 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -64,7 +64,7 @@ void xenstore_update(void *unused);
const char *xenbus_strstate(enum xenbus_state state);
-void xen_be_evtchn_event(void *opaque);
+void xen_pv_evtchn_event(void *opaque);
void xen_pv_insert_xendev(struct XenDevice *xendev);
void xen_be_del_xendev(struct XenDevice *xendev);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 12/15] xen: Rename xen_be_evtchn_event
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
Prepare xen_be_evtchn_event to be shared with frontends:
* xen_be_evtchn_event -> xen_pv_evtchn_event
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 2 +-
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 97869cf..b6c11a1 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -517,7 +517,7 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
}
xen_pv_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
qemu_set_fd_handler(xenevtchn_fd(xendev->evtchndev),
- xen_be_evtchn_event, NULL, xendev);
+ xen_pv_evtchn_event, NULL, xendev);
return 0;
}
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 61e40c9..1c2cb98 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -228,7 +228,7 @@ void xen_pv_printf(struct XenDevice *xendev, int msg_level,
qemu_log_flush();
}
-void xen_be_evtchn_event(void *opaque)
+void xen_pv_evtchn_event(void *opaque)
{
struct XenDevice *xendev = opaque;
evtchn_port_t port;
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 0ebcda7..46560a1 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -64,7 +64,7 @@ void xenstore_update(void *unused);
const char *xenbus_strstate(enum xenbus_state state);
-void xen_be_evtchn_event(void *opaque);
+void xen_pv_evtchn_event(void *opaque);
void xen_pv_insert_xendev(struct XenDevice *xendev);
void xen_be_del_xendev(struct XenDevice *xendev);
struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 13/15] xen: Rename xen_be_find_xendev
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
Prepare xen_be_find_xendev to be shared with frontends:
* xen_be_find_xendev -> xen_pv_find_xendev
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/display/xenfb.c | 4 ++--
hw/xen/xen_backend.c | 2 +-
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 9a7b298..52020b3 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -989,8 +989,8 @@ void xen_init_display(int domid)
wait_more:
i++;
main_loop_wait(true);
- xfb = xen_be_find_xendev("vfb", domid, 0);
- xin = xen_be_find_xendev("vkbd", domid, 0);
+ xfb = xen_pv_find_xendev("vfb", domid, 0);
+ xin = xen_pv_find_xendev("vkbd", domid, 0);
if (!xfb || !xin) {
if (i < 256) {
usleep(10000);
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index b6c11a1..5c41524 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -99,7 +99,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
{
struct XenDevice *xendev;
- xendev = xen_be_find_xendev(type, dom, dev);
+ xendev = xen_pv_find_xendev(type, dom, dev);
if (xendev) {
return xendev;
}
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 1c2cb98..69cf7af 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -265,7 +265,7 @@ int xen_pv_send_notify(struct XenDevice *xendev)
/* ------------------------------------------------------------- */
-struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev)
+struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev)
{
struct XenDevice *xendev;
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 46560a1..550bf69 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -67,7 +67,7 @@ const char *xenbus_strstate(enum xenbus_state state);
void xen_pv_evtchn_event(void *opaque);
void xen_pv_insert_xendev(struct XenDevice *xendev);
void xen_be_del_xendev(struct XenDevice *xendev);
-struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
+struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev);
void xen_pv_unbind_evtchn(struct XenDevice *xendev);
int xen_pv_send_notify(struct XenDevice *xendev);
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 13/15] xen: Rename xen_be_find_xendev
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
Prepare xen_be_find_xendev to be shared with frontends:
* xen_be_find_xendev -> xen_pv_find_xendev
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/display/xenfb.c | 4 ++--
hw/xen/xen_backend.c | 2 +-
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 9a7b298..52020b3 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -989,8 +989,8 @@ void xen_init_display(int domid)
wait_more:
i++;
main_loop_wait(true);
- xfb = xen_be_find_xendev("vfb", domid, 0);
- xin = xen_be_find_xendev("vkbd", domid, 0);
+ xfb = xen_pv_find_xendev("vfb", domid, 0);
+ xin = xen_pv_find_xendev("vkbd", domid, 0);
if (!xfb || !xin) {
if (i < 256) {
usleep(10000);
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index b6c11a1..5c41524 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -99,7 +99,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,
{
struct XenDevice *xendev;
- xendev = xen_be_find_xendev(type, dom, dev);
+ xendev = xen_pv_find_xendev(type, dom, dev);
if (xendev) {
return xendev;
}
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 1c2cb98..69cf7af 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -265,7 +265,7 @@ int xen_pv_send_notify(struct XenDevice *xendev)
/* ------------------------------------------------------------- */
-struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev)
+struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev)
{
struct XenDevice *xendev;
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 46560a1..550bf69 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -67,7 +67,7 @@ const char *xenbus_strstate(enum xenbus_state state);
void xen_pv_evtchn_event(void *opaque);
void xen_pv_insert_xendev(struct XenDevice *xendev);
void xen_be_del_xendev(struct XenDevice *xendev);
-struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev);
+struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev);
void xen_pv_unbind_evtchn(struct XenDevice *xendev);
int xen_pv_send_notify(struct XenDevice *xendev);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 14/15] xen: Rename xen_be_del_xendev
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
` (15 subsequent siblings)
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
Prepare xen_be_del_xendev to be shared with frontends:
* xen_be_del_xendev -> xen_pv_del_xendev
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 2 +-
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 5c41524..30d3aaa 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -436,7 +436,7 @@ void xenstore_update_be(char *watch, char *type, int dom,
if (xendev != NULL) {
bepath = xs_read(xenstore, 0, xendev->be, &len);
if (bepath == NULL) {
- xen_be_del_xendev(xendev);
+ xen_pv_del_xendev(xendev);
} else {
free(bepath);
xen_be_backend_changed(xendev, path);
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 69cf7af..9bc4b38 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -287,7 +287,7 @@ struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev)
/*
* release xen backend device.
*/
-void xen_be_del_xendev(struct XenDevice *xendev)
+void xen_pv_del_xendev(struct XenDevice *xendev)
{
if (xendev->ops->free) {
xendev->ops->free(xendev);
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 550bf69..dfe91c1 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -66,7 +66,7 @@ const char *xenbus_strstate(enum xenbus_state state);
void xen_pv_evtchn_event(void *opaque);
void xen_pv_insert_xendev(struct XenDevice *xendev);
-void xen_be_del_xendev(struct XenDevice *xendev);
+void xen_pv_del_xendev(struct XenDevice *xendev);
struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev);
void xen_pv_unbind_evtchn(struct XenDevice *xendev);
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 14/15] xen: Rename xen_be_del_xendev
@ 2016-10-04 6:43 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
Prepare xen_be_del_xendev to be shared with frontends:
* xen_be_del_xendev -> xen_pv_del_xendev
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 2 +-
hw/xen/xen_pvdev.c | 2 +-
include/hw/xen/xen_pvdev.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 5c41524..30d3aaa 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -436,7 +436,7 @@ void xenstore_update_be(char *watch, char *type, int dom,
if (xendev != NULL) {
bepath = xs_read(xenstore, 0, xendev->be, &len);
if (bepath == NULL) {
- xen_be_del_xendev(xendev);
+ xen_pv_del_xendev(xendev);
} else {
free(bepath);
xen_be_backend_changed(xendev, path);
diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c
index 69cf7af..9bc4b38 100644
--- a/hw/xen/xen_pvdev.c
+++ b/hw/xen/xen_pvdev.c
@@ -287,7 +287,7 @@ struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev)
/*
* release xen backend device.
*/
-void xen_be_del_xendev(struct XenDevice *xendev)
+void xen_pv_del_xendev(struct XenDevice *xendev)
{
if (xendev->ops->free) {
xendev->ops->free(xendev);
diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h
index 550bf69..dfe91c1 100644
--- a/include/hw/xen/xen_pvdev.h
+++ b/include/hw/xen/xen_pvdev.h
@@ -66,7 +66,7 @@ const char *xenbus_strstate(enum xenbus_state state);
void xen_pv_evtchn_event(void *opaque);
void xen_pv_insert_xendev(struct XenDevice *xendev);
-void xen_be_del_xendev(struct XenDevice *xendev);
+void xen_pv_del_xendev(struct XenDevice *xendev);
struct XenDevice *xen_pv_find_xendev(const char *type, int dom, int dev);
void xen_pv_unbind_evtchn(struct XenDevice *xendev);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
` (14 preceding siblings ...)
2016-10-04 6:43 ` Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
2016-10-04 8:06 ` Paolo Bonzini
2016-10-04 6:43 ` Emil Condrea
16 siblings, 1 reply; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, anthony.perard, wei.liu2, stefanb, sstabellini,
xen-devel, dgdegra, eblake, Emil Condrea
xen_be_frontend_changed -> xen_fe_frontend_changed
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 2 +-
hw/xen/xen_frontend.c | 4 ++--
include/hw/xen/xen_frontend.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 30d3aaa..b79e83e 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
xen_be_set_state(xendev, XenbusStateInitialising);
xen_be_backend_changed(xendev, NULL);
- xen_be_frontend_changed(xendev, NULL);
+ xen_fe_frontend_changed(xendev, NULL);
return 0;
}
diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
index 1407f5f..761688b 100644
--- a/hw/xen/xen_frontend.c
+++ b/hw/xen/xen_frontend.c
@@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
return xenstore_read_uint64(xendev->fe, node, uval);
}
-void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
+void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
{
int fe_state;
@@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
}
node = watch + len + 1;
- xen_be_frontend_changed(xendev, node);
+ xen_fe_frontend_changed(xendev, node);
xen_be_check_state(xendev);
}
diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
index bb0bc23..2a5f03f 100644
--- a/include/hw/xen/xen_frontend.h
+++ b/include/hw/xen/xen_frontend.h
@@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
uint64_t *uval);
void xenstore_update_fe(char *watch, struct XenDevice *xendev);
-void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
+void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
#endif /* QEMU_HW_XEN_FRONTEND_H */
--
1.9.1
^ permalink raw reply related [flat|nested] 85+ messages in thread
* [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
` (15 preceding siblings ...)
2016-10-04 6:43 ` [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed Emil Condrea
@ 2016-10-04 6:43 ` Emil Condrea
16 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-04 6:43 UTC (permalink / raw)
To: qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra, eblake, Emil Condrea
xen_be_frontend_changed -> xen_fe_frontend_changed
Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
---
hw/xen/xen_backend.c | 2 +-
hw/xen/xen_frontend.c | 4 ++--
include/hw/xen/xen_frontend.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
index 30d3aaa..b79e83e 100644
--- a/hw/xen/xen_backend.c
+++ b/hw/xen/xen_backend.c
@@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
xen_be_set_state(xendev, XenbusStateInitialising);
xen_be_backend_changed(xendev, NULL);
- xen_be_frontend_changed(xendev, NULL);
+ xen_fe_frontend_changed(xendev, NULL);
return 0;
}
diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
index 1407f5f..761688b 100644
--- a/hw/xen/xen_frontend.c
+++ b/hw/xen/xen_frontend.c
@@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
return xenstore_read_uint64(xendev->fe, node, uval);
}
-void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
+void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
{
int fe_state;
@@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
}
node = watch + len + 1;
- xen_be_frontend_changed(xendev, node);
+ xen_fe_frontend_changed(xendev, node);
xen_be_check_state(xendev);
}
diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
index bb0bc23..2a5f03f 100644
--- a/include/hw/xen/xen_frontend.h
+++ b/include/hw/xen/xen_frontend.h
@@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
uint64_t *uval);
void xenstore_update_fe(char *watch, struct XenDevice *xendev);
-void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
+void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
#endif /* QEMU_HW_XEN_FRONTEND_H */
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-04 6:43 ` [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed Emil Condrea
@ 2016-10-04 8:06 ` Paolo Bonzini
0 siblings, 0 replies; 85+ messages in thread
From: Paolo Bonzini @ 2016-10-04 8:06 UTC (permalink / raw)
To: Emil Condrea, qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra
On 04/10/2016 08:43, Emil Condrea wrote:
> xen_be_frontend_changed -> xen_fe_frontend_changed
This is not correct. The front-end is implemented in the guest domain,
while the back-end is implemented in the dom0 or stubdom.
This function processes *in the backed* a notification that the frontend
state changed, hence the name should be xen_be_frontend_changed.
Paolo
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
> ---
> hw/xen/xen_backend.c | 2 +-
> hw/xen/xen_frontend.c | 4 ++--
> include/hw/xen/xen_frontend.h | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
> index 30d3aaa..b79e83e 100644
> --- a/hw/xen/xen_backend.c
> +++ b/hw/xen/xen_backend.c
> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
> xen_be_set_state(xendev, XenbusStateInitialising);
>
> xen_be_backend_changed(xendev, NULL);
> - xen_be_frontend_changed(xendev, NULL);
> + xen_fe_frontend_changed(xendev, NULL);
> return 0;
> }
>
> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
> index 1407f5f..761688b 100644
> --- a/hw/xen/xen_frontend.c
> +++ b/hw/xen/xen_frontend.c
> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
> return xenstore_read_uint64(xendev->fe, node, uval);
> }
>
> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
> {
> int fe_state;
>
> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
> }
> node = watch + len + 1;
>
> - xen_be_frontend_changed(xendev, node);
> + xen_fe_frontend_changed(xendev, node);
> xen_be_check_state(xendev);
> }
> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
> index bb0bc23..2a5f03f 100644
> --- a/include/hw/xen/xen_frontend.h
> +++ b/include/hw/xen/xen_frontend.h
> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
> uint64_t *uval);
> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>
> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>
> #endif /* QEMU_HW_XEN_FRONTEND_H */
>
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 15/15] xen: Rename xen_be_frontend_changed
@ 2016-10-04 8:06 ` Paolo Bonzini
0 siblings, 0 replies; 85+ messages in thread
From: Paolo Bonzini @ 2016-10-04 8:06 UTC (permalink / raw)
To: Emil Condrea, qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra
On 04/10/2016 08:43, Emil Condrea wrote:
> xen_be_frontend_changed -> xen_fe_frontend_changed
This is not correct. The front-end is implemented in the guest domain,
while the back-end is implemented in the dom0 or stubdom.
This function processes *in the backed* a notification that the frontend
state changed, hence the name should be xen_be_frontend_changed.
Paolo
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
> ---
> hw/xen/xen_backend.c | 2 +-
> hw/xen/xen_frontend.c | 4 ++--
> include/hw/xen/xen_frontend.h | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
> index 30d3aaa..b79e83e 100644
> --- a/hw/xen/xen_backend.c
> +++ b/hw/xen/xen_backend.c
> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
> xen_be_set_state(xendev, XenbusStateInitialising);
>
> xen_be_backend_changed(xendev, NULL);
> - xen_be_frontend_changed(xendev, NULL);
> + xen_fe_frontend_changed(xendev, NULL);
> return 0;
> }
>
> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
> index 1407f5f..761688b 100644
> --- a/hw/xen/xen_frontend.c
> +++ b/hw/xen/xen_frontend.c
> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
> return xenstore_read_uint64(xendev->fe, node, uval);
> }
>
> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
> {
> int fe_state;
>
> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
> }
> node = watch + len + 1;
>
> - xen_be_frontend_changed(xendev, node);
> + xen_fe_frontend_changed(xendev, node);
> xen_be_check_state(xendev);
> }
> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
> index bb0bc23..2a5f03f 100644
> --- a/include/hw/xen/xen_frontend.h
> +++ b/include/hw/xen/xen_frontend.h
> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
> uint64_t *uval);
> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>
> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>
> #endif /* QEMU_HW_XEN_FRONTEND_H */
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-04 8:06 ` Paolo Bonzini
@ 2016-10-04 8:08 ` Paolo Bonzini
-1 siblings, 0 replies; 85+ messages in thread
From: Paolo Bonzini @ 2016-10-04 8:08 UTC (permalink / raw)
To: Emil Condrea, qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra
On 04/10/2016 10:06, Paolo Bonzini wrote:
>
>
> On 04/10/2016 08:43, Emil Condrea wrote:
>> xen_be_frontend_changed -> xen_fe_frontend_changed
>
> This is not correct. The front-end is implemented in the guest domain,
> while the back-end is implemented in the dom0 or stubdom.
>
> This function processes *in the backed* a notification that the frontend
> state changed, hence the name should be xen_be_frontend_changed.
Sorry, this comment was in the wrong place. It should have referred
only to the hunk in hw/xen/xen_backend.c.
Paolo
> Paolo
>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>> ---
>> hw/xen/xen_backend.c | 2 +-
>> hw/xen/xen_frontend.c | 4 ++--
>> include/hw/xen/xen_frontend.h | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>> index 30d3aaa..b79e83e 100644
>> --- a/hw/xen/xen_backend.c
>> +++ b/hw/xen/xen_backend.c
>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
>> xen_be_set_state(xendev, XenbusStateInitialising);
>>
>> xen_be_backend_changed(xendev, NULL);
>> - xen_be_frontend_changed(xendev, NULL);
>> + xen_fe_frontend_changed(xendev, NULL);
>> return 0;
>> }
>>
>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
>> index 1407f5f..761688b 100644
>> --- a/hw/xen/xen_frontend.c
>> +++ b/hw/xen/xen_frontend.c
>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> return xenstore_read_uint64(xendev->fe, node, uval);
>> }
>>
>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
>> {
>> int fe_state;
>>
>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
>> }
>> node = watch + len + 1;
>>
>> - xen_be_frontend_changed(xendev, node);
>> + xen_fe_frontend_changed(xendev, node);
>> xen_be_check_state(xendev);
>> }
>> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
>> index bb0bc23..2a5f03f 100644
>> --- a/include/hw/xen/xen_frontend.h
>> +++ b/include/hw/xen/xen_frontend.h
>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> uint64_t *uval);
>> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>>
>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>>
>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
>
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 15/15] xen: Rename xen_be_frontend_changed
@ 2016-10-04 8:08 ` Paolo Bonzini
0 siblings, 0 replies; 85+ messages in thread
From: Paolo Bonzini @ 2016-10-04 8:08 UTC (permalink / raw)
To: Emil Condrea, qemu-devel
Cc: xuquan8, sstabellini, wei.liu2, stefanb, xen-devel,
anthony.perard, dgdegra
On 04/10/2016 10:06, Paolo Bonzini wrote:
>
>
> On 04/10/2016 08:43, Emil Condrea wrote:
>> xen_be_frontend_changed -> xen_fe_frontend_changed
>
> This is not correct. The front-end is implemented in the guest domain,
> while the back-end is implemented in the dom0 or stubdom.
>
> This function processes *in the backed* a notification that the frontend
> state changed, hence the name should be xen_be_frontend_changed.
Sorry, this comment was in the wrong place. It should have referred
only to the hunk in hw/xen/xen_backend.c.
Paolo
> Paolo
>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>> ---
>> hw/xen/xen_backend.c | 2 +-
>> hw/xen/xen_frontend.c | 4 ++--
>> include/hw/xen/xen_frontend.h | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>> index 30d3aaa..b79e83e 100644
>> --- a/hw/xen/xen_backend.c
>> +++ b/hw/xen/xen_backend.c
>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
>> xen_be_set_state(xendev, XenbusStateInitialising);
>>
>> xen_be_backend_changed(xendev, NULL);
>> - xen_be_frontend_changed(xendev, NULL);
>> + xen_fe_frontend_changed(xendev, NULL);
>> return 0;
>> }
>>
>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
>> index 1407f5f..761688b 100644
>> --- a/hw/xen/xen_frontend.c
>> +++ b/hw/xen/xen_frontend.c
>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> return xenstore_read_uint64(xendev->fe, node, uval);
>> }
>>
>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
>> {
>> int fe_state;
>>
>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
>> }
>> node = watch + len + 1;
>>
>> - xen_be_frontend_changed(xendev, node);
>> + xen_fe_frontend_changed(xendev, node);
>> xen_be_check_state(xendev);
>> }
>> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
>> index bb0bc23..2a5f03f 100644
>> --- a/include/hw/xen/xen_frontend.h
>> +++ b/include/hw/xen/xen_frontend.h
>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> uint64_t *uval);
>> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>>
>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>>
>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-04 8:06 ` Paolo Bonzini
` (2 preceding siblings ...)
(?)
@ 2016-10-09 19:50 ` Emil Condrea
2016-10-12 11:00 ` Paolo Bonzini
2016-10-12 11:00 ` [Qemu-devel] " Paolo Bonzini
-1 siblings, 2 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-09 19:50 UTC (permalink / raw)
To: Paolo Bonzini
Cc: qemu-devel, xuquan8, Stefano Stabellini, wei.liu2, stefanb,
xen-devel, Anthony PERARD, Daniel De Graaf
On Tue, Oct 4, 2016 at 11:06 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 04/10/2016 08:43, Emil Condrea wrote:
>> xen_be_frontend_changed -> xen_fe_frontend_changed
>
> This is not correct. The front-end is implemented in the guest domain,
> while the back-end is implemented in the dom0 or stubdom.
>
You are right, thanks for the feedback! I will drop this patch
together with the hunk
from 04/15 patch which moves this function to xen_frontend.c
> This function processes *in the backed* a notification that the frontend
> state changed, hence the name should be xen_be_frontend_changed.
>
> Paolo
>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>> ---
>> hw/xen/xen_backend.c | 2 +-
>> hw/xen/xen_frontend.c | 4 ++--
>> include/hw/xen/xen_frontend.h | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>> index 30d3aaa..b79e83e 100644
>> --- a/hw/xen/xen_backend.c
>> +++ b/hw/xen/xen_backend.c
>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
>> xen_be_set_state(xendev, XenbusStateInitialising);
>>
>> xen_be_backend_changed(xendev, NULL);
>> - xen_be_frontend_changed(xendev, NULL);
>> + xen_fe_frontend_changed(xendev, NULL);
>> return 0;
>> }
>>
>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
>> index 1407f5f..761688b 100644
>> --- a/hw/xen/xen_frontend.c
>> +++ b/hw/xen/xen_frontend.c
>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> return xenstore_read_uint64(xendev->fe, node, uval);
>> }
>>
>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
>> {
>> int fe_state;
>>
>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
>> }
>> node = watch + len + 1;
>>
>> - xen_be_frontend_changed(xendev, node);
>> + xen_fe_frontend_changed(xendev, node);
>> xen_be_check_state(xendev);
>> }
>> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
>> index bb0bc23..2a5f03f 100644
>> --- a/include/hw/xen/xen_frontend.h
>> +++ b/include/hw/xen/xen_frontend.h
>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> uint64_t *uval);
>> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>>
>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>>
>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-04 8:06 ` Paolo Bonzini
(?)
(?)
@ 2016-10-09 19:50 ` Emil Condrea
-1 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-09 19:50 UTC (permalink / raw)
To: Paolo Bonzini
Cc: xuquan8, Stefano Stabellini, wei.liu2, stefanb, qemu-devel,
xen-devel, Anthony PERARD, Daniel De Graaf
On Tue, Oct 4, 2016 at 11:06 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 04/10/2016 08:43, Emil Condrea wrote:
>> xen_be_frontend_changed -> xen_fe_frontend_changed
>
> This is not correct. The front-end is implemented in the guest domain,
> while the back-end is implemented in the dom0 or stubdom.
>
You are right, thanks for the feedback! I will drop this patch
together with the hunk
from 04/15 patch which moves this function to xen_frontend.c
> This function processes *in the backed* a notification that the frontend
> state changed, hence the name should be xen_be_frontend_changed.
>
> Paolo
>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>> ---
>> hw/xen/xen_backend.c | 2 +-
>> hw/xen/xen_frontend.c | 4 ++--
>> include/hw/xen/xen_frontend.h | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>> index 30d3aaa..b79e83e 100644
>> --- a/hw/xen/xen_backend.c
>> +++ b/hw/xen/xen_backend.c
>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
>> xen_be_set_state(xendev, XenbusStateInitialising);
>>
>> xen_be_backend_changed(xendev, NULL);
>> - xen_be_frontend_changed(xendev, NULL);
>> + xen_fe_frontend_changed(xendev, NULL);
>> return 0;
>> }
>>
>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
>> index 1407f5f..761688b 100644
>> --- a/hw/xen/xen_frontend.c
>> +++ b/hw/xen/xen_frontend.c
>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> return xenstore_read_uint64(xendev->fe, node, uval);
>> }
>>
>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
>> {
>> int fe_state;
>>
>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
>> }
>> node = watch + len + 1;
>>
>> - xen_be_frontend_changed(xendev, node);
>> + xen_fe_frontend_changed(xendev, node);
>> xen_be_check_state(xendev);
>> }
>> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
>> index bb0bc23..2a5f03f 100644
>> --- a/include/hw/xen/xen_frontend.h
>> +++ b/include/hw/xen/xen_frontend.h
>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> uint64_t *uval);
>> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>>
>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>>
>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 01/15] xen: Fix coding style errors
2016-10-04 6:43 ` Emil Condrea
(?)
@ 2016-10-11 13:56 ` Anthony PERARD
2016-10-13 3:48 ` Emil Condrea
2016-10-13 3:48 ` Emil Condrea
-1 siblings, 2 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-11 13:56 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:30AM +0300, Emil Condrea wrote:
> Fixes the following errors:
> * ERROR: line over 90 characters
It's 80 ;), and there are a few more left in this patch.
> * ERROR: code indent should never use tabs
> * ERROR: space prohibited after that open square bracket '['
> * ERROR: do not initialise statics to 0 or NULL
> * ERROR: "(foo*)" should be "(foo *)"
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 01/15] xen: Fix coding style errors
2016-10-04 6:43 ` Emil Condrea
(?)
(?)
@ 2016-10-11 13:56 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-11 13:56 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:30AM +0300, Emil Condrea wrote:
> Fixes the following errors:
> * ERROR: line over 90 characters
It's 80 ;), and there are a few more left in this patch.
> * ERROR: code indent should never use tabs
> * ERROR: space prohibited after that open square bracket '['
> * ERROR: do not initialise statics to 0 or NULL
> * ERROR: "(foo*)" should be "(foo *)"
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
@ 2016-10-11 14:20 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-11 14:20 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:31AM +0300, Emil Condrea wrote:
> Fixes:
> * WARNING: line over 80 characters
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
> ---
> hw/block/xen_disk.c | 3 ++-
> hw/char/xen_console.c | 6 ++++--
> hw/display/xenfb.c | 30 ++++++++++++++++++++----------
> hw/net/xen_nic.c | 12 ++++++++----
> hw/xen/xen_backend.c | 15 ++++++++++-----
> include/hw/xen/xen_backend.h | 8 +++++---
> 6 files changed, 49 insertions(+), 25 deletions(-)
>
> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
> index 5aa350a..24edeb2 100644
> --- a/hw/block/xen_disk.c
> +++ b/hw/block/xen_disk.c
> @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
> blk_set_enable_write_cache(blkdev->blk, !writethrough);
> } else {
> /* setup via qemu cmdline -> already setup for us */
> - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
> + xen_be_printf(&blkdev->xendev, 2,
> + "get configured bdrv (cmdline setup)\n");
Arguments are usually aligned with the first one, so there is one
missing space.
> blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo);
> if (blk_is_read_only(blkdev->blk) && !readonly) {
> xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
> diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
> index 4e35c82..399bb5d 100644
> --- a/hw/char/xen_console.c
> +++ b/hw/char/xen_console.c
> @@ -156,7 +156,8 @@ static void xencons_send(struct XenConsole *con)
> if (len < 1) {
> if (!con->backlog) {
> con->backlog = 1;
> - xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
> + xen_be_printf(&con->xendev, 1,
> + "backlog piling up, nobody listening?\n");
same here and other places.
> }
> } else {
> buffer_advance(&con->buffer, len);
> @@ -247,7 +248,8 @@ static int con_initialise(struct XenDevice *xendev)
> }
> }
>
> - xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n",
> + xen_be_printf(xendev, 1,
> + "ring mfn %d, remote port %d, local port %d, limit %zd\n",
> con->ring_ref,
> con->xendev.remote_port,
> con->xendev.local_port,
> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
> index 545ee47..0aca6ae 100644
> --- a/hw/xen/xen_backend.c
> +++ b/hw/xen/xen_backend.c
> @@ -205,7 +206,8 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
> return xenstore_read_int(xendev->fe, node, ival);
> }
>
> -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval)
> +int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
> + uint64_t *uval)
Same here, it would be better to align the second line with the first
parameter.
> {
> return xenstore_read_uint64(xendev->fe, node, uval);
> }
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 02/15] xen: Fix coding style warnings
@ 2016-10-11 14:20 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-11 14:20 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:31AM +0300, Emil Condrea wrote:
> Fixes:
> * WARNING: line over 80 characters
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
> ---
> hw/block/xen_disk.c | 3 ++-
> hw/char/xen_console.c | 6 ++++--
> hw/display/xenfb.c | 30 ++++++++++++++++++++----------
> hw/net/xen_nic.c | 12 ++++++++----
> hw/xen/xen_backend.c | 15 ++++++++++-----
> include/hw/xen/xen_backend.h | 8 +++++---
> 6 files changed, 49 insertions(+), 25 deletions(-)
>
> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
> index 5aa350a..24edeb2 100644
> --- a/hw/block/xen_disk.c
> +++ b/hw/block/xen_disk.c
> @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
> blk_set_enable_write_cache(blkdev->blk, !writethrough);
> } else {
> /* setup via qemu cmdline -> already setup for us */
> - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
> + xen_be_printf(&blkdev->xendev, 2,
> + "get configured bdrv (cmdline setup)\n");
Arguments are usually aligned with the first one, so there is one
missing space.
> blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo);
> if (blk_is_read_only(blkdev->blk) && !readonly) {
> xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
> diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
> index 4e35c82..399bb5d 100644
> --- a/hw/char/xen_console.c
> +++ b/hw/char/xen_console.c
> @@ -156,7 +156,8 @@ static void xencons_send(struct XenConsole *con)
> if (len < 1) {
> if (!con->backlog) {
> con->backlog = 1;
> - xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
> + xen_be_printf(&con->xendev, 1,
> + "backlog piling up, nobody listening?\n");
same here and other places.
> }
> } else {
> buffer_advance(&con->buffer, len);
> @@ -247,7 +248,8 @@ static int con_initialise(struct XenDevice *xendev)
> }
> }
>
> - xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n",
> + xen_be_printf(xendev, 1,
> + "ring mfn %d, remote port %d, local port %d, limit %zd\n",
> con->ring_ref,
> con->xendev.remote_port,
> con->xendev.local_port,
> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
> index 545ee47..0aca6ae 100644
> --- a/hw/xen/xen_backend.c
> +++ b/hw/xen/xen_backend.c
> @@ -205,7 +206,8 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
> return xenstore_read_int(xendev->fe, node, ival);
> }
>
> -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval)
> +int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
> + uint64_t *uval)
Same here, it would be better to align the second line with the first
parameter.
> {
> return xenstore_read_uint64(xendev->fe, node, uval);
> }
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 03/15] xen: Create a new file xen_pvdev.c
2016-10-04 6:43 ` Emil Condrea
@ 2016-10-11 14:38 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-11 14:38 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake, Quan Xu
On Tue, Oct 04, 2016 at 09:43:32AM +0300, Emil Condrea wrote:
> The purpose of the new file is to store generic functions shared by frontend
> and backends such as xenstore operations, xendevs.
>
> Signed-off-by: Quan Xu <quan.xu@intel.com>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Looks good, once the comments on the previous patches are addressed.
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 03/15] xen: Create a new file xen_pvdev.c
@ 2016-10-11 14:38 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-11 14:38 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Quan Xu, dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:32AM +0300, Emil Condrea wrote:
> The purpose of the new file is to store generic functions shared by frontend
> and backends such as xenstore operations, xendevs.
>
> Signed-off-by: Quan Xu <quan.xu@intel.com>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Looks good, once the comments on the previous patches are addressed.
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-09 19:50 ` [Qemu-devel] " Emil Condrea
2016-10-12 11:00 ` Paolo Bonzini
@ 2016-10-12 11:00 ` Paolo Bonzini
2016-10-13 6:08 ` Emil Condrea
1 sibling, 1 reply; 85+ messages in thread
From: Paolo Bonzini @ 2016-10-12 11:00 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, Stefano Stabellini, wei.liu2, stefanb, qemu-devel,
xen-devel, Anthony PERARD, Daniel De Graaf
On 09/10/2016 21:50, Emil Condrea wrote:
> On Tue, Oct 4, 2016 at 11:06 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 04/10/2016 08:43, Emil Condrea wrote:
>>> xen_be_frontend_changed -> xen_fe_frontend_changed
>>
>> This is not correct. The front-end is implemented in the guest domain,
>> while the back-end is implemented in the dom0 or stubdom.
>>
>
> You are right, thanks for the feedback! I will drop this patch
> together with the hunk
> from 04/15 patch which moves this function to xen_frontend.c
Actually all of your new xen_frontend.c seems to be reading frontend
information from XenStore, which is typically something that the backend
does. So I suggest dropping the patch altogether.
Thanks,
Paolo
>> This function processes *in the backed* a notification that the frontend
>> state changed, hence the name should be xen_be_frontend_changed.
>>
>> Paolo
>>
>>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>>> ---
>>> hw/xen/xen_backend.c | 2 +-
>>> hw/xen/xen_frontend.c | 4 ++--
>>> include/hw/xen/xen_frontend.h | 2 +-
>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>>> index 30d3aaa..b79e83e 100644
>>> --- a/hw/xen/xen_backend.c
>>> +++ b/hw/xen/xen_backend.c
>>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
>>> xen_be_set_state(xendev, XenbusStateInitialising);
>>>
>>> xen_be_backend_changed(xendev, NULL);
>>> - xen_be_frontend_changed(xendev, NULL);
>>> + xen_fe_frontend_changed(xendev, NULL);
>>> return 0;
>>> }
>>>
>>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
>>> index 1407f5f..761688b 100644
>>> --- a/hw/xen/xen_frontend.c
>>> +++ b/hw/xen/xen_frontend.c
>>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>>> return xenstore_read_uint64(xendev->fe, node, uval);
>>> }
>>>
>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
>>> {
>>> int fe_state;
>>>
>>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
>>> }
>>> node = watch + len + 1;
>>>
>>> - xen_be_frontend_changed(xendev, node);
>>> + xen_fe_frontend_changed(xendev, node);
>>> xen_be_check_state(xendev);
>>> }
>>> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
>>> index bb0bc23..2a5f03f 100644
>>> --- a/include/hw/xen/xen_frontend.h
>>> +++ b/include/hw/xen/xen_frontend.h
>>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>>> uint64_t *uval);
>>> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>>>
>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>>>
>>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>>
>
>
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-09 19:50 ` [Qemu-devel] " Emil Condrea
@ 2016-10-12 11:00 ` Paolo Bonzini
2016-10-12 11:00 ` [Qemu-devel] " Paolo Bonzini
1 sibling, 0 replies; 85+ messages in thread
From: Paolo Bonzini @ 2016-10-12 11:00 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, Stefano Stabellini, wei.liu2, stefanb, qemu-devel,
xen-devel, Anthony PERARD, Daniel De Graaf
On 09/10/2016 21:50, Emil Condrea wrote:
> On Tue, Oct 4, 2016 at 11:06 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 04/10/2016 08:43, Emil Condrea wrote:
>>> xen_be_frontend_changed -> xen_fe_frontend_changed
>>
>> This is not correct. The front-end is implemented in the guest domain,
>> while the back-end is implemented in the dom0 or stubdom.
>>
>
> You are right, thanks for the feedback! I will drop this patch
> together with the hunk
> from 04/15 patch which moves this function to xen_frontend.c
Actually all of your new xen_frontend.c seems to be reading frontend
information from XenStore, which is typically something that the backend
does. So I suggest dropping the patch altogether.
Thanks,
Paolo
>> This function processes *in the backed* a notification that the frontend
>> state changed, hence the name should be xen_be_frontend_changed.
>>
>> Paolo
>>
>>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>>> ---
>>> hw/xen/xen_backend.c | 2 +-
>>> hw/xen/xen_frontend.c | 4 ++--
>>> include/hw/xen/xen_frontend.h | 2 +-
>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>>> index 30d3aaa..b79e83e 100644
>>> --- a/hw/xen/xen_backend.c
>>> +++ b/hw/xen/xen_backend.c
>>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
>>> xen_be_set_state(xendev, XenbusStateInitialising);
>>>
>>> xen_be_backend_changed(xendev, NULL);
>>> - xen_be_frontend_changed(xendev, NULL);
>>> + xen_fe_frontend_changed(xendev, NULL);
>>> return 0;
>>> }
>>>
>>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
>>> index 1407f5f..761688b 100644
>>> --- a/hw/xen/xen_frontend.c
>>> +++ b/hw/xen/xen_frontend.c
>>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>>> return xenstore_read_uint64(xendev->fe, node, uval);
>>> }
>>>
>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
>>> {
>>> int fe_state;
>>>
>>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
>>> }
>>> node = watch + len + 1;
>>>
>>> - xen_be_frontend_changed(xendev, node);
>>> + xen_fe_frontend_changed(xendev, node);
>>> xen_be_check_state(xendev);
>>> }
>>> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
>>> index bb0bc23..2a5f03f 100644
>>> --- a/include/hw/xen/xen_frontend.h
>>> +++ b/include/hw/xen/xen_frontend.h
>>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>>> uint64_t *uval);
>>> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>>>
>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>>>
>>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>>
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 04/15] xen: Create a new file xen_frontend.c
2016-10-04 6:43 ` Emil Condrea
(?)
(?)
@ 2016-10-12 13:30 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:30 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake, Quan Xu
On Tue, Oct 04, 2016 at 09:43:33AM +0300, Emil Condrea wrote:
> Its purpose is to store frontend related functions.
>
> Signed-off-by: Quan Xu <quan.xu@intel.com>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Looks good, once the comments on the previous patches are addressed,
same comments for patch 5, 6 and 7.
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 04/15] xen: Create a new file xen_frontend.c
2016-10-04 6:43 ` Emil Condrea
(?)
@ 2016-10-12 13:30 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:30 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Quan Xu, dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:33AM +0300, Emil Condrea wrote:
> Its purpose is to store frontend related functions.
>
> Signed-off-by: Quan Xu <quan.xu@intel.com>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Looks good, once the comments on the previous patches are addressed,
same comments for patch 5, 6 and 7.
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 08/15] xen: Move xenstore cleanup and mkdir functions
2016-10-04 6:43 ` Emil Condrea
@ 2016-10-12 13:30 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:30 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:37AM +0300, Emil Condrea wrote:
> The name of the functions moved to xen_pvdev.c:
> * xenstore_cleanup_dir
> * xen_config_cleanup
> * xenstore_mkdir
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 08/15] xen: Move xenstore cleanup and mkdir functions
@ 2016-10-12 13:30 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:30 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:37AM +0300, Emil Condrea wrote:
> The name of the functions moved to xen_pvdev.c:
> * xenstore_cleanup_dir
> * xen_config_cleanup
> * xenstore_mkdir
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 09/15] xen: Rename xen_be_printf to xen_pv_printf
2016-10-04 6:43 ` Emil Condrea
(?)
@ 2016-10-12 13:31 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:31 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:38AM +0300, Emil Condrea wrote:
> Prepare xen_be_printf to be used by both backend and frontends:
> * xen_be_printf -> xen_pv_printf
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 09/15] xen: Rename xen_be_printf to xen_pv_printf
2016-10-04 6:43 ` Emil Condrea
(?)
(?)
@ 2016-10-12 13:31 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:31 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:38AM +0300, Emil Condrea wrote:
> Prepare xen_be_printf to be used by both backend and frontends:
> * xen_be_printf -> xen_pv_printf
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 10/15] xen: Rename xen_be_unbind_evtchn
2016-10-04 6:43 ` Emil Condrea
(?)
(?)
@ 2016-10-12 13:37 ` Anthony PERARD
2016-10-13 1:44 ` Xuquan (Quan Xu)
2016-10-13 1:44 ` Xuquan (Quan Xu)
-1 siblings, 2 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:37 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:39AM +0300, Emil Condrea wrote:
> Prepare xen_be_unbind_evtchn to be shared with frontends:
> * xen_be_unbind_evtchn -> xen_pv_unbind_evtchn
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 10/15] xen: Rename xen_be_unbind_evtchn
2016-10-04 6:43 ` Emil Condrea
(?)
@ 2016-10-12 13:37 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:37 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:39AM +0300, Emil Condrea wrote:
> Prepare xen_be_unbind_evtchn to be shared with frontends:
> * xen_be_unbind_evtchn -> xen_pv_unbind_evtchn
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 11/15] xen: Rename xen_be_send_notify
2016-10-04 6:43 ` Emil Condrea
(?)
(?)
@ 2016-10-12 13:40 ` Anthony PERARD
2016-10-13 1:45 ` Xuquan (Quan Xu)
2016-10-13 1:45 ` Xuquan (Quan Xu)
-1 siblings, 2 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:40 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:40AM +0300, Emil Condrea wrote:
> Prepare xen_be_send_notify to be shared with frontends:
> * xen_be_send_notify -> xen_pv_send_notify
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 11/15] xen: Rename xen_be_send_notify
2016-10-04 6:43 ` Emil Condrea
(?)
@ 2016-10-12 13:40 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:40 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:40AM +0300, Emil Condrea wrote:
> Prepare xen_be_send_notify to be shared with frontends:
> * xen_be_send_notify -> xen_pv_send_notify
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 12/15] xen: Rename xen_be_evtchn_event
2016-10-04 6:43 ` Emil Condrea
@ 2016-10-12 13:41 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:41 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:41AM +0300, Emil Condrea wrote:
> Prepare xen_be_evtchn_event to be shared with frontends:
> * xen_be_evtchn_event -> xen_pv_evtchn_event
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 12/15] xen: Rename xen_be_evtchn_event
@ 2016-10-12 13:41 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:41 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:41AM +0300, Emil Condrea wrote:
> Prepare xen_be_evtchn_event to be shared with frontends:
> * xen_be_evtchn_event -> xen_pv_evtchn_event
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 13/15] xen: Rename xen_be_find_xendev
2016-10-04 6:43 ` Emil Condrea
@ 2016-10-12 13:42 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:42 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:42AM +0300, Emil Condrea wrote:
> Prepare xen_be_find_xendev to be shared with frontends:
> * xen_be_find_xendev -> xen_pv_find_xendev
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 13/15] xen: Rename xen_be_find_xendev
@ 2016-10-12 13:42 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:42 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:42AM +0300, Emil Condrea wrote:
> Prepare xen_be_find_xendev to be shared with frontends:
> * xen_be_find_xendev -> xen_pv_find_xendev
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 14/15] xen: Rename xen_be_del_xendev
2016-10-04 6:43 ` Emil Condrea
@ 2016-10-12 13:46 ` Anthony PERARD
-1 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:46 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, xuquan8, wei.liu2, stefanb, sstabellini, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:43AM +0300, Emil Condrea wrote:
> Prepare xen_be_del_xendev to be shared with frontends:
> * xen_be_del_xendev -> xen_pv_del_xendev
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 14/15] xen: Rename xen_be_del_xendev
@ 2016-10-12 13:46 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-12 13:46 UTC (permalink / raw)
To: Emil Condrea
Cc: xuquan8, sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
dgdegra, eblake
On Tue, Oct 04, 2016 at 09:43:43AM +0300, Emil Condrea wrote:
> Prepare xen_be_del_xendev to be shared with frontends:
> * xen_be_del_xendev -> xen_pv_del_xendev
>
> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 10/15] xen: Rename xen_be_unbind_evtchn
2016-10-12 13:37 ` [Qemu-devel] " Anthony PERARD
@ 2016-10-13 1:44 ` Xuquan (Quan Xu)
2016-10-13 1:44 ` Xuquan (Quan Xu)
1 sibling, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:44 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: qemu-devel, wei.liu2, stefanb, sstabellini, xen-devel, dgdegra, eblake
On October 12, 2016 9:37 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:39AM +0300, Emil Condrea wrote:
>> Prepare xen_be_unbind_evtchn to be shared with frontends:
>> * xen_be_unbind_evtchn -> xen_pv_unbind_evtchn
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 10/15] xen: Rename xen_be_unbind_evtchn
2016-10-12 13:37 ` [Qemu-devel] " Anthony PERARD
2016-10-13 1:44 ` Xuquan (Quan Xu)
@ 2016-10-13 1:44 ` Xuquan (Quan Xu)
1 sibling, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:44 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel, dgdegra, eblake
On October 12, 2016 9:37 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:39AM +0300, Emil Condrea wrote:
>> Prepare xen_be_unbind_evtchn to be shared with frontends:
>> * xen_be_unbind_evtchn -> xen_pv_unbind_evtchn
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 11/15] xen: Rename xen_be_send_notify
2016-10-12 13:40 ` [Qemu-devel] " Anthony PERARD
@ 2016-10-13 1:45 ` Xuquan (Quan Xu)
2016-10-13 1:45 ` Xuquan (Quan Xu)
1 sibling, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:45 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: qemu-devel, wei.liu2, stefanb, sstabellini, xen-devel, dgdegra, eblake
On October 12, 2016 9:41 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:40AM +0300, Emil Condrea wrote:
>> Prepare xen_be_send_notify to be shared with frontends:
>> * xen_be_send_notify -> xen_pv_send_notify
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 11/15] xen: Rename xen_be_send_notify
2016-10-12 13:40 ` [Qemu-devel] " Anthony PERARD
2016-10-13 1:45 ` Xuquan (Quan Xu)
@ 2016-10-13 1:45 ` Xuquan (Quan Xu)
1 sibling, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:45 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel, dgdegra, eblake
On October 12, 2016 9:41 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:40AM +0300, Emil Condrea wrote:
>> Prepare xen_be_send_notify to be shared with frontends:
>> * xen_be_send_notify -> xen_pv_send_notify
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 12/15] xen: Rename xen_be_evtchn_event
2016-10-12 13:41 ` Anthony PERARD
(?)
@ 2016-10-13 1:46 ` Xuquan (Quan Xu)
-1 siblings, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:46 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: qemu-devel, wei.liu2, stefanb, sstabellini, xen-devel, dgdegra, eblake
On October 12, 2016 9:41 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:41AM +0300, Emil Condrea wrote:
>> Prepare xen_be_evtchn_event to be shared with frontends:
>> * xen_be_evtchn_event -> xen_pv_evtchn_event
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 12/15] xen: Rename xen_be_evtchn_event
2016-10-12 13:41 ` Anthony PERARD
(?)
(?)
@ 2016-10-13 1:46 ` Xuquan (Quan Xu)
-1 siblings, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:46 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel, dgdegra, eblake
On October 12, 2016 9:41 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:41AM +0300, Emil Condrea wrote:
>> Prepare xen_be_evtchn_event to be shared with frontends:
>> * xen_be_evtchn_event -> xen_pv_evtchn_event
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 13/15] xen: Rename xen_be_find_xendev
2016-10-12 13:42 ` Anthony PERARD
@ 2016-10-13 1:46 ` Xuquan (Quan Xu)
-1 siblings, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:46 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: qemu-devel, wei.liu2, stefanb, sstabellini, xen-devel, dgdegra, eblake
On October 12, 2016 9:42 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:42AM +0300, Emil Condrea wrote:
>> Prepare xen_be_find_xendev to be shared with frontends:
>> * xen_be_find_xendev -> xen_pv_find_xendev
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 13/15] xen: Rename xen_be_find_xendev
@ 2016-10-13 1:46 ` Xuquan (Quan Xu)
0 siblings, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:46 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel, dgdegra, eblake
On October 12, 2016 9:42 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:42AM +0300, Emil Condrea wrote:
>> Prepare xen_be_find_xendev to be shared with frontends:
>> * xen_be_find_xendev -> xen_pv_find_xendev
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 14/15] xen: Rename xen_be_del_xendev
2016-10-12 13:46 ` Anthony PERARD
@ 2016-10-13 1:47 ` Xuquan (Quan Xu)
-1 siblings, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:47 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: qemu-devel, wei.liu2, stefanb, sstabellini, xen-devel, dgdegra, eblake
On October 12, 2016 9:46 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:43AM +0300, Emil Condrea wrote:
>> Prepare xen_be_del_xendev to be shared with frontends:
>> * xen_be_del_xendev -> xen_pv_del_xendev
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 14/15] xen: Rename xen_be_del_xendev
@ 2016-10-13 1:47 ` Xuquan (Quan Xu)
0 siblings, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 1:47 UTC (permalink / raw)
To: Anthony PERARD, Emil Condrea
Cc: sstabellini, wei.liu2, stefanb, qemu-devel, xen-devel, dgdegra, eblake
On October 12, 2016 9:46 PM, Anthony PERARD < anthony.perard@citrix.com > wrote:
>On Tue, Oct 04, 2016 at 09:43:43AM +0300, Emil Condrea wrote:
>> Prepare xen_be_del_xendev to be shared with frontends:
>> * xen_be_del_xendev -> xen_pv_del_xendev
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
>Acked-by: Anthony PERARD <anthony.perard@citrix.com>
>
Reviewed-by: Quan Xu <xuquan8@huawei.com>
Quan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 01/15] xen: Fix coding style errors
2016-10-11 13:56 ` [Qemu-devel] " Anthony PERARD
@ 2016-10-13 3:48 ` Emil Condrea
2016-10-13 3:48 ` Emil Condrea
1 sibling, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-13 3:48 UTC (permalink / raw)
To: Anthony PERARD
Cc: qemu-devel, Xuquan (Quan Xu),
wei.liu2, stefanb, Stefano Stabellini, xen-devel,
Daniel De Graaf, Eric Blake
Actually I've split fixing coding style in 2 patches: one for errors and
one for warnings. In this patch some resolve the error
"code indent should never use tabs" but if on the same line there is a
warning about line exceeding 80 characters, it will be fixed in
"Fix coding style warnings" patch.
On Tue, Oct 11, 2016 at 4:56 PM, Anthony PERARD
<anthony.perard@citrix.com> wrote:
> On Tue, Oct 04, 2016 at 09:43:30AM +0300, Emil Condrea wrote:
>> Fixes the following errors:
>> * ERROR: line over 90 characters
>
> It's 80 ;), and there are a few more left in this patch.
>
>> * ERROR: code indent should never use tabs
>> * ERROR: space prohibited after that open square bracket '['
>> * ERROR: do not initialise statics to 0 or NULL
>> * ERROR: "(foo*)" should be "(foo *)"
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
> --
> Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 01/15] xen: Fix coding style errors
2016-10-11 13:56 ` [Qemu-devel] " Anthony PERARD
2016-10-13 3:48 ` Emil Condrea
@ 2016-10-13 3:48 ` Emil Condrea
1 sibling, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-13 3:48 UTC (permalink / raw)
To: Anthony PERARD
Cc: Xuquan (Quan Xu),
Stefano Stabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Daniel De Graaf, Eric Blake
Actually I've split fixing coding style in 2 patches: one for errors and
one for warnings. In this patch some resolve the error
"code indent should never use tabs" but if on the same line there is a
warning about line exceeding 80 characters, it will be fixed in
"Fix coding style warnings" patch.
On Tue, Oct 11, 2016 at 4:56 PM, Anthony PERARD
<anthony.perard@citrix.com> wrote:
> On Tue, Oct 04, 2016 at 09:43:30AM +0300, Emil Condrea wrote:
>> Fixes the following errors:
>> * ERROR: line over 90 characters
>
> It's 80 ;), and there are a few more left in this patch.
>
>> * ERROR: code indent should never use tabs
>> * ERROR: space prohibited after that open square bracket '['
>> * ERROR: do not initialise statics to 0 or NULL
>> * ERROR: "(foo*)" should be "(foo *)"
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>
> --
> Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings
2016-10-11 14:20 ` Anthony PERARD
(?)
(?)
@ 2016-10-13 4:04 ` Emil Condrea
2016-10-13 11:35 ` Anthony PERARD
-1 siblings, 1 reply; 85+ messages in thread
From: Emil Condrea @ 2016-10-13 4:04 UTC (permalink / raw)
To: Anthony PERARD
Cc: qemu-devel, Xuquan (Quan Xu),
wei.liu2, stefanb, Stefano Stabellini, xen-devel,
Daniel De Graaf, Eric Blake
On Tue, Oct 11, 2016 at 5:20 PM, Anthony PERARD
<anthony.perard@citrix.com> wrote:
> On Tue, Oct 04, 2016 at 09:43:31AM +0300, Emil Condrea wrote:
>> Fixes:
>> * WARNING: line over 80 characters
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>> ---
>> hw/block/xen_disk.c | 3 ++-
>> hw/char/xen_console.c | 6 ++++--
>> hw/display/xenfb.c | 30 ++++++++++++++++++++----------
>> hw/net/xen_nic.c | 12 ++++++++----
>> hw/xen/xen_backend.c | 15 ++++++++++-----
>> include/hw/xen/xen_backend.h | 8 +++++---
>> 6 files changed, 49 insertions(+), 25 deletions(-)
>>
>> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
>> index 5aa350a..24edeb2 100644
>> --- a/hw/block/xen_disk.c
>> +++ b/hw/block/xen_disk.c
>> @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
>> blk_set_enable_write_cache(blkdev->blk, !writethrough);
>> } else {
>> /* setup via qemu cmdline -> already setup for us */
>> - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
>> + xen_be_printf(&blkdev->xendev, 2,
>> + "get configured bdrv (cmdline setup)\n");
>
> Arguments are usually aligned with the first one, so there is one
> missing space.
I guess this is displayed wrongly in the email client as in mine but the source
of the email contains this patch http://pastebin.com/Sbk23h6m, which shows that
this line is aligned to the first parameter.
>
>> blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo);
>> if (blk_is_read_only(blkdev->blk) && !readonly) {
>> xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
>> diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
>> index 4e35c82..399bb5d 100644
>> --- a/hw/char/xen_console.c
>> +++ b/hw/char/xen_console.c
>> @@ -156,7 +156,8 @@ static void xencons_send(struct XenConsole *con)
>> if (len < 1) {
>> if (!con->backlog) {
>> con->backlog = 1;
>> - xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
>> + xen_be_printf(&con->xendev, 1,
>> + "backlog piling up, nobody listening?\n");
>
> same here and other places.
same as above
>
>> }
>> } else {
>> buffer_advance(&con->buffer, len);
>> @@ -247,7 +248,8 @@ static int con_initialise(struct XenDevice *xendev)
>> }
>> }
>>
>> - xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n",
>> + xen_be_printf(xendev, 1,
>> + "ring mfn %d, remote port %d, local port %d, limit %zd\n",
>> con->ring_ref,
>> con->xendev.remote_port,
>> con->xendev.local_port,
>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>> index 545ee47..0aca6ae 100644
>> --- a/hw/xen/xen_backend.c
>> +++ b/hw/xen/xen_backend.c
>> @@ -205,7 +206,8 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
>> return xenstore_read_int(xendev->fe, node, ival);
>> }
>>
>> -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval)
>> +int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> + uint64_t *uval)
>
> Same here, it would be better to align the second line with the first
> parameter.
This indeed should be fixed. I will send a new patch for it.
>
>> {
>> return xenstore_read_uint64(xendev->fe, node, uval);
>> }
>
> --
> Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 02/15] xen: Fix coding style warnings
2016-10-11 14:20 ` Anthony PERARD
(?)
@ 2016-10-13 4:04 ` Emil Condrea
-1 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-13 4:04 UTC (permalink / raw)
To: Anthony PERARD
Cc: Xuquan (Quan Xu),
Stefano Stabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Daniel De Graaf, Eric Blake
On Tue, Oct 11, 2016 at 5:20 PM, Anthony PERARD
<anthony.perard@citrix.com> wrote:
> On Tue, Oct 04, 2016 at 09:43:31AM +0300, Emil Condrea wrote:
>> Fixes:
>> * WARNING: line over 80 characters
>>
>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>> ---
>> hw/block/xen_disk.c | 3 ++-
>> hw/char/xen_console.c | 6 ++++--
>> hw/display/xenfb.c | 30 ++++++++++++++++++++----------
>> hw/net/xen_nic.c | 12 ++++++++----
>> hw/xen/xen_backend.c | 15 ++++++++++-----
>> include/hw/xen/xen_backend.h | 8 +++++---
>> 6 files changed, 49 insertions(+), 25 deletions(-)
>>
>> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
>> index 5aa350a..24edeb2 100644
>> --- a/hw/block/xen_disk.c
>> +++ b/hw/block/xen_disk.c
>> @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
>> blk_set_enable_write_cache(blkdev->blk, !writethrough);
>> } else {
>> /* setup via qemu cmdline -> already setup for us */
>> - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
>> + xen_be_printf(&blkdev->xendev, 2,
>> + "get configured bdrv (cmdline setup)\n");
>
> Arguments are usually aligned with the first one, so there is one
> missing space.
I guess this is displayed wrongly in the email client as in mine but the source
of the email contains this patch http://pastebin.com/Sbk23h6m, which shows that
this line is aligned to the first parameter.
>
>> blkdev->blk = blk_by_legacy_dinfo(blkdev->dinfo);
>> if (blk_is_read_only(blkdev->blk) && !readonly) {
>> xen_be_printf(&blkdev->xendev, 0, "Unexpected read-only drive");
>> diff --git a/hw/char/xen_console.c b/hw/char/xen_console.c
>> index 4e35c82..399bb5d 100644
>> --- a/hw/char/xen_console.c
>> +++ b/hw/char/xen_console.c
>> @@ -156,7 +156,8 @@ static void xencons_send(struct XenConsole *con)
>> if (len < 1) {
>> if (!con->backlog) {
>> con->backlog = 1;
>> - xen_be_printf(&con->xendev, 1, "backlog piling up, nobody listening?\n");
>> + xen_be_printf(&con->xendev, 1,
>> + "backlog piling up, nobody listening?\n");
>
> same here and other places.
same as above
>
>> }
>> } else {
>> buffer_advance(&con->buffer, len);
>> @@ -247,7 +248,8 @@ static int con_initialise(struct XenDevice *xendev)
>> }
>> }
>>
>> - xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n",
>> + xen_be_printf(xendev, 1,
>> + "ring mfn %d, remote port %d, local port %d, limit %zd\n",
>> con->ring_ref,
>> con->xendev.remote_port,
>> con->xendev.local_port,
>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>> index 545ee47..0aca6ae 100644
>> --- a/hw/xen/xen_backend.c
>> +++ b/hw/xen/xen_backend.c
>> @@ -205,7 +206,8 @@ int xenstore_read_fe_int(struct XenDevice *xendev, const char *node, int *ival)
>> return xenstore_read_int(xendev->fe, node, ival);
>> }
>>
>> -int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node, uint64_t *uval)
>> +int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>> + uint64_t *uval)
>
> Same here, it would be better to align the second line with the first
> parameter.
This indeed should be fixed. I will send a new patch for it.
>
>> {
>> return xenstore_read_uint64(xendev->fe, node, uval);
>> }
>
> --
> Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-12 11:00 ` [Qemu-devel] " Paolo Bonzini
@ 2016-10-13 6:08 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-13 6:08 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Xuquan (Quan Xu),
Stefano Stabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Anthony PERARD, Daniel De Graaf
As you suggested, I've dropped the all patches for xen_frontend.
Emil
On Wed, Oct 12, 2016 at 2:00 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 09/10/2016 21:50, Emil Condrea wrote:
>> On Tue, Oct 4, 2016 at 11:06 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>
>>>
>>> On 04/10/2016 08:43, Emil Condrea wrote:
>>>> xen_be_frontend_changed -> xen_fe_frontend_changed
>>>
>>> This is not correct. The front-end is implemented in the guest domain,
>>> while the back-end is implemented in the dom0 or stubdom.
>>>
>>
>> You are right, thanks for the feedback! I will drop this patch
>> together with the hunk
>> from 04/15 patch which moves this function to xen_frontend.c
>
> Actually all of your new xen_frontend.c seems to be reading frontend
> information from XenStore, which is typically something that the backend
> does. So I suggest dropping the patch altogether.
>
> Thanks,
>
> Paolo
>
>>> This function processes *in the backed* a notification that the frontend
>>> state changed, hence the name should be xen_be_frontend_changed.
>>>
>>> Paolo
>>>
>>>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>>>> ---
>>>> hw/xen/xen_backend.c | 2 +-
>>>> hw/xen/xen_frontend.c | 4 ++--
>>>> include/hw/xen/xen_frontend.h | 2 +-
>>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>>>> index 30d3aaa..b79e83e 100644
>>>> --- a/hw/xen/xen_backend.c
>>>> +++ b/hw/xen/xen_backend.c
>>>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
>>>> xen_be_set_state(xendev, XenbusStateInitialising);
>>>>
>>>> xen_be_backend_changed(xendev, NULL);
>>>> - xen_be_frontend_changed(xendev, NULL);
>>>> + xen_fe_frontend_changed(xendev, NULL);
>>>> return 0;
>>>> }
>>>>
>>>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
>>>> index 1407f5f..761688b 100644
>>>> --- a/hw/xen/xen_frontend.c
>>>> +++ b/hw/xen/xen_frontend.c
>>>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>>>> return xenstore_read_uint64(xendev->fe, node, uval);
>>>> }
>>>>
>>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
>>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
>>>> {
>>>> int fe_state;
>>>>
>>>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
>>>> }
>>>> node = watch + len + 1;
>>>>
>>>> - xen_be_frontend_changed(xendev, node);
>>>> + xen_fe_frontend_changed(xendev, node);
>>>> xen_be_check_state(xendev);
>>>> }
>>>> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
>>>> index bb0bc23..2a5f03f 100644
>>>> --- a/include/hw/xen/xen_frontend.h
>>>> +++ b/include/hw/xen/xen_frontend.h
>>>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>>>> uint64_t *uval);
>>>> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>>>>
>>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
>>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>>>>
>>>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>>>
>>
>>
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 15/15] xen: Rename xen_be_frontend_changed
@ 2016-10-13 6:08 ` Emil Condrea
0 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-13 6:08 UTC (permalink / raw)
To: Paolo Bonzini
Cc: Xuquan (Quan Xu),
Stefano Stabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Anthony PERARD, Daniel De Graaf
As you suggested, I've dropped the all patches for xen_frontend.
Emil
On Wed, Oct 12, 2016 at 2:00 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 09/10/2016 21:50, Emil Condrea wrote:
>> On Tue, Oct 4, 2016 at 11:06 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>
>>>
>>> On 04/10/2016 08:43, Emil Condrea wrote:
>>>> xen_be_frontend_changed -> xen_fe_frontend_changed
>>>
>>> This is not correct. The front-end is implemented in the guest domain,
>>> while the back-end is implemented in the dom0 or stubdom.
>>>
>>
>> You are right, thanks for the feedback! I will drop this patch
>> together with the hunk
>> from 04/15 patch which moves this function to xen_frontend.c
>
> Actually all of your new xen_frontend.c seems to be reading frontend
> information from XenStore, which is typically something that the backend
> does. So I suggest dropping the patch altogether.
>
> Thanks,
>
> Paolo
>
>>> This function processes *in the backed* a notification that the frontend
>>> state changed, hence the name should be xen_be_frontend_changed.
>>>
>>> Paolo
>>>
>>>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>>>> ---
>>>> hw/xen/xen_backend.c | 2 +-
>>>> hw/xen/xen_frontend.c | 4 ++--
>>>> include/hw/xen/xen_frontend.h | 2 +-
>>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
>>>> index 30d3aaa..b79e83e 100644
>>>> --- a/hw/xen/xen_backend.c
>>>> +++ b/hw/xen/xen_backend.c
>>>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice *xendev)
>>>> xen_be_set_state(xendev, XenbusStateInitialising);
>>>>
>>>> xen_be_backend_changed(xendev, NULL);
>>>> - xen_be_frontend_changed(xendev, NULL);
>>>> + xen_fe_frontend_changed(xendev, NULL);
>>>> return 0;
>>>> }
>>>>
>>>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c
>>>> index 1407f5f..761688b 100644
>>>> --- a/hw/xen/xen_frontend.c
>>>> +++ b/hw/xen/xen_frontend.c
>>>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>>>> return xenstore_read_uint64(xendev->fe, node, uval);
>>>> }
>>>>
>>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node)
>>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node)
>>>> {
>>>> int fe_state;
>>>>
>>>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct XenDevice *xendev)
>>>> }
>>>> node = watch + len + 1;
>>>>
>>>> - xen_be_frontend_changed(xendev, node);
>>>> + xen_fe_frontend_changed(xendev, node);
>>>> xen_be_check_state(xendev);
>>>> }
>>>> diff --git a/include/hw/xen/xen_frontend.h b/include/hw/xen/xen_frontend.h
>>>> index bb0bc23..2a5f03f 100644
>>>> --- a/include/hw/xen/xen_frontend.h
>>>> +++ b/include/hw/xen/xen_frontend.h
>>>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev, const char *node,
>>>> uint64_t *uval);
>>>> void xenstore_update_fe(char *watch, struct XenDevice *xendev);
>>>>
>>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char *node);
>>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char *node);
>>>>
>>>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>>>
>>
>>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-13 6:08 ` Emil Condrea
@ 2016-10-13 6:32 ` Xuquan (Quan Xu)
-1 siblings, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 6:32 UTC (permalink / raw)
To: Emil Condrea, Paolo Bonzini, Stefano Stabellini
Cc: wei.liu2, stefanb, qemu-devel, xen-devel, Anthony PERARD,
Daniel De Graaf
On October 13, 2016 2:09 PM, Emil Condrea <emilcondrea@gmail.com> wrote:
>As you suggested, I've dropped the all patches for xen_frontend.
>
>Emil
>
>On Wed, Oct 12, 2016 at 2:00 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 09/10/2016 21:50, Emil Condrea wrote:
>>> On Tue, Oct 4, 2016 at 11:06 AM, Paolo Bonzini <pbonzini@redhat.com>
>wrote:
>>>>
>>>>
>>>> On 04/10/2016 08:43, Emil Condrea wrote:
>>>>> xen_be_frontend_changed -> xen_fe_frontend_changed
>>>>
>>>> This is not correct. The front-end is implemented in the guest
>>>> domain, while the back-end is implemented in the dom0 or stubdom.
>>>>
>>>
Hi Paolo,
Yes, the front-end is almost implemented in the guest
This case (as mentioned in 00/15) is very particular. The frontend is actually implemented in QEMU, and the guest still run native driver tpm_tis.ko..
>>> You are right, thanks for the feedback! I will drop this patch
>>> together with the hunk from 04/15 patch which moves this function to
>>> xen_frontend.c
>>
>> Actually all of your new xen_frontend.c seems to be reading frontend
>> information from XenStore, which is typically something that the
>> backend does. So I suggest dropping the patch altogether.
>>
So we are better leave it as is. Maybe we need to rename some functions in that file.
__iirc__ adding xen_frontend.c is one of Stefano's comments in previous v6 or v7..
Quan
>> Thanks,
>>
>> Paolo
>>
>>>> This function processes *in the backed* a notification that the
>>>> frontend state changed, hence the name should be
>xen_be_frontend_changed.
>>>>
>>>> Paolo
>>>>
>>>>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>>>>> ---
>>>>> hw/xen/xen_backend.c | 2 +-
>>>>> hw/xen/xen_frontend.c | 4 ++--
>>>>> include/hw/xen/xen_frontend.h | 2 +-
>>>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index
>>>>> 30d3aaa..b79e83e 100644
>>>>> --- a/hw/xen/xen_backend.c
>>>>> +++ b/hw/xen/xen_backend.c
>>>>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice
>*xendev)
>>>>> xen_be_set_state(xendev, XenbusStateInitialising);
>>>>>
>>>>> xen_be_backend_changed(xendev, NULL);
>>>>> - xen_be_frontend_changed(xendev, NULL);
>>>>> + xen_fe_frontend_changed(xendev, NULL);
>>>>> return 0;
>>>>> }
>>>>>
>>>>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c index
>>>>> 1407f5f..761688b 100644
>>>>> --- a/hw/xen/xen_frontend.c
>>>>> +++ b/hw/xen/xen_frontend.c
>>>>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice
>*xendev, const char *node,
>>>>> return xenstore_read_uint64(xendev->fe, node, uval); }
>>>>>
>>>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char
>>>>> *node)
>>>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char
>>>>> +*node)
>>>>> {
>>>>> int fe_state;
>>>>>
>>>>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct
>XenDevice *xendev)
>>>>> }
>>>>> node = watch + len + 1;
>>>>>
>>>>> - xen_be_frontend_changed(xendev, node);
>>>>> + xen_fe_frontend_changed(xendev, node);
>>>>> xen_be_check_state(xendev);
>>>>> }
>>>>> diff --git a/include/hw/xen/xen_frontend.h
>>>>> b/include/hw/xen/xen_frontend.h index bb0bc23..2a5f03f 100644
>>>>> --- a/include/hw/xen/xen_frontend.h
>>>>> +++ b/include/hw/xen/xen_frontend.h
>>>>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev,
>const char *node,
>>>>>
>uint64_t
>>>>> *uval); void xenstore_update_fe(char *watch, struct XenDevice
>>>>> *xendev);
>>>>>
>>>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char
>>>>> *node);
>>>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char
>>>>> +*node);
>>>>>
>>>>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>>>>
>>>
>>>
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 15/15] xen: Rename xen_be_frontend_changed
@ 2016-10-13 6:32 ` Xuquan (Quan Xu)
0 siblings, 0 replies; 85+ messages in thread
From: Xuquan (Quan Xu) @ 2016-10-13 6:32 UTC (permalink / raw)
To: Emil Condrea, Paolo Bonzini, Stefano Stabellini
Cc: wei.liu2, stefanb, qemu-devel, xen-devel, Anthony PERARD,
Daniel De Graaf
On October 13, 2016 2:09 PM, Emil Condrea <emilcondrea@gmail.com> wrote:
>As you suggested, I've dropped the all patches for xen_frontend.
>
>Emil
>
>On Wed, Oct 12, 2016 at 2:00 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>> On 09/10/2016 21:50, Emil Condrea wrote:
>>> On Tue, Oct 4, 2016 at 11:06 AM, Paolo Bonzini <pbonzini@redhat.com>
>wrote:
>>>>
>>>>
>>>> On 04/10/2016 08:43, Emil Condrea wrote:
>>>>> xen_be_frontend_changed -> xen_fe_frontend_changed
>>>>
>>>> This is not correct. The front-end is implemented in the guest
>>>> domain, while the back-end is implemented in the dom0 or stubdom.
>>>>
>>>
Hi Paolo,
Yes, the front-end is almost implemented in the guest
This case (as mentioned in 00/15) is very particular. The frontend is actually implemented in QEMU, and the guest still run native driver tpm_tis.ko..
>>> You are right, thanks for the feedback! I will drop this patch
>>> together with the hunk from 04/15 patch which moves this function to
>>> xen_frontend.c
>>
>> Actually all of your new xen_frontend.c seems to be reading frontend
>> information from XenStore, which is typically something that the
>> backend does. So I suggest dropping the patch altogether.
>>
So we are better leave it as is. Maybe we need to rename some functions in that file.
__iirc__ adding xen_frontend.c is one of Stefano's comments in previous v6 or v7..
Quan
>> Thanks,
>>
>> Paolo
>>
>>>> This function processes *in the backed* a notification that the
>>>> frontend state changed, hence the name should be
>xen_be_frontend_changed.
>>>>
>>>> Paolo
>>>>
>>>>> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>>>>> ---
>>>>> hw/xen/xen_backend.c | 2 +-
>>>>> hw/xen/xen_frontend.c | 4 ++--
>>>>> include/hw/xen/xen_frontend.h | 2 +-
>>>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index
>>>>> 30d3aaa..b79e83e 100644
>>>>> --- a/hw/xen/xen_backend.c
>>>>> +++ b/hw/xen/xen_backend.c
>>>>> @@ -213,7 +213,7 @@ static int xen_be_try_setup(struct XenDevice
>*xendev)
>>>>> xen_be_set_state(xendev, XenbusStateInitialising);
>>>>>
>>>>> xen_be_backend_changed(xendev, NULL);
>>>>> - xen_be_frontend_changed(xendev, NULL);
>>>>> + xen_fe_frontend_changed(xendev, NULL);
>>>>> return 0;
>>>>> }
>>>>>
>>>>> diff --git a/hw/xen/xen_frontend.c b/hw/xen/xen_frontend.c index
>>>>> 1407f5f..761688b 100644
>>>>> --- a/hw/xen/xen_frontend.c
>>>>> +++ b/hw/xen/xen_frontend.c
>>>>> @@ -39,7 +39,7 @@ int xenstore_read_fe_uint64(struct XenDevice
>*xendev, const char *node,
>>>>> return xenstore_read_uint64(xendev->fe, node, uval); }
>>>>>
>>>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char
>>>>> *node)
>>>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char
>>>>> +*node)
>>>>> {
>>>>> int fe_state;
>>>>>
>>>>> @@ -85,6 +85,6 @@ void xenstore_update_fe(char *watch, struct
>XenDevice *xendev)
>>>>> }
>>>>> node = watch + len + 1;
>>>>>
>>>>> - xen_be_frontend_changed(xendev, node);
>>>>> + xen_fe_frontend_changed(xendev, node);
>>>>> xen_be_check_state(xendev);
>>>>> }
>>>>> diff --git a/include/hw/xen/xen_frontend.h
>>>>> b/include/hw/xen/xen_frontend.h index bb0bc23..2a5f03f 100644
>>>>> --- a/include/hw/xen/xen_frontend.h
>>>>> +++ b/include/hw/xen/xen_frontend.h
>>>>> @@ -9,6 +9,6 @@ int xenstore_read_fe_uint64(struct XenDevice *xendev,
>const char *node,
>>>>>
>uint64_t
>>>>> *uval); void xenstore_update_fe(char *watch, struct XenDevice
>>>>> *xendev);
>>>>>
>>>>> -void xen_be_frontend_changed(struct XenDevice *xendev, const char
>>>>> *node);
>>>>> +void xen_fe_frontend_changed(struct XenDevice *xendev, const char
>>>>> +*node);
>>>>>
>>>>> #endif /* QEMU_HW_XEN_FRONTEND_H */
>>>>>
>>>
>>>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed
2016-10-13 6:32 ` Xuquan (Quan Xu)
@ 2016-10-13 8:27 ` Paolo Bonzini
-1 siblings, 0 replies; 85+ messages in thread
From: Paolo Bonzini @ 2016-10-13 8:27 UTC (permalink / raw)
To: Xuquan (Quan Xu)
Cc: Emil Condrea, Stefano Stabellini, wei.liu2, stefanb, qemu-devel,
xen-devel, Anthony PERARD, Daniel De Graaf
> So we are better leave it as is. Maybe we need to rename some functions in
> that file.
> __iirc__ adding xen_frontend.c is one of Stefano's comments in previous v6
> or v7..
I agree; it's quite possible that code can be shared between backend and
frontend (renaming functions as needed), and it's good to have a generic
xen frontend mechanism instead of something specific to TPM.
Paolo
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 15/15] xen: Rename xen_be_frontend_changed
@ 2016-10-13 8:27 ` Paolo Bonzini
0 siblings, 0 replies; 85+ messages in thread
From: Paolo Bonzini @ 2016-10-13 8:27 UTC (permalink / raw)
To: Xuquan (Quan Xu)
Cc: Stefano Stabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Anthony PERARD, Daniel De Graaf, Emil Condrea
> So we are better leave it as is. Maybe we need to rename some functions in
> that file.
> __iirc__ adding xen_frontend.c is one of Stefano's comments in previous v6
> or v7..
I agree; it's quite possible that code can be shared between backend and
frontend (renaming functions as needed), and it's good to have a generic
xen frontend mechanism instead of something specific to TPM.
Paolo
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings
2016-10-13 4:04 ` [Qemu-devel] " Emil Condrea
@ 2016-10-13 11:35 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-13 11:35 UTC (permalink / raw)
To: Emil Condrea
Cc: qemu-devel, Xuquan (Quan Xu),
wei.liu2, stefanb, Stefano Stabellini, xen-devel,
Daniel De Graaf, Eric Blake
On Thu, Oct 13, 2016 at 07:04:56AM +0300, Emil Condrea wrote:
> On Tue, Oct 11, 2016 at 5:20 PM, Anthony PERARD
> <anthony.perard@citrix.com> wrote:
> > On Tue, Oct 04, 2016 at 09:43:31AM +0300, Emil Condrea wrote:
> >> Fixes:
> >> * WARNING: line over 80 characters
> >>
> >> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
> >> ---
> >> hw/block/xen_disk.c | 3 ++-
> >> hw/char/xen_console.c | 6 ++++--
> >> hw/display/xenfb.c | 30 ++++++++++++++++++++----------
> >> hw/net/xen_nic.c | 12 ++++++++----
> >> hw/xen/xen_backend.c | 15 ++++++++++-----
> >> include/hw/xen/xen_backend.h | 8 +++++---
> >> 6 files changed, 49 insertions(+), 25 deletions(-)
> >>
> >> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
> >> index 5aa350a..24edeb2 100644
> >> --- a/hw/block/xen_disk.c
> >> +++ b/hw/block/xen_disk.c
> >> @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
> >> blk_set_enable_write_cache(blkdev->blk, !writethrough);
> >> } else {
> >> /* setup via qemu cmdline -> already setup for us */
> >> - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
> >> + xen_be_printf(&blkdev->xendev, 2,
> >> + "get configured bdrv (cmdline setup)\n");
> >
> > Arguments are usually aligned with the first one, so there is one
> > missing space.
>
> I guess this is displayed wrongly in the email client as in mine but the source
> of the email contains this patch http://pastebin.com/Sbk23h6m, which shows that
> this line is aligned to the first parameter.
My mail client runs in a terminal, also I've apply the patches to a
local tree, so no display issue.
Here, the quote is just below the open parentheses, but it's normally
one space futher.
If I ask Vim to realign it, I end up with this:
xen_be_printf(&blkdev->xendev, 2,
- "get configured bdrv (cmdline setup)\n");
+ "get configured bdrv (cmdline setup)\n");
You can also have a look at other call of xen_be_printf() in this
function (blk_connect) to get an idea ;).
--
Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 02/15] xen: Fix coding style warnings
@ 2016-10-13 11:35 ` Anthony PERARD
0 siblings, 0 replies; 85+ messages in thread
From: Anthony PERARD @ 2016-10-13 11:35 UTC (permalink / raw)
To: Emil Condrea
Cc: Xuquan (Quan Xu),
Stefano Stabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Daniel De Graaf, Eric Blake
On Thu, Oct 13, 2016 at 07:04:56AM +0300, Emil Condrea wrote:
> On Tue, Oct 11, 2016 at 5:20 PM, Anthony PERARD
> <anthony.perard@citrix.com> wrote:
> > On Tue, Oct 04, 2016 at 09:43:31AM +0300, Emil Condrea wrote:
> >> Fixes:
> >> * WARNING: line over 80 characters
> >>
> >> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
> >> ---
> >> hw/block/xen_disk.c | 3 ++-
> >> hw/char/xen_console.c | 6 ++++--
> >> hw/display/xenfb.c | 30 ++++++++++++++++++++----------
> >> hw/net/xen_nic.c | 12 ++++++++----
> >> hw/xen/xen_backend.c | 15 ++++++++++-----
> >> include/hw/xen/xen_backend.h | 8 +++++---
> >> 6 files changed, 49 insertions(+), 25 deletions(-)
> >>
> >> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
> >> index 5aa350a..24edeb2 100644
> >> --- a/hw/block/xen_disk.c
> >> +++ b/hw/block/xen_disk.c
> >> @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
> >> blk_set_enable_write_cache(blkdev->blk, !writethrough);
> >> } else {
> >> /* setup via qemu cmdline -> already setup for us */
> >> - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
> >> + xen_be_printf(&blkdev->xendev, 2,
> >> + "get configured bdrv (cmdline setup)\n");
> >
> > Arguments are usually aligned with the first one, so there is one
> > missing space.
>
> I guess this is displayed wrongly in the email client as in mine but the source
> of the email contains this patch http://pastebin.com/Sbk23h6m, which shows that
> this line is aligned to the first parameter.
My mail client runs in a terminal, also I've apply the patches to a
local tree, so no display issue.
Here, the quote is just below the open parentheses, but it's normally
one space futher.
If I ask Vim to realign it, I end up with this:
xen_be_printf(&blkdev->xendev, 2,
- "get configured bdrv (cmdline setup)\n");
+ "get configured bdrv (cmdline setup)\n");
You can also have a look at other call of xen_be_printf() in this
function (blk_connect) to get an idea ;).
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings
2016-10-13 11:35 ` Anthony PERARD
(?)
@ 2016-10-13 15:59 ` Emil Condrea
-1 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-13 15:59 UTC (permalink / raw)
To: Anthony PERARD
Cc: qemu-devel, Xuquan (Quan Xu),
wei.liu2, stefanb, Stefano Stabellini, xen-devel,
Daniel De Graaf, Eric Blake
Oh, I see. Because gmail messes up the alignment but raw diff looked
fine I thought that you were seeing the same issue as I see on email client.
I will align the quoted strings properly with the first parameter and
I will send
another series.
Thanks,
Emil
On Thu, Oct 13, 2016 at 2:35 PM, Anthony PERARD
<anthony.perard@citrix.com> wrote:
> On Thu, Oct 13, 2016 at 07:04:56AM +0300, Emil Condrea wrote:
>> On Tue, Oct 11, 2016 at 5:20 PM, Anthony PERARD
>> <anthony.perard@citrix.com> wrote:
>> > On Tue, Oct 04, 2016 at 09:43:31AM +0300, Emil Condrea wrote:
>> >> Fixes:
>> >> * WARNING: line over 80 characters
>> >>
>> >> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>> >> ---
>> >> hw/block/xen_disk.c | 3 ++-
>> >> hw/char/xen_console.c | 6 ++++--
>> >> hw/display/xenfb.c | 30 ++++++++++++++++++++----------
>> >> hw/net/xen_nic.c | 12 ++++++++----
>> >> hw/xen/xen_backend.c | 15 ++++++++++-----
>> >> include/hw/xen/xen_backend.h | 8 +++++---
>> >> 6 files changed, 49 insertions(+), 25 deletions(-)
>> >>
>> >> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
>> >> index 5aa350a..24edeb2 100644
>> >> --- a/hw/block/xen_disk.c
>> >> +++ b/hw/block/xen_disk.c
>> >> @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
>> >> blk_set_enable_write_cache(blkdev->blk, !writethrough);
>> >> } else {
>> >> /* setup via qemu cmdline -> already setup for us */
>> >> - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
>> >> + xen_be_printf(&blkdev->xendev, 2,
>> >> + "get configured bdrv (cmdline setup)\n");
>> >
>> > Arguments are usually aligned with the first one, so there is one
>> > missing space.
>>
>> I guess this is displayed wrongly in the email client as in mine but the source
>> of the email contains this patch http://pastebin.com/Sbk23h6m, which shows that
>> this line is aligned to the first parameter.
>
> My mail client runs in a terminal, also I've apply the patches to a
> local tree, so no display issue.
>
> Here, the quote is just below the open parentheses, but it's normally
> one space futher.
>
> If I ask Vim to realign it, I end up with this:
> xen_be_printf(&blkdev->xendev, 2,
> - "get configured bdrv (cmdline setup)\n");
> + "get configured bdrv (cmdline setup)\n");
>
> You can also have a look at other call of xen_be_printf() in this
> function (blk_connect) to get an idea ;).
>
> --
> Anthony PERARD
^ permalink raw reply [flat|nested] 85+ messages in thread
* Re: [PATCH 02/15] xen: Fix coding style warnings
2016-10-13 11:35 ` Anthony PERARD
(?)
(?)
@ 2016-10-13 15:59 ` Emil Condrea
-1 siblings, 0 replies; 85+ messages in thread
From: Emil Condrea @ 2016-10-13 15:59 UTC (permalink / raw)
To: Anthony PERARD
Cc: Xuquan (Quan Xu),
Stefano Stabellini, wei.liu2, stefanb, qemu-devel, xen-devel,
Daniel De Graaf, Eric Blake
Oh, I see. Because gmail messes up the alignment but raw diff looked
fine I thought that you were seeing the same issue as I see on email client.
I will align the quoted strings properly with the first parameter and
I will send
another series.
Thanks,
Emil
On Thu, Oct 13, 2016 at 2:35 PM, Anthony PERARD
<anthony.perard@citrix.com> wrote:
> On Thu, Oct 13, 2016 at 07:04:56AM +0300, Emil Condrea wrote:
>> On Tue, Oct 11, 2016 at 5:20 PM, Anthony PERARD
>> <anthony.perard@citrix.com> wrote:
>> > On Tue, Oct 04, 2016 at 09:43:31AM +0300, Emil Condrea wrote:
>> >> Fixes:
>> >> * WARNING: line over 80 characters
>> >>
>> >> Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
>> >> ---
>> >> hw/block/xen_disk.c | 3 ++-
>> >> hw/char/xen_console.c | 6 ++++--
>> >> hw/display/xenfb.c | 30 ++++++++++++++++++++----------
>> >> hw/net/xen_nic.c | 12 ++++++++----
>> >> hw/xen/xen_backend.c | 15 ++++++++++-----
>> >> include/hw/xen/xen_backend.h | 8 +++++---
>> >> 6 files changed, 49 insertions(+), 25 deletions(-)
>> >>
>> >> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
>> >> index 5aa350a..24edeb2 100644
>> >> --- a/hw/block/xen_disk.c
>> >> +++ b/hw/block/xen_disk.c
>> >> @@ -1068,7 +1068,8 @@ static int blk_connect(struct XenDevice *xendev)
>> >> blk_set_enable_write_cache(blkdev->blk, !writethrough);
>> >> } else {
>> >> /* setup via qemu cmdline -> already setup for us */
>> >> - xen_be_printf(&blkdev->xendev, 2, "get configured bdrv (cmdline setup)\n");
>> >> + xen_be_printf(&blkdev->xendev, 2,
>> >> + "get configured bdrv (cmdline setup)\n");
>> >
>> > Arguments are usually aligned with the first one, so there is one
>> > missing space.
>>
>> I guess this is displayed wrongly in the email client as in mine but the source
>> of the email contains this patch http://pastebin.com/Sbk23h6m, which shows that
>> this line is aligned to the first parameter.
>
> My mail client runs in a terminal, also I've apply the patches to a
> local tree, so no display issue.
>
> Here, the quote is just below the open parentheses, but it's normally
> one space futher.
>
> If I ask Vim to realign it, I end up with this:
> xen_be_printf(&blkdev->xendev, 2,
> - "get configured bdrv (cmdline setup)\n");
> + "get configured bdrv (cmdline setup)\n");
>
> You can also have a look at other call of xen_be_printf() in this
> function (blk_connect) to get an idea ;).
>
> --
> Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 85+ messages in thread
end of thread, other threads:[~2016-10-13 15:59 UTC | newest]
Thread overview: 85+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04 6:43 [Qemu-devel] [PATCH 00/15] Refactor common part of xen backend and frontend Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 01/15] xen: Fix coding style errors Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-11 13:56 ` [Qemu-devel] " Anthony PERARD
2016-10-13 3:48 ` Emil Condrea
2016-10-13 3:48 ` Emil Condrea
2016-10-11 13:56 ` Anthony PERARD
2016-10-04 6:43 ` [Qemu-devel] [PATCH 02/15] xen: Fix coding style warnings Emil Condrea
2016-10-11 14:20 ` Anthony PERARD
2016-10-11 14:20 ` Anthony PERARD
2016-10-13 4:04 ` Emil Condrea
2016-10-13 4:04 ` [Qemu-devel] " Emil Condrea
2016-10-13 11:35 ` Anthony PERARD
2016-10-13 11:35 ` Anthony PERARD
2016-10-13 15:59 ` [Qemu-devel] " Emil Condrea
2016-10-13 15:59 ` Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 03/15] xen: Create a new file xen_pvdev.c Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-11 14:38 ` [Qemu-devel] " Anthony PERARD
2016-10-11 14:38 ` Anthony PERARD
2016-10-04 6:43 ` [Qemu-devel] [PATCH 04/15] xen: Create a new file xen_frontend.c Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-12 13:30 ` Anthony PERARD
2016-10-12 13:30 ` [Qemu-devel] " Anthony PERARD
2016-10-04 6:43 ` [Qemu-devel] [PATCH 05/15] xen: Move xenstore_update to xen_pvdev.c Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 06/15] xen: Move evtchn functions " Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 07/15] xen: Prepare xendev qtail to be shared with frontends Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-04 6:43 ` [Qemu-devel] [PATCH 08/15] xen: Move xenstore cleanup and mkdir functions Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-12 13:30 ` [Qemu-devel] " Anthony PERARD
2016-10-12 13:30 ` Anthony PERARD
2016-10-04 6:43 ` [Qemu-devel] [PATCH 09/15] xen: Rename xen_be_printf to xen_pv_printf Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-12 13:31 ` [Qemu-devel] " Anthony PERARD
2016-10-12 13:31 ` Anthony PERARD
2016-10-04 6:43 ` [Qemu-devel] [PATCH 10/15] xen: Rename xen_be_unbind_evtchn Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-12 13:37 ` Anthony PERARD
2016-10-12 13:37 ` [Qemu-devel] " Anthony PERARD
2016-10-13 1:44 ` Xuquan (Quan Xu)
2016-10-13 1:44 ` Xuquan (Quan Xu)
2016-10-04 6:43 ` [Qemu-devel] [PATCH 11/15] xen: Rename xen_be_send_notify Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-12 13:40 ` Anthony PERARD
2016-10-12 13:40 ` [Qemu-devel] " Anthony PERARD
2016-10-13 1:45 ` Xuquan (Quan Xu)
2016-10-13 1:45 ` Xuquan (Quan Xu)
2016-10-04 6:43 ` [Qemu-devel] [PATCH 12/15] xen: Rename xen_be_evtchn_event Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-12 13:41 ` [Qemu-devel] " Anthony PERARD
2016-10-12 13:41 ` Anthony PERARD
2016-10-13 1:46 ` [Qemu-devel] " Xuquan (Quan Xu)
2016-10-13 1:46 ` Xuquan (Quan Xu)
2016-10-04 6:43 ` [Qemu-devel] [PATCH 13/15] xen: Rename xen_be_find_xendev Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-12 13:42 ` [Qemu-devel] " Anthony PERARD
2016-10-12 13:42 ` Anthony PERARD
2016-10-13 1:46 ` [Qemu-devel] " Xuquan (Quan Xu)
2016-10-13 1:46 ` Xuquan (Quan Xu)
2016-10-04 6:43 ` [Qemu-devel] [PATCH 14/15] xen: Rename xen_be_del_xendev Emil Condrea
2016-10-04 6:43 ` Emil Condrea
2016-10-12 13:46 ` [Qemu-devel] " Anthony PERARD
2016-10-12 13:46 ` Anthony PERARD
2016-10-13 1:47 ` [Qemu-devel] " Xuquan (Quan Xu)
2016-10-13 1:47 ` Xuquan (Quan Xu)
2016-10-04 6:43 ` [Qemu-devel] [PATCH 15/15] xen: Rename xen_be_frontend_changed Emil Condrea
2016-10-04 8:06 ` Paolo Bonzini
2016-10-04 8:06 ` Paolo Bonzini
2016-10-04 8:08 ` [Qemu-devel] " Paolo Bonzini
2016-10-04 8:08 ` Paolo Bonzini
2016-10-09 19:50 ` Emil Condrea
2016-10-09 19:50 ` [Qemu-devel] " Emil Condrea
2016-10-12 11:00 ` Paolo Bonzini
2016-10-12 11:00 ` [Qemu-devel] " Paolo Bonzini
2016-10-13 6:08 ` Emil Condrea
2016-10-13 6:08 ` Emil Condrea
2016-10-13 6:32 ` [Qemu-devel] " Xuquan (Quan Xu)
2016-10-13 6:32 ` Xuquan (Quan Xu)
2016-10-13 8:27 ` [Qemu-devel] " Paolo Bonzini
2016-10-13 8:27 ` Paolo Bonzini
2016-10-04 6:43 ` Emil Condrea
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.