diff mbox

[2/8] libxl: Remove redundant setting of phyical-device

Message ID 1458144557-29070-3-git-send-email-george.dunlap@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

George Dunlap March 16, 2016, 4:09 p.m. UTC
Regardless of whether we're running a custom hotplug script or using
normal phy: or file:, the "block" script will be run, which will set
all the necessary xenstore nodes.

In fact, writing this value here prevents the block script from
accomplishing its only purpose: to detect duplicate physical block
devices used in different virtual devices.  The first thing the block
script does is check to see if this node is written; and if it is, it
silently exits.

Remove this, and let the block script perform its duplicate checking
function.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
---
NOTE: It's likely that the duplicate checking for physical devices has
never been run under libxl (at least since this bug was introduced);
this may shake out some issues.

CC: Ian Jackson <ian.jackson@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Roger Pau Monne <roger.pau@citrix.com>
---
 tools/libxl/libxl.c | 15 ---------------
 1 file changed, 15 deletions(-)

Comments

Ian Jackson March 16, 2016, 4:54 p.m. UTC | #1
George Dunlap writes ("[PATCH 2/8] libxl: Remove redundant setting of phyical-device"):
> Regardless of whether we're running a custom hotplug script or using
> normal phy: or file:, the "block" script will be run, which will set
> all the necessary xenstore nodes.
> 
> In fact, writing this value here prevents the block script from
> accomplishing its only purpose: to detect duplicate physical block
> devices used in different virtual devices.  The first thing the block
> script does is check to see if this node is written; and if it is, it
> silently exits.
> 
> Remove this, and let the block script perform its duplicate checking
> function.
> 
> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
> ---
> NOTE: It's likely that the duplicate checking for physical devices has
> never been run under libxl (at least since this bug was introduced);
> this may shake out some issues.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff mbox

Patch

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4cdc169..7ce3ebb 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2441,21 +2441,6 @@  static void device_disk_add(libxl__egc *egc, uint32_t domid,
                                          libxl__xen_script_dir_path());
                 flexarray_append_pair(back, "script", script);
 
-                /* If the user did not supply a block script then we
-                 * write the physical-device node ourselves.
-                 *
-                 * If the user did supply a script then that script is
-                 * responsible for this since the block device may not
-                 * exist yet.
-                 */
-                if (!disk->script &&
-                    disk->backend_domid == LIBXL_TOOLSTACK_DOMID) {
-                    int major, minor;
-                    if (!libxl__device_physdisk_major_minor(dev, &major, &minor))
-                        flexarray_append_pair(back, "physical-device",
-                                              GCSPRINTF("%x:%x", major, minor));
-                }
-
                 assert(device->backend_kind == LIBXL__DEVICE_KIND_VBD);
                 break;