这篇教程C++ xenbus_scanf函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中xenbus_scanf函数的典型用法代码示例。如果您正苦于以下问题:C++ xenbus_scanf函数的具体用法?C++ xenbus_scanf怎么用?C++ xenbus_scanf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了xenbus_scanf函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: xnbo_hotplug_connected/* * The hotplug script has completed. We read information from xenstore * about our configuration, most notably the name of the MAC device we * should use. */static boolean_txnbo_hotplug_connected(xnb_t *xnbp){ char *xsname; xnbo_t *xnbop = xnbp->xnb_flavour_data; int need; xsname = xvdi_get_xsname(xnbp->xnb_devinfo); if (xenbus_scanf(XBT_NULL, xsname, "nic", "%s", xnbop->o_link_name) != 0) { cmn_err(CE_WARN, "xnbo_connect: " "cannot read nic name from %s", xsname); return (B_FALSE); } if (xenbus_scanf(XBT_NULL, xsname, "SUNW-need-rx-filter", "%d", &need) != 0) need = 0; xnbop->o_need_rx_filter = (need > 0); if (xenbus_scanf(XBT_NULL, xsname, "SUNW-need-set-physaddr", "%d", &need) != 0) need = 0; xnbop->o_need_setphysaddr = (need > 0); return (B_TRUE);}
开发者ID:apprisi,项目名称:illumos-gate,代码行数:33,
示例2: pcifront_attach_devicesstatic int __devinit pcifront_attach_devices(struct pcifront_device *pdev){ int err = -EFAULT; int i, num_roots, len; unsigned int domain, bus; char str[64]; spin_lock(&pdev->dev_lock); if (xenbus_read_driver_state(pdev->xdev->nodename) != XenbusStateReconfiguring) goto out; err = xenbus_scanf(XBT_NIL, pdev->xdev->otherend, "root_num", "%d", &num_roots); if (err == -ENOENT) { xenbus_dev_error(pdev->xdev, err, "No PCI Roots found, trying 0000:00"); err = pcifront_rescan_root(pdev, 0, 0); num_roots = 0; } else if (err != 1) { if (err == 0) err = -EINVAL; xenbus_dev_fatal(pdev->xdev, err, "Error reading number of PCI roots"); goto out; } for (i = 0; i < num_roots; i++) { len = snprintf(str, sizeof(str), "root-%d", i); if (unlikely(len >= (sizeof(str) - 1))) { err = -ENOMEM; goto out; } err = xenbus_scanf(XBT_NIL, pdev->xdev->otherend, str, "%x:%x", &domain, &bus); if (err != 2) { if (err >= 0) err = -EINVAL; xenbus_dev_fatal(pdev->xdev, err, "Error reading PCI root %d", i); goto out; } err = pcifront_rescan_root(pdev, domain, bus); if (err) { xenbus_dev_fatal(pdev->xdev, err, "Error scanning PCI root %04x:%02x", domain, bus); goto out; } } xenbus_switch_state(pdev->xdev, XenbusStateConnected); out: spin_unlock(&pdev->dev_lock); return err;}
开发者ID:AsadRaza,项目名称:OCTEON-Linux,代码行数:60,
示例3: xen_pcibk_publish_pci_rootstatic int xen_pcibk_publish_pci_root(struct xen_pcibk_device *pdev, unsigned int domain, unsigned int bus){ unsigned int d, b; int i, root_num, len, err; char str[64]; dev_dbg(&pdev->xdev->dev, "Publishing pci roots/n"); err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, "root_num", "%d", &root_num); if (err == 0 || err == -ENOENT) root_num = 0; else if (err < 0) goto out; /* Verify that we haven't already published this pci root */ for (i = 0; i < root_num; i++) { len = snprintf(str, sizeof(str), "root-%d", i); if (unlikely(len >= (sizeof(str) - 1))) { err = -ENOMEM; goto out; } err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, str, "%x:%x", &d, &b); if (err < 0) goto out; if (err != 2) { err = -EINVAL; goto out; } if (d == domain && b == bus) { err = 0; goto out; } } len = snprintf(str, sizeof(str), "root-%d", root_num); if (unlikely(len >= (sizeof(str) - 1))) { err = -ENOMEM; goto out; } dev_dbg(&pdev->xdev->dev, "writing root %d at %04x:%02x/n", root_num, domain, bus); err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, str, "%04x:%02x", domain, bus); if (err) goto out; err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, "root_num", "%d", (root_num + 1));out: return err;}
开发者ID:454053205,项目名称:linux,代码行数:59,
示例4: xenkbd_backend_changedstatic void xenkbd_backend_changed(struct xenbus_device *dev, enum xenbus_state backend_state){ struct xenkbd_info *info = dev_get_drvdata(&dev->dev); int ret, val; switch (backend_state) { case XenbusStateInitialising: case XenbusStateInitialised: case XenbusStateReconfiguring: case XenbusStateReconfigured: case XenbusStateUnknown: break; case XenbusStateInitWait:InitWait: ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend, "feature-abs-pointer", "%d", &val); if (ret < 0) val = 0; if (val) { ret = xenbus_printf(XBT_NIL, info->xbdev->nodename, "request-abs-pointer", "1"); if (ret) pr_warning("xenkbd: can't request abs-pointer"); } xenbus_switch_state(dev, XenbusStateConnected); break; case XenbusStateConnected: /* * Work around xenbus race condition: If backend goes * through InitWait to Connected fast enough, we can * get Connected twice here. */ if (dev->state != XenbusStateConnected) goto InitWait; /* no InitWait seen yet, fudge it */ /* Set input abs params to match backend screen res */ if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, "width", "%d", &val) > 0) input_set_abs_params(info->ptr, ABS_X, 0, val, 0, 0); if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, "height", "%d", &val) > 0) input_set_abs_params(info->ptr, ABS_Y, 0, val, 0, 0); break; case XenbusStateClosed: if (dev->state == XenbusStateClosed) break; /* Missed the backend's CLOSING state -- fallthrough */ case XenbusStateClosing: xenbus_frontend_closed(dev); break; }}
开发者ID:168519,项目名称:linux,代码行数:59,
示例5: xenbus_scanfstatic struct usb_hcd *create_hcd(struct xenbus_device *dev){ int i; int err = 0; int num_ports; int usb_ver; struct usb_hcd *hcd = NULL; struct usbfront_info *info = NULL; err = xenbus_scanf(XBT_NIL, dev->otherend, "num-ports", "%d", &num_ports); if (err != 1) { xenbus_dev_fatal(dev, err, "reading num-ports"); return ERR_PTR(-EINVAL); } if (num_ports < 1 || num_ports > USB_MAXCHILDREN) { xenbus_dev_fatal(dev, err, "invalid num-ports"); return ERR_PTR(-EINVAL); } err = xenbus_scanf(XBT_NIL, dev->otherend, "usb-ver", "%d", &usb_ver); if (err != 1) { xenbus_dev_fatal(dev, err, "reading usb-ver"); return ERR_PTR(-EINVAL); } switch (usb_ver) { case USB_VER_USB11: hcd = usb_create_hcd(&xen_usb11_hc_driver, &dev->dev, dev->dev.bus_id); break; case USB_VER_USB20: hcd = usb_create_hcd(&xen_usb20_hc_driver, &dev->dev, dev->dev.bus_id); break; default: xenbus_dev_fatal(dev, err, "invalid usb-ver"); return ERR_PTR(-EINVAL); } if (!hcd) { xenbus_dev_fatal(dev, err, "fail to allocate USB host controller"); return ERR_PTR(-ENOMEM); } info = hcd_to_info(hcd); info->xbdev = dev; info->rh_numports = num_ports; for (i = 0; i < USB_URB_RING_SIZE; i++) { info->shadow[i].req.id = i + 1; info->shadow[i].urb = NULL; } info->shadow[USB_URB_RING_SIZE-1].req.id = 0x0fff; return hcd;}
开发者ID:zhoupeng,项目名称:spice4xen,代码行数:55,
示例6: oxtkbd_backend_changed/** * Handle a change to the keyboard device's backend. * This effectively moves us through the XenBus negotiation FSM. */static void oxtkbd_backend_changed(struct xenbus_device *dev, enum xenbus_state backend_state){ int val; struct openxt_kbd_info *info = dev_get_drvdata(&dev->dev); switch (backend_state) { case XenbusStateInitialising: case XenbusStateInitialised: case XenbusStateReconfiguring: case XenbusStateReconfigured: case XenbusStateUnknown: break; case XenbusStateInitWait:InitWait: xenbus_switch_state(dev, XenbusStateConnected); break; case XenbusStateConnected: /* * Work around xenbus race condition: If backend goes * through InitWait to Connected fast enough, we can * get Connected twice here. */ if (dev->state != XenbusStateConnected) goto InitWait; /* no InitWait seen yet, fudge it */ //Once we connect, try to adjust the screen width and height //to match the width and height stored in the XenStore. if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, "width", "%d", &val) > 0) { input_set_abs_params(info->absolute_pointer, ABS_X, 0, val, 0, 0); input_set_abs_params(info->absolute_pointer, ABS_MT_POSITION_X, 0, val, 0, 0); } if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, "height", "%d", &val) > 0) { input_set_abs_params(info->absolute_pointer, ABS_Y, 0, val, 0, 0); input_set_abs_params(info->absolute_pointer, ABS_MT_POSITION_Y, 0, val, 0, 0); } break; case XenbusStateClosed: if (dev->state == XenbusStateClosed) break; /* Missed the backend's CLOSING state -- fallthrough */ case XenbusStateClosing: xenbus_frontend_closed(dev); break; }}
开发者ID:ktemkin,项目名称:openxt_kbdfront,代码行数:58,
示例7: xenkbd_backend_changedstatic void xenkbd_backend_changed(struct xenbus_device *dev, enum xenbus_state backend_state){ struct xenkbd_info *info = dev_get_drvdata(&dev->dev); int ret, val; switch (backend_state) { case XenbusStateInitialising: case XenbusStateInitialised: case XenbusStateReconfiguring: case XenbusStateReconfigured: case XenbusStateUnknown: case XenbusStateClosed: break; case XenbusStateInitWait:InitWait: ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend, "feature-abs-pointer", "%d", &val); if (ret < 0) val = 0; if (val) { ret = xenbus_printf(XBT_NIL, info->xbdev->nodename, "request-abs-pointer", "1"); if (ret) pr_warning("xenkbd: can't request abs-pointer"); } xenbus_switch_state(dev, XenbusStateConnected); break; case XenbusStateConnected: if (dev->state != XenbusStateConnected) goto InitWait; if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, "width", "%d", &val) > 0) input_set_abs_params(info->ptr, ABS_X, 0, val, 0, 0); if (xenbus_scanf(XBT_NIL, info->xbdev->otherend, "height", "%d", &val) > 0) input_set_abs_params(info->ptr, ABS_Y, 0, val, 0, 0); break; case XenbusStateClosing: xenbus_frontend_closed(dev); break; }}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:51,
示例8: setup_shutdown_watcherstatic int setup_shutdown_watcher(void){ int err; (void)xenbus_scanf(XBT_NIL, "control", "platform-feature-multiprocessor-suspend", "%d", &fast_suspend); err = register_xenbus_watch(&shutdown_watch); if (err) { printk(KERN_ERR "Failed to set shutdown watcher/n"); return err; } err = register_xenbus_watch(&sysrq_watch); if (err) { printk(KERN_ERR "Failed to set sysrq watcher/n"); return err; } /* suspend event channel */ err = setup_suspend_evtchn(); if (err) { printk(KERN_ERR "Failed to register suspend event channel/n"); return err; } return 0;}
开发者ID:Jinjian0609,项目名称:UVP-Tools,代码行数:29,
示例9: bend_domu_accel_change/* accelstate on the frontend's xenbus node has changed */static void bend_domu_accel_change(struct xenbus_watch *watch, const char **vec, unsigned int len){ int state; struct netback_accel *bend; bend = container_of(watch, struct netback_accel, domu_accel_watch); if (bend->domu_accel_watch.node != NULL) { struct xenbus_device *dev = (struct xenbus_device *)bend->hdev_data; VPRINTK("Watch matched, got dev %p otherend %p/n", dev, dev->otherend); /* * dev->otherend != NULL check to protect against * watch firing when domain goes away and we haven't * yet cleaned up */ if (!dev->otherend || !xenbus_exists(XBT_NIL, watch->node, "") || strncmp(dev->otherend, vec[XS_WATCH_PATH], strlen(dev->otherend))) { DPRINTK("Ignoring watch as otherend seems invalid/n"); return; } mutex_lock(&bend->bend_mutex); xenbus_scanf(XBT_NIL, dev->otherend, "accelstate", "%d", &state); netback_accel_frontend_changed(dev, state); mutex_unlock(&bend->bend_mutex); }}
开发者ID:zhoupeng,项目名称:spice4xen,代码行数:35,
示例10: backend_changedstatic void backend_changed(struct xenbus_device *dev, enum xenbus_state backend_state){ int val; switch (backend_state) { case XenbusStateInitialised: case XenbusStateConnected: if (dev->state == XenbusStateConnected) break; if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-protocol-v2", "%d", &val) < 0) val = 0; if (!val) { xenbus_dev_fatal(dev, -EINVAL, "vTPM protocol 2 required"); return; } xenbus_switch_state(dev, XenbusStateConnected); break; case XenbusStateClosing: case XenbusStateClosed: device_unregister(&dev->dev); xenbus_frontend_closed(dev); break; default: break; }}
开发者ID:fromfuture,项目名称:Elizium,代码行数:31,
示例11: vcpu_hotplugstatic void vcpu_hotplug(unsigned int cpu){ int err; char dir[32], state[32]; if ((cpu >= NR_CPUS) || !cpu_possible(cpu)) return; sprintf(dir, "cpu/%d", cpu); err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state); if (err != 1) { printk(KERN_ERR "XENBUS: Unable to read cpu state/n"); return; } if (strcmp(state, "online") == 0) { cpu_set(cpu, xenbus_allowed_cpumask); (void)cpu_up(cpu); } else if (strcmp(state, "offline") == 0) { cpu_clear(cpu, xenbus_allowed_cpumask); (void)cpu_down(cpu); } else { printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d/n", state, cpu); }}
开发者ID:xf739645524,项目名称:kernel-rhel5,代码行数:26,
示例12: vcpu_hotplugstatic void vcpu_hotplug(unsigned int cpu){ int err; char dir[32], state[32]; if (!cpu_possible(cpu)) return; sprintf(dir, "cpu/%u", cpu); err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state); if (err != 1) { printk(KERN_ERR "XENBUS: Unable to read cpu state/n"); return; } if (strcmp(state, "online") == 0) { enable_hotplug_cpu(cpu); } else if (strcmp(state, "offline") == 0) { (void)cpu_down(cpu); disable_hotplug_cpu(cpu); } else { printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d/n", state, cpu); }}
开发者ID:mpalmer,项目名称:linux-2.6,代码行数:25,
示例13: backend_create_xenvifstatic int backend_create_xenvif(struct backend_info *be){ int err; long handle; struct xenbus_device *dev = be->dev; struct xenvif *vif; if (be->vif != NULL) return 0; err = xenbus_scanf(XBT_NIL, dev->nodename, "handle", "%li", &handle); if (err != 1) { xenbus_dev_fatal(dev, err, "reading handle"); return (err < 0) ? err : -EINVAL; } vif = xenvif_alloc(&dev->dev, dev->otherend_id, handle); if (IS_ERR(vif)) { err = PTR_ERR(vif); xenbus_dev_fatal(dev, err, "creating interface"); return err; } be->vif = vif; kobject_uevent(&dev->dev.kobj, KOBJ_ONLINE); return 0;}
开发者ID:gxt,项目名称:linux,代码行数:27,
示例14: watch_target/* React to a change in the target key */static void watch_target(struct xenbus_watch *watch, const char *path, const char *token){ unsigned long long new_target; int err; static bool watch_fired; static long target_diff; err = xenbus_scanf(XBT_NIL, "memory", "target", "%llu", &new_target); if (err != 1) { /* This is ok (for domain0 at least) - so just return */ return; } /* The given memory/target value is in KiB, so it needs converting to * pages. PAGE_SHIFT converts bytes to pages, hence PAGE_SHIFT - 10. */ new_target >>= PAGE_SHIFT - 10; if (watch_fired) { balloon_set_new_target(new_target - target_diff); return; } watch_fired = true; target_diff = new_target - balloon_stats.target_pages;}
开发者ID:mdamt,项目名称:linux,代码行数:27,
示例15: sysrq_handlerstatic void sysrq_handler(struct xenbus_watch *watch, const char *path, const char *token){ char sysrq_key = '/0'; struct xenbus_transaction xbt; int err; again: err = xenbus_transaction_start(&xbt); if (err) return; err = xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key); if (err < 0) { /* * The Xenstore watch fires directly after registering it and * after a suspend/resume cycle. So ENOENT is no error but * might happen in those cases. */ if (err != -ENOENT) pr_err("Error %d reading sysrq code in control/sysrq/n", err); xenbus_transaction_end(xbt, 1); return; } if (sysrq_key != '/0') xenbus_printf(xbt, "control", "sysrq", "%c", '/0'); err = xenbus_transaction_end(xbt, 0); if (err == -EAGAIN) goto again; if (sysrq_key != '/0') handle_sysrq(sysrq_key);}
开发者ID:mdamt,项目名称:linux,代码行数:35,
示例16: backend_changedstatic void backend_changed(struct xenbus_watch *watch, const char **vec, unsigned int len){ int err; long instance; struct backend_info *be = container_of(watch, struct backend_info, backend_watch); struct xenbus_device *dev = be->dev; err = xenbus_scanf(XBT_NULL, dev->nodename, "instance","%li", &instance); if (XENBUS_EXIST_ERR(err)) { return; } if (err != 1) { xenbus_dev_fatal(dev, err, "reading instance"); return; } if (be->is_instance_set == 0) { be->instance = instance; be->is_instance_set = 1; }}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:25,
示例17: vcpu_configstatic voidvcpu_config(void *arg){ int id = (int)(uintptr_t)arg; int error; char dir[16]; char *state; if ((uint_t)id >= max_ncpus) { cmn_err(CE_WARN, "vcpu_config: cpu%d does not fit in this domain", id); return; } (void) snprintf(dir, sizeof (dir), "cpu/%d", id); state = kmem_alloc(MAXPATHLEN, KM_SLEEP); if (xenbus_scanf(XBT_NULL, dir, "availability", "%s", state) == 0) { if (strcmp(state, "online") == 0) { error = vcpu_config_poweron(id); vcpu_config_report(id, P_ONLINE, error); } else if (strcmp(state, "offline") == 0) { error = vcpu_config_poweroff(id); vcpu_config_report(id, P_POWEROFF, error); } else { cmn_err(CE_WARN, "cpu%d: unknown target state '%s'", id, state); } } else cmn_err(CE_WARN, "cpu%d: unable to read target state from xenstore", id); kmem_free(state, MAXPATHLEN);}
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:33,
示例18: ixpfront_probe/** * Entry point to this code when a new device is created. Allocate the basic * structures and the ring buffer for communication with the backend, and * inform the backend of the appropriate details for those. Switch to * Initialised state. */static int ixpfront_probe(struct xenbus_device *dev, const struct xenbus_device_id *id){ int err, vdevice, i; struct ixpfront_info *info; /* FIXME: Use dynamic device id if this is not set. */ err = xenbus_scanf(XBT_NIL, dev->nodename, "virtual-device", "%i", &vdevice); if (err != 1) { /* go looking in the extended area instead */ err = xenbus_scanf(XBT_NIL, dev->nodename, "virtual-device-ext", "%i", &vdevice); if (err != 1) { xenbus_dev_fatal(dev, err, "reading virtual-device"); return err; } } info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) { xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; } info->xbdev = dev; info->vdevice = vdevice; info->connected = IXP_STATE_DISCONNECTED; for (i = 0; i < IXP_RING_SIZE; i++) info->shadow[i].req.id = i+1; info->shadow[IXP_RING_SIZE-1].req.id = 0x0fffffff; /* Front end dir is a number, which is used as the id. */ info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0); dev_set_drvdata(&dev->dev, info); err = talk_to_ixpback(dev, info); if (err) { kfree(info); dev_set_drvdata(&dev->dev, NULL); return err; } return 0;}
开发者ID:kong123456,项目名称:tolapai,代码行数:52,
示例19: xenbus_reset_backend_state_changedstatic void xenbus_reset_backend_state_changed(struct xenbus_watch *w, const char **v, unsigned int l){ xenbus_scanf(XBT_NIL, v[XS_WATCH_PATH], "", "%i", &backend_state); printk(KERN_DEBUG "XENBUS: backend %s %s/n", v[XS_WATCH_PATH], xenbus_strstate(backend_state)); wake_up(&backend_state_wq);}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:8,
示例20: xenbus_reset_backend_state_changedstatic void xenbus_reset_backend_state_changed(struct xenbus_watch *w, const char *path, const char *token){ if (xenbus_scanf(XBT_NIL, path, "", "%i", &backend_state) != 1) backend_state = XenbusStateUnknown; printk(KERN_DEBUG "XENBUS: backend %s %s/n", path, xenbus_strstate(backend_state)); wake_up(&backend_state_wq);}
开发者ID:AshishNamdev,项目名称:linux,代码行数:10,
示例21: xenbus_dev_is_onlineint xenbus_dev_is_online(struct xenbus_device *dev){ int rc, val; rc = xenbus_scanf(XBT_NIL, dev->nodename, "online", "%d", &val); if (rc != 1) val = 0; /* no online node present */ return val;}
开发者ID:Jinjian0609,项目名称:UVP-Tools,代码行数:10,
示例22: connect_ctrl_ringstatic int connect_ctrl_ring(struct backend_info *be){ struct xenbus_device *dev = be->dev; struct xenvif *vif = be->vif; unsigned int val; grant_ref_t ring_ref; unsigned int evtchn; int err; err = xenbus_scanf(XBT_NIL, dev->otherend, "ctrl-ring-ref", "%u", &val); if (err < 0) goto done; /* The frontend does not have a control ring */ ring_ref = val; err = xenbus_scanf(XBT_NIL, dev->otherend, "event-channel-ctrl", "%u", &val); if (err < 0) { xenbus_dev_fatal(dev, err, "reading %s/event-channel-ctrl", dev->otherend); goto fail; } evtchn = val; err = xenvif_connect_ctrl(vif, ring_ref, evtchn); if (err) { xenbus_dev_fatal(dev, err, "mapping shared-frame %u port %u", ring_ref, evtchn); goto fail; }done: return 0;fail: return err;}
开发者ID:forgivemyheart,项目名称:linux,代码行数:41,
示例23: device_probestatic int device_probe(struct xenbus_device* dev, const struct xenbus_device_id* id){ struct backendinfo* binfo; binfo = kmalloc(sizeof(*binfo),GFP_KERNEL); if (!binfo) { xenbus_dev_error(dev, -ENOMEM, "allocating info structure"); return -ENOMEM; } memset(binfo, 0, sizeof(*binfo)); binfo->dev = dev; printk(KERN_ALERT"/nxen: dom0: Probe fired!"); //get ring_gref, op_gref and port by xenStore xenbus_scanf(XBT_NIL, binfo->dev->otherend, "ring_gref", "%u", &info.ring_gref); xenbus_scanf(XBT_NIL, binfo->dev->otherend, "port", "%u", &info.evtchn);// xenbus_scanf(XBT_NIL, binfo->dev->otherend, "op_gref", "%u", &info.op_gref); printk("/nxen: dom0: Xenstore read port, ring_gref and op_gref success: %d, %d ", info.evtchn, info.ring_gref); info.remoteDomain = binfo->dev->otherend_id; connection_establishment();// op_page = map_sharedpage(info.op_gref); return 0;}
开发者ID:huier103,项目名称:virtual,代码行数:21,
示例24: xen_mcast_ctrl_changedstatic void xen_mcast_ctrl_changed(struct xenbus_watch *watch, const char **vec, unsigned int len){ struct xenvif *vif = container_of(watch, struct xenvif, mcast_ctrl_watch); struct xenbus_device *dev = xenvif_to_xenbus_device(vif); int val; if (xenbus_scanf(XBT_NIL, dev->otherend, "request-multicast-control", "%d", &val) < 0) val = 0; vif->multicast_control = !!val;}
开发者ID:gxt,项目名称:linux,代码行数:13,
注:本文中的xenbus_scanf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ xenbus_transaction_end函数代码示例 C++ xenbus_read函数代码示例 |