Lines Matching refs:dev
46 char *script, libxl__device *dev) in get_hotplug_env() argument
48 const char *type = libxl__device_kind_to_string(dev->backend_kind); in get_hotplug_env()
49 char *be_path = libxl__device_backend_path(gc, dev); in get_hotplug_env()
60 env[nr++] = GCSPRINTF("backend/%s/%u/%d", type, dev->domid, dev->devid); in get_hotplug_env()
63 if (dev->backend_kind == LIBXL__DEVICE_KIND_VIF) { in get_hotplug_env()
72 if (libxl__nic_type(gc, dev, &nictype)) { in get_hotplug_env()
73 LOGD(ERROR, dev->domid, "unable to get nictype"); in get_hotplug_env()
79 env[nr++] = (char *) libxl__device_nic_devname(gc, dev->domid, in get_hotplug_env()
80 dev->devid, in get_hotplug_env()
90 env[nr++] = (char *) libxl__device_nic_devname(gc, dev->domid, in get_hotplug_env()
91 dev->devid, in get_hotplug_env()
107 static int libxl__hotplug_nic(libxl__gc *gc, libxl__device *dev, in libxl__hotplug_nic() argument
111 char *be_path = libxl__device_backend_path(gc, dev); in libxl__hotplug_nic()
119 LOGED(ERROR, dev->domid, in libxl__hotplug_nic()
125 rc = libxl__nic_type(gc, dev, &nictype); in libxl__hotplug_nic()
127 LOGD(ERROR, dev->domid, "error when fetching nic type"); in libxl__hotplug_nic()
136 *env = get_hotplug_env(gc, script, dev); in libxl__hotplug_nic()
163 static int libxl__hotplug_disk(libxl__gc *gc, libxl__device *dev, in libxl__hotplug_disk() argument
167 char *be_path = libxl__device_backend_path(gc, dev); in libxl__hotplug_disk()
174 LOGEVD(ERROR, errno, dev->domid, in libxl__hotplug_disk()
180 *env = get_hotplug_env(gc, script, dev); in libxl__hotplug_disk()
182 LOGD(ERROR, dev->domid, "Failed to get hotplug environment"); in libxl__hotplug_disk()
194 LOGD(DEBUG, dev->domid, "Args and environment ready"); in libxl__hotplug_disk()
201 int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev, in libxl__get_hotplug_script_info() argument
208 switch (dev->backend_kind) { in libxl__get_hotplug_script_info()
212 LOGD(DEBUG, dev->domid, in libxl__get_hotplug_script_info()
217 rc = libxl__hotplug_disk(gc, dev, args, env, action); in libxl__get_hotplug_script_info()
225 (libxl_get_stubdom_id(CTX, dev->domid) && num_exec)) { in libxl__get_hotplug_script_info()
226 LOGD(DEBUG, dev->domid, in libxl__get_hotplug_script_info()
231 rc = libxl__hotplug_nic(gc, dev, args, env, action, num_exec); in libxl__get_hotplug_script_info()
235 LOGD(DEBUG, dev->domid, "backend_kind %s, no need to execute scripts", in libxl__get_hotplug_script_info()
236 libxl__device_kind_to_string(dev->backend_kind)); in libxl__get_hotplug_script_info()
284 unsigned int dom, bus, dev, func; in libxl__pci_topology_init() local
296 if (sscanf(entry->d_name, "%x:%x:%x.%d", &dom, &bus, &dev, &func) < 4) { in libxl__pci_topology_init()
304 devs[i].devfn = ((dev & 0x1f) << 3) | (func & 7); in libxl__pci_topology_init()