xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Grytsov <al1img@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksandr Grytsov <oleksandr_grytsov@epam.com>,
	ian.jackson@eu.citrix.com, wl@xen.org
Subject: [Xen-devel] [PATCH v1 2/2] libxl: add removing XS backend path for PV devices on domain destroy
Date: Tue,  8 Oct 2019 17:10:24 +0300	[thread overview]
Message-ID: <20191008141024.10885-3-al1img@gmail.com> (raw)
In-Reply-To: <20191008141024.10885-1-al1img@gmail.com>

From: Oleksandr Grytsov <oleksandr_grytsov@epam.com>

Currently backend path is remove for specific devices: VBD, VIF, QDISK.
This commit adds removing backend path for: VDISPL, VSND, VINPUT.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
---
 tools/libxl/libxl_device.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 1402b61a81..8ce70661e5 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -1477,7 +1477,7 @@ typedef struct libxl__ddomain_device {
  */
 typedef struct libxl__ddomain_guest {
     uint32_t domid;
-    int num_vifs, num_vbds, num_qdisks;
+    int num_qdisks;
     LIBXL_SLIST_HEAD(, struct libxl__ddomain_device) devices;
     LIBXL_SLIST_ENTRY(struct libxl__ddomain_guest) next;
 } libxl__ddomain_guest;
@@ -1530,8 +1530,7 @@ static void check_and_maybe_remove_guest(libxl__gc *gc,
 {
     assert(ddomain);
 
-    if (dguest != NULL &&
-        dguest->num_vifs + dguest->num_vbds + dguest->num_qdisks == 0) {
+    if (dguest != NULL && LIBXL_SLIST_FIRST(&dguest->devices) == NULL) {
         LIBXL_SLIST_REMOVE(&ddomain->guests, dguest, libxl__ddomain_guest,
                            next);
         LOGD(DEBUG, dguest->domid, "Removed domain from the list of active guests");
@@ -1573,9 +1572,6 @@ static int add_device(libxl__egc *egc, libxl__ao *ao,
     switch(dev->backend_kind) {
     case LIBXL__DEVICE_KIND_VBD:
     case LIBXL__DEVICE_KIND_VIF:
-        if (dev->backend_kind == LIBXL__DEVICE_KIND_VBD) dguest->num_vbds++;
-        if (dev->backend_kind == LIBXL__DEVICE_KIND_VIF) dguest->num_vifs++;
-
         GCNEW(aodev);
         libxl__prepare_ao_device(ao, aodev);
         /*
@@ -1619,11 +1615,11 @@ static int remove_device(libxl__egc *egc, libxl__ao *ao,
     int rc = 0;
 
     switch(ddev->dev->backend_kind) {
+    case LIBXL__DEVICE_KIND_VDISPL:
+    case LIBXL__DEVICE_KIND_VSND:
+    case LIBXL__DEVICE_KIND_VINPUT:
     case LIBXL__DEVICE_KIND_VBD:
     case LIBXL__DEVICE_KIND_VIF:
-        if (dev->backend_kind == LIBXL__DEVICE_KIND_VBD) dguest->num_vbds--;
-        if (dev->backend_kind == LIBXL__DEVICE_KIND_VIF) dguest->num_vifs--;
-
         GCNEW(aodev);
         libxl__prepare_ao_device(ao, aodev);
         /*
-- 
2.17.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-10-08 14:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 14:10 [Xen-devel] [PATCH v1 0/2] Remove backend xen store entry on domain destroy Oleksandr Grytsov
2019-10-08 14:10 ` [Xen-devel] [PATCH v1 1/2] libxl: introduce new backend type VINPUT Oleksandr Grytsov
2019-10-11 14:58   ` Ian Jackson
2019-10-11 15:57     ` Oleksandr Grytsov
2019-10-11 17:03       ` Ian Jackson
2019-10-16 13:26         ` Oleksandr Grytsov
2019-10-28 14:06           ` Oleksandr Grytsov
2019-11-04 14:52             ` Oleksandr Grytsov
2019-11-15 19:43               ` Ian Jackson
2019-11-18 11:40                 ` Oleksandr Grytsov
2019-11-18 17:48                   ` Ian Jackson
2019-11-18 17:55   ` [Xen-devel] [PATCH for-4.13 " Ian Jackson
2019-11-19 12:40     ` Oleksandr Grytsov
2019-11-20 16:04       ` Ian Jackson
2019-10-08 14:10 ` Oleksandr Grytsov [this message]
2019-10-11 15:07   ` [Xen-devel] [PATCH v1 2/2] libxl: add removing XS backend path for PV devices on domain destroy Ian Jackson
2019-10-11 15:32     ` Roger Pau Monné
2019-10-11 15:55       ` Ian Jackson
2019-10-15 15:39         ` Roger Pau Monné
2019-10-16 10:39           ` Oleksandr Grytsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191008141024.10885-3-al1img@gmail.com \
    --to=al1img@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=oleksandr_grytsov@epam.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).