From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH 05/13] libxl: abolish useless `start' parameter to libxl__add_*
Date: Thu, 2 Aug 2012 18:27:14 +0100 [thread overview]
Message-ID: <1343928442-23966-6-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1343928442-23966-1-git-send-email-ian.jackson@eu.citrix.com>
0 is always passed for this parameter and the code doesn't, actually,
use it, now.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
tools/libxl/libxl_create.c | 4 ++--
tools/libxl/libxl_device.c | 7 +++----
tools/libxl/libxl_dm.c | 4 ++--
tools/libxl/libxl_internal.h | 8 +++-----
4 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 3265d69..5275373 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -911,7 +911,7 @@ static void domcreate_rebuild_done(libxl__egc *egc,
libxl__multidev_begin(ao, &dcs->aodevs);
dcs->aodevs.callback = domcreate_launch_dm;
- libxl__add_disks(egc, ao, domid, 0, d_config, &dcs->aodevs);
+ libxl__add_disks(egc, ao, domid, d_config, &dcs->aodevs);
libxl__multidev_prepared(egc, &dcs->aodevs, 0);
return;
@@ -1041,7 +1041,7 @@ static void domcreate_devmodel_started(libxl__egc *egc,
/* Attach nics */
libxl__multidev_begin(ao, &dcs->aodevs);
dcs->aodevs.callback = domcreate_attach_pci;
- libxl__add_nics(egc, ao, domid, 0, d_config, &dcs->aodevs);
+ libxl__add_nics(egc, ao, domid, d_config, &dcs->aodevs);
libxl__multidev_prepared(egc, &dcs->aodevs, 0);
return;
}
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 4a53181..27fbd21 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -485,15 +485,14 @@ void libxl__multidev_prepared(libxl__egc *egc, libxl__ao_devices *aodevs,
#define DEFINE_DEVICES_ADD(type) \
void libxl__add_##type##s(libxl__egc *egc, libxl__ao *ao, uint32_t domid, \
- int start, libxl_domain_config *d_config, \
+ libxl_domain_config *d_config, \
libxl__ao_devices *aodevs) \
{ \
AO_GC; \
int i; \
- int end = start + d_config->num_##type##s; \
- for (i = start; i < end; i++) { \
+ for (i = 0; i < d_config->num_##type##s; i++) { \
libxl__ao_device *aodev = libxl__multidev_prepare(aodevs); \
- libxl__device_##type##_add(egc, domid, &d_config->type##s[i-start], \
+ libxl__device_##type##_add(egc, domid, &d_config->type##s[i], \
aodev); \
} \
}
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 177642b..66aa45e 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -858,7 +858,7 @@ retry_transaction:
libxl__multidev_begin(ao, &sdss->aodevs);
sdss->aodevs.callback = spawn_stub_launch_dm;
- libxl__add_disks(egc, ao, dm_domid, 0, dm_config, &sdss->aodevs);
+ libxl__add_disks(egc, ao, dm_domid, dm_config, &sdss->aodevs);
libxl__multidev_prepared(egc, &sdss->aodevs, 0);
free(args);
@@ -984,7 +984,7 @@ static void spawn_stubdom_pvqemu_cb(libxl__egc *egc,
if (d_config->num_nics > 0) {
libxl__multidev_begin(ao, &sdss->aodevs);
sdss->aodevs.callback = stubdom_pvqemu_cb;
- libxl__add_nics(egc, ao, dm_domid, 0, d_config, &sdss->aodevs);
+ libxl__add_nics(egc, ao, dm_domid, d_config, &sdss->aodevs);
libxl__multidev_prepared(egc, &sdss->aodevs, 0);
return;
}
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 07e92fb..bb3eb5f 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2388,19 +2388,17 @@ _hidden void libxl__devices_destroy(libxl__egc *egc,
/* Helper function to add a bunch of disks. This should be used when
* the caller is inside an async op. "devices" will NOT be prepared by
* this function, so the caller must make sure to call
- * libxl__multidev_begin before calling this function. The start
- * parameter contains the position inside the aodevs array that should
- * be used to store the state of this devices.
+ * libxl__multidev_begin before calling this function.
*
* The "callback" will be called for each device, and the user is responsible
* for calling libxl__ao_device_check_last on the callback.
*/
_hidden void libxl__add_disks(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
- int start, libxl_domain_config *d_config,
+ libxl_domain_config *d_config,
libxl__ao_devices *aodevs);
_hidden void libxl__add_nics(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
- int start, libxl_domain_config *d_config,
+ libxl_domain_config *d_config,
libxl__ao_devices *aodevs);
/*----- device model creation -----*/
--
1.7.2.5
next prev parent reply other threads:[~2012-08-02 17:27 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-02 17:27 [PATCH v5 00/13] libxl: Assorted bugfixes and cleanups Ian Jackson
2012-08-02 17:27 ` [PATCH 01/13] libxl: unify libxl__device_destroy and device_hotplug_done Ian Jackson
2012-08-02 17:27 ` [PATCH 02/13] libxl: react correctly to bootloader pty master POLLHUP Ian Jackson
2012-08-03 8:32 ` Ian Campbell
2012-08-02 17:27 ` [PATCH 03/13] libxl: fix device counting race in libxl__devices_destroy Ian Jackson
2012-08-02 17:27 ` [PATCH 04/13] libxl: fix formatting of DEFINE_DEVICES_ADD Ian Jackson
2012-08-02 17:27 ` Ian Jackson [this message]
2012-08-02 17:27 ` [PATCH 06/13] libxl: rename aodevs to multidev Ian Jackson
2012-08-02 17:27 ` [PATCH 07/13] libxl: do not blunder on if bootloader fails (again) Ian Jackson
2012-08-02 17:27 ` [PATCH 08/13] libxl: remus: mark TODOs more clearly Ian Jackson
2012-08-02 17:27 ` [PATCH 09/13] libxl: remove an unused numainfo parameter Ian Jackson
2012-08-02 17:27 ` [PATCH 10/13] libxl: idl: always initialise KeyedEnum keyvar in member init Ian Jackson
2012-08-02 17:27 ` [PATCH 11/13] libxl: correct some comments regarding event API and fds Ian Jackson
2012-08-03 8:35 ` Ian Campbell
2012-08-03 10:53 ` Ian Jackson
2012-08-02 17:27 ` [PATCH 12/13] libxl: add a comment re the memory management API instability Ian Jackson
2012-08-03 8:35 ` Ian Campbell
2012-08-02 17:27 ` [PATCH 13/13] libxl: -Wunused-parameter Ian Jackson
2012-08-03 8:08 ` Ian Campbell
2012-08-03 8:59 ` [PATCH v5 00/13] libxl: Assorted bugfixes and cleanups Ian Campbell
2012-08-03 11:05 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343928442-23966-6-git-send-email-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=xen-devel@lists.xen.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).