instruction stringclasses 1
value | output stringclasses 2
values | input stringlengths 21 96.3k |
|---|---|---|
positive | static int http_receive_data(HTTPContext *c){ int len; HTTPContext *c1; if (c->buffer_ptr >= c->buffer_end) { FFStream *feed = c->stream; /* a packet has been received : write it in the store, except if header */ if (c->data_count > FFM_PACKET_SIZE) { // printf("writing pos=0x%Lx size=0x%Lx\n", feed->feed_write_index, ... | |
positive | static int stellaris_sys_init(uint32_t base, qemu_irq irq, stellaris_board_info * board, uint8_t *macaddr){ ssys_state *s; s = (ssys_state *)g_malloc0(sizeof(ssys_state)); s->irq = irq; s->board = board; /* Most devices come preprogrammed with a MAC address in the user data. */ s->user0 = macaddr[0] | (macaddr[1] << 8)... | |
positive | static int kvm_recommended_vcpus(KVMState *s){ int ret = kvm_check_extension(s, KVM_CAP_NR_VCPUS); return (ret) ? ret : 4;} | |
positive | static void reschedule_dma(void *opaque){ DMAAIOCB *dbs = (DMAAIOCB *)opaque; qemu_bh_delete(dbs->bh); dbs->bh = NULL; dma_bdrv_cb(opaque, 0);} | |
positive | static int adpcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size){ ADPCMContext *c = avctx->priv_data; ADPCMChannelStatus *cs; int n, m, channel, i; int block_predictor[2]; short *samples; short *samples_end; uint8_t *src; int st; /* stereo */ /* DK3 ADPCM accounting variables... | |
positive | static coroutine_fn void test_multi_co_schedule_entry(void *opaque){ g_assert(to_schedule[id] == NULL); atomic_mb_set(&to_schedule[id], qemu_coroutine_self()); while (!atomic_mb_read(&now_stopping)) { int n; n = g_test_rand_int_range(0, NUM_CONTEXTS); schedule_next(n); qemu_coroutine_yield(); g_assert(to_schedule[id] =... | |
positive | static int qcow_open(BlockDriverState *bs, QDict *options, int flags, Error **errp){ BDRVQcowState *s = bs->opaque; int len, i, shift, ret; QCowHeader header; ret = bdrv_pread(bs->file, 0, &header, sizeof(header)); if (ret < 0) { goto fail; } be32_to_cpus(&header.magic); be32_to_cpus(&header.version); be64_to_cpus(&hea... | |
positive | static AVFilterBufferRef *copy_buffer_ref(AVFilterContext *ctx, AVFilterBufferRef *ref){ AVFilterLink *outlink = ctx->outputs[0]; AVFilterBufferRef *buf; int channels, data_size, i; switch (outlink->type) { case AVMEDIA_TYPE_VIDEO: buf = avfilter_get_video_buffer(outlink, AV_PERM_WRITE, ref->video->w, ref->video->h); a... | |
positive | void qmp_block_commit(const char *device, bool has_base, const char *base, const char *top, bool has_speed, int64_t speed, Error **errp){ BlockDriverState *bs; BlockDriverState *base_bs, *top_bs; Error *local_err = NULL; /* This will be part of the QMP command, if/when the * BlockdevOnError change for blkmirror makes i... | |
negative | static int mkv_check_tag(AVDictionary *m){ AVDictionaryEntry *t = NULL; while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) if (av_strcasecmp(t->key, "title") && av_strcasecmp(t->key, "stereo_mode")) return 1; return 0;} | |
negative | int ff_h2645_extract_rbsp(const uint8_t *src, int length, H2645NAL *nal){ int i, si, di; uint8_t *dst; nal->skipped_bytes = 0;#define STARTCODE_TEST \ if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \ if (src[i + 2] != 3 && src[i + 2] != 0) { \ /* startcode, so we must be past the end */ \ length = i; \ } \... | |
positive | static int encode_mode(CinepakEncContext *s, CinepakMode mode, int h, int v1_size, int v4_size, int v4, AVPicture *scratch_pict, strip_info *info, unsigned char *buf){ int x, y, z, flags, bits, temp_size, header_ofs, ret = 0, mb_count = s->w * h / MB_AREA; int needs_extra_bit, should_write_temp; unsigned char temp[64];... | |
positive | static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap){ ByteIOContext *pb = &s->pb; SmackerContext *smk = (SmackerContext *)s->priv_data; AVStream *st, *ast[7]; int i, ret; int tbase; /* read and check header */ smk->magic = get_le32(pb); if (smk->magic != MKTAG('S', 'M', 'K', '2') && smk->magic != ... | |
positive | static void pci_edu_realize(PCIDevice *pdev, Error **errp){ EduState *edu = DO_UPCAST(EduState, pdev, pdev); uint8_t *pci_conf = pdev->config; timer_init_ms(&edu->dma_timer, QEMU_CLOCK_VIRTUAL, edu_dma_timer, edu); qemu_mutex_init(&edu->thr_mutex); qemu_cond_init(&edu->thr_cond); qemu_thread_create(&edu->thread, "edu",... | |
positive | uint64_t pc_dimm_get_free_addr(uint64_t address_space_start, uint64_t address_space_size, uint64_t *hint, uint64_t size, Error **errp){ GSList *list = NULL, *item; uint64_t new_addr, ret = 0; uint64_t address_space_end = address_space_start + address_space_size; assert(address_space_end > address_space_size); object_ch... | |
positive | static int wma_decode_block(WMACodecContext *s){ int n, v, a, ch, bsize; int coef_nb_bits, total_gain; int nb_coefs[MAX_CHANNELS]; float mdct_norm; FFTContext *mdct;#ifdef TRACE tprintf(s->avctx, "***decode_block: %d:%d\n", s->frame_count - 1, s->block_num);#endif /* compute current block length */ if (s->use_variable_... | |
negative | static int floppy_probe_device(const char *filename){ int fd, ret; int prio = 0; struct floppy_struct fdparam; struct stat st; if (strstart(filename, "/dev/fd", NULL)) prio = 50; fd = open(filename, O_RDONLY | O_NONBLOCK); if (fd < 0) { goto out; } ret = fstat(fd, &st); if (ret == -1 || !S_ISBLK(st.st_mode)) { goto out... | |
negative | struct XenDevice *xen_be_find_xendev(const char *type, int dom, int dev){ struct XenDevice *xendev; TAILQ_FOREACH(xendev, &xendevs, next) {if (xendev->dom != dom) continue;if (xendev->dev != dev) continue;if (strcmp(xendev->type, type) != 0) continue;return xendev; } return NULL;} | |
negative | static void dct_unquantize_mpeg1_mmx(MpegEncContext *s, DCTELEM *block, int n, int qscale){ int i, level; const UINT16 *quant_matrix; if (s->mb_intra) { if (n < 4) block[0] = block[0] * s->y_dc_scale; else block[0] = block[0] * s->c_dc_scale; if (s->out_format == FMT_H263) { i = 1; goto unquant_even; } /* XXX: only mpe... | |
negative | static int virtio_ccw_set_vqs(SubchDev *sch, VqInfoBlock *info, VqInfoBlockLegacy *linfo){ VirtIODevice *vdev = virtio_ccw_get_vdev(sch); uint16_t index = info ? info->index : linfo->index; uint16_t num = info ? info->num : linfo->num; uint64_t desc = info ? info->desc : linfo->queue; if (index >= VIRTIO_CCW_QUEUE_MAX)... | |
negative | void qemu_system_debug_request(void){ debug_requested = 1; vm_stop(VMSTOP_DEBUG);} | |
negative | static int coroutine_fn raw_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags){ return bdrv_co_pwrite_zeroes(bs->file->bs, offset, count, flags);} | |
negative | void monitor_flush(Monitor *mon){ int i; if (term_outbuf_index > 0) { for (i = 0; i < MAX_MON; i++) if (monitor_hd[i] && monitor_hd[i]->focus == 0) qemu_chr_write(monitor_hd[i], term_outbuf, term_outbuf_index); term_outbuf_index = 0; }} | |
negative | void qemu_co_queue_restart_all(CoQueue *queue){ while (qemu_co_queue_next(queue)) { /* Do nothing */ }} | |
negative | static void nvdimm_dsm_func_read_fit(AcpiNVDIMMState *state, NvdimmDsmIn *in, hwaddr dsm_mem_addr){ NvdimmFitBuffer *fit_buf = &state->fit_buf; NvdimmFuncReadFITIn *read_fit; NvdimmFuncReadFITOut *read_fit_out; GArray *fit; uint32_t read_len = 0, func_ret_status; int size; read_fit = (NvdimmFuncReadFITIn *)in->arg3; le... | |
negative | static void tftp_send_error(struct tftp_session *spt, uint16_t errorcode, const char *msg, struct tftp_t *recv_tp){ struct sockaddr_in saddr, daddr; struct mbuf *m; struct tftp_t *tp; m = m_get(spt->slirp); if (!m) { goto out; } memset(m->m_data, 0, m->m_size); m->m_data += IF_MAXLINKHDR; tp = (void *)m->m_data; m->m_d... | |
negative | static void omap_rtc_alarm_update(struct omap_rtc_s *s){ s->alarm_ti = mktimegm(&s->alarm_tm); if (s->alarm_ti == -1) printf("%s: conversion failed\n", __FUNCTION__);} | |
negative | static int http_send_data(HTTPContext *c){ int len, ret; for(;;) { if (c->buffer_ptr >= c->buffer_end) { ret = http_prepare_data(c); if (ret < 0) return -1; else if (ret != 0) /* state change requested */ break; } else { if (c->is_packetized) { /* RTP data output */ len = c->buffer_end - c->buffer_ptr; if (len < 4) { /... | |
negative | static inline bool vtd_iova_range_check(uint64_t iova, VTDContextEntry *ce){ /* * Check if @iova is above 2^X-1, where X is the minimum of MGAW * in CAP_REG and AW in context-entry. */ return !(iova & ~(vtd_iova_limit(ce) - 1));} | |
negative | DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType block_default_type){ const char *value; BlockBackend *blk; DriveInfo *dinfo = NULL; QDict *bs_opts; QemuOpts *legacy_opts; DriveMediaType media = MEDIA_DISK; BlockInterfaceType type; int cyls, heads, secs, translation; int max_devs, bus_id, unit_id, index; con... | |
negative | void qerror_report_internal(const char *file, int linenr, const char *func, const char *fmt, ...){ va_list va; QError *qerror; va_start(va, fmt); qerror = qerror_from_info(file, linenr, func, fmt, &va); va_end(va); if (cur_mon) { monitor_set_error(cur_mon, qerror); } else { qerror_print(qerror); QDECREF(qerror); }} | |
negative | static void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type){ Property *prop; prop = qdev_prop_find(dev, name); if (!prop) { fprintf(stderr, "%s: property \"%s.%s\" not found\n", __FUNCTION__, object_get_typename(OBJECT(dev)), name); abort(); } if (prop->info->type != type) { fprintf... | |
negative | void qdev_prop_set_drive_nofail(DeviceState *dev, const char *name, BlockDriverState *value){ if (qdev_prop_set_drive(dev, name, value) < 0) { exit(1); }} | |
negative | static int piix3_post_load(void *opaque, int version_id){ PIIX3State *piix3 = opaque; int pirq; /* Because the i8259 has not been deserialized yet, qemu_irq_raise * might bring the system to a different state than the saved one; * for example, the interrupt could be masked but the i8259 would * not know that yet and wo... | |
negative | static void unset_dirty_tracking(void){ BlkMigDevState *bmds; QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { aio_context_acquire(blk_get_aio_context(bmds->blk)); bdrv_release_dirty_bitmap(blk_bs(bmds->blk), bmds->dirty_bitmap); aio_context_release(blk_get_aio_context(bmds->blk)); }} | |
negative | static void cb_hmp_change_bdrv_pwd(Monitor *mon, const char *password, void *opaque){ Error *encryption_err = opaque; Error *err = NULL; const char *device; device = error_get_field(encryption_err, "device"); qmp_block_passwd(device, password, &err); hmp_handle_error(mon, &err); error_free(encryption_err); monitor_read... | |
negative | av_cold int ff_ivi_decode_close(AVCodecContext *avctx){ IVI45DecContext *ctx = avctx->priv_data; ivi_free_buffers(&ctx->planes[0]); if (ctx->mb_vlc.cust_tab.table) ff_free_vlc(&ctx->mb_vlc.cust_tab);#if IVI4_STREAM_ANALYSER if (ctx->is_indeo4) { if (ctx->is_scalable) av_log(avctx, AV_LOG_ERROR, "This video uses scalabi... | |
negative | static av_cold int cinepak_decode_init(AVCodecContext *avctx){ CinepakContext *s = avctx->priv_data; s->avctx = avctx; s->width = (avctx->width + 3) & ~3; s->height = (avctx->height + 3) & ~3; s->sega_film_skip_bytes = -1; /* uninitialized state */ // check for paletted data if (avctx->bits_per_coded_sample != 8) { s->... | |
positive | static int xen_host_pci_config_open(XenHostPCIDevice *d){ char path[PATH_MAX]; int rc; rc = xen_host_pci_sysfs_path(d, "config", path, sizeof (path)); if (rc) { return rc; } d->config_fd = open(path, O_RDWR); if (d->config_fd < 0) { return -errno; } return 0;} | |
positive | void cpu_exec_init(CPUArchState *env){ CPUState *cpu = ENV_GET_CPU(env); CPUClass *cc = CPU_GET_CLASS(cpu); CPUState *some_cpu; int cpu_index;#if defined(CONFIG_USER_ONLY) cpu_list_lock();#endif cpu_index = 0; CPU_FOREACH(some_cpu) { cpu_index++; } cpu->cpu_index = cpu_index; cpu->numa_node = 0; QTAILQ_INIT(&cpu->break... | |
positive | static int vhost_set_vring_file(struct vhost_dev *dev, VhostUserRequest request, struct vhost_vring_file *file){ int fds[VHOST_MEMORY_MAX_NREGIONS]; size_t fd_num = 0; VhostUserMsg msg = { .request = request, .flags = VHOST_USER_VERSION, .payload.u64 = file->index & VHOST_USER_VRING_IDX_MASK, .size = sizeof(msg.payload... | |
positive | char *qdist_pr(const struct qdist *dist, size_t n_bins, uint32_t opt){ const char *border = opt & QDIST_PR_BORDER ? "|" : ""; char *llabel, *rlabel; char *hgram; GString *s; if (dist->n == 0) { return NULL; } s = g_string_new(""); llabel = qdist_pr_label(dist, n_bins, opt, true); rlabel = qdist_pr_label(dist, n_bins, o... | |
positive | static int qemu_rdma_write_one(QEMUFile *f, RDMAContext *rdma, int current_index, uint64_t current_addr, uint64_t length){ struct ibv_sge sge; struct ibv_send_wr send_wr = { 0 }; struct ibv_send_wr *bad_wr; int reg_result_idx, ret, count = 0; uint64_t chunk, chunks; uint8_t *chunk_start, *chunk_end; RDMALocalBlock *blo... | |
positive | static int init_directories(BDRVVVFATState* s,const char* dirname){ bootsector_t* bootsector; mapping_t* mapping; unsigned int i; unsigned int cluster; memset(&(s->first_sectors[0]),0,0x40*0x200); s->cluster_size=s->sectors_per_cluster*0x200; s->cluster_buffer=qemu_malloc(s->cluster_size); /* * The formula: sc = spf+1+... | |
positive | static int mpegts_read_header(AVFormatContext *s){ MpegTSContext *ts = s->priv_data; AVIOContext *pb = s->pb; uint8_t buf[8 * 1024] = {0}; int len; int64_t pos, probesize = s->probesize; if (ffio_ensure_seekback(pb, probesize) < 0) av_log(s, AV_LOG_WARNING, "Failed to allocate buffers for seekback\n"); /* read the firs... | |
positive | static QPCIDevice *get_ahci_device(uint32_t *fingerprint){ QPCIDevice *ahci; uint32_t ahci_fingerprint; QPCIBus *pcibus; pcibus = qpci_init_pc(); /* Find the AHCI PCI device and verify it's the right one. */ ahci = qpci_device_find(pcibus, QPCI_DEVFN(0x1F, 0x02)); g_assert(ahci != NULL); ahci_fingerprint = qpci_config_... | |
positive | static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len){ int i; uint16_t limit; switch (data[0]) { case 0:if (len == 1) return 20;set_pixel_format(vs, read_u8(data, 4), read_u8(data, 5), read_u8(data, 6), read_u8(data, 7), read_u16(data, 8), read_u16(data, 10), read_u16(data, 12), read_u8(data, 14), rea... | |
positive | static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AVSubtitle *sub = data; const uint8_t *buf_end = buf + buf_size; uint8_t *bitmap; int w, h, x, y, i, ret; int64_t packet_time = 0; GetBitContext gb; int has_alpha =... | |
positive | static void tpm_tis_initfn(Object *obj){ ISADevice *dev = ISA_DEVICE(obj); TPMState *s = TPM(obj); memory_region_init_io(&s->mmio, OBJECT(s), &tpm_tis_memory_ops, s, "tpm-tis-mmio", TPM_TIS_NUM_LOCALITIES << TPM_TIS_LOCALITY_SHIFT); memory_region_add_subregion(isa_address_space(dev), TPM_TIS_ADDR_BASE, &s->mmio);} | |
positive | static int process_frame(FFFrameSync *fs){ AVFilterContext *ctx = fs->parent; LUT2Context *s = fs->opaque; AVFilterLink *outlink = ctx->outputs[0]; AVFrame *out, *srcx, *srcy; int ret; if ((ret = ff_framesync2_get_frame(&s->fs, 0, &srcx, 0)) < 0 || (ret = ff_framesync2_get_frame(&s->fs, 1, &srcy, 0)) < 0) return ret; i... | |
positive | static int handle_primary_tcp_pkt(NetFilterState *nf, Connection *conn, Packet *pkt){ struct tcphdr *tcp_pkt; tcp_pkt = (struct tcphdr *)pkt->transport_header; if (trace_event_get_state_backends(TRACE_COLO_FILTER_REWRITER_DEBUG)) { trace_colo_filter_rewriter_pkt_info(__func__, inet_ntoa(pkt->ip->ip_src), inet_ntoa(pkt-... | |
negative | av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx){ const int high_bit_depth = avctx->bits_per_raw_sample > 8; if (avctx->bits_per_raw_sample <= 8 && (avctx->idct_algo == FF_IDCT_AUTO || avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) { c->idct_put = ff_simple_idct_put_armv6; c->idct_add = ff_simple_idc... | |
negative | static int decode_exponents(AC3DecodeContext *ctx){ ac3_audio_block *ab = &ctx->audio_block; int i; uint8_t *exps; uint8_t *dexps; if (ab->flags & AC3_AB_CPLINU && ab->cplexpstr != AC3_EXPSTR_REUSE) if (_decode_exponents(ab->cplexpstr, ab->ncplgrps, ab->cplabsexp, ab->cplexps, ab->dcplexps + ab->cplstrtmant)) return -1... | |
positive | static void handle_pending_signal(CPUArchState *cpu_env, int sig, struct emulated_sigtable *k){ CPUState *cpu = ENV_GET_CPU(cpu_env); abi_ulong handler; sigset_t set; target_sigset_t target_old_set; struct target_sigaction *sa; TaskState *ts = cpu->opaque; trace_user_handle_signal(cpu_env, sig); /* dequeue signal */ k-... | |
positive | void block_job_yield(BlockJob *job){ assert(job->busy); /* Check cancellation *before* setting busy = false, too! */ if (block_job_is_cancelled(job)) { return; } job->busy = false; if (!block_job_should_pause(job)) { qemu_coroutine_yield(); } job->busy = true; block_job_pause_point(job);} | |
positive | static int udp_close(URLContext *h){ UDPContext *s = h->priv_data; if (s->is_multicast && (h->flags & AVIO_FLAG_READ)) udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s->local_addr_storage); closesocket(s->udp_fd);#if HAVE_PTHREAD_CANCEL if (s->thread_started) { int ret; pthrea... | |
positive | static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac, uint8_t (*layout_map)[3], GetBitContext *gb, int byte_align_ref){ int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc; int sampling_index; int comment_len; int tags; skip_bits(gb, 2); // object_type sampling_index = get_bits(gb, 4); if ... | |
positive | void ff_decode_dxt1(const uint8_t *s, uint8_t *dst, const unsigned int w, const unsigned int h, const unsigned int stride) { unsigned int bx, by, qstride = stride/4; uint32_t *d = (uint32_t *) dst; for (by=0; by < h/4; by++, d += stride-w) for (bx=0; bx < w/4; bx++, s+=8, d+=4) dxt1_decode_pixels(s, d, qstride, 0, 0LL)... | |
negative | static const HWAccel *get_hwaccel(enum AVPixelFormat pix_fmt){ int i; for (i = 0; hwaccels[i].name; i++) if (hwaccels[i].pix_fmt == pix_fmt) return &hwaccels[i]; return NULL;} | |
positive | static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val){ VirtIOPCIProxy *proxy = opaque; VirtIODevice *vdev = proxy->vdev; target_phys_addr_t pa; switch (addr) { case VIRTIO_PCI_GUEST_FEATURES:/* Guest does not negotiate properly? We have to assume nothing. */if (val & (1 << VIRTIO_F_BAD_FEATURE)) { ... | |
negative | int ff_get_cpu_flags_x86(void){ int rval = 0;#ifdef cpuid int eax, ebx, ecx, edx; int max_std_level, max_ext_level, std_caps = 0, ext_caps = 0; int family = 0, model = 0; union { int i[3]; char c[12]; } vendor; if (!cpuid_test()) return 0; /* CPUID not supported */ cpuid(0, max_std_level, vendor.i[0], vendor.i[2], vend... | |
negative | static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf, int buf_size){ GetBitContext gb; int au_start_flag = 0, au_end_flag = 0, ocr_flag = 0, idle_flag = 0; int padding_flag = 0, padding_bits = 0, inst_bitrate_flag = 0; int dts_flag = -1, cts_flag = -1; int64_t dts = AV_NOPTS_VALUE, cts = AV_... | |
negative | static enum AVHWDeviceType hw_device_match_type_in_name(const char *codec_name){ const char *type_name; enum AVHWDeviceType type; for (type = av_hwdevice_iterate_types(AV_HWDEVICE_TYPE_NONE); type != AV_HWDEVICE_TYPE_NONE; type = av_hwdevice_iterate_types(type)) { type_name = av_hwdevice_get_type_name(type); if (strstr... | |
negative | static av_cold int encode_close(AVCodecContext* avc_context){ TheoraContext *h = avc_context->priv_data; th_encode_free(h->t_state); av_freep(&h->stats); av_freep(&avc_context->coded_frame); av_freep(&avc_context->stats_out); av_freep(&avc_context->extradata); avc_context->extradata_size = 0; return 0;} | |
negative | static int vaapi_encode_h264_init_slice_params(AVCodecContext *avctx, VAAPIEncodePicture *pic, VAAPIEncodeSlice *slice){ VAAPIEncodeContext *ctx = avctx->priv_data; VAEncSequenceParameterBufferH264 *vseq = ctx->codec_sequence_params; VAEncPictureParameterBufferH264 *vpic = pic->codec_picture_params; VAEncSliceParameter... | |
negative | static char *assign_name(NetClientState *nc1, const char *model){ NetClientState *nc; char buf[256]; int id = 0; QTAILQ_FOREACH(nc, &net_clients, next) { if (nc == nc1) { continue; } /* For compatibility only bump id for net clients on a vlan */ if (strcmp(nc->model, model) == 0 && net_hub_id_for_client(nc, NULL) == 0)... | |
negative | static void nbd_accept(void *opaque){ int server_fd = (uintptr_t) opaque; struct sockaddr_in addr; socklen_t addr_len = sizeof(addr); int fd = accept(server_fd, (struct sockaddr *)&addr, &addr_len); nbd_started = true; if (fd >= 0 && nbd_client_new(exp, fd, nbd_client_closed)) { nb_fds++; }} | |
negative | static void dma_init2(struct dma_cont *d, int base, int dshift, int page_base, int pageh_base, qemu_irq *cpu_request_exit){ int i; d->dshift = dshift; d->cpu_request_exit = cpu_request_exit; memory_region_init_io(&d->channel_io, NULL, &channel_io_ops, d, "dma-chan", 8 << d->dshift); memory_region_add_subregion(isa_addr... | |
negative | static inline bool migration_bitmap_test_and_reset_dirty(MemoryRegion *mr, ram_addr_t offset){ bool ret; int nr = (mr->ram_addr + offset) >> TARGET_PAGE_BITS; ret = test_and_clear_bit(nr, migration_bitmap); if (ret) { migration_dirty_pages--; } return ret;} | |
negative | static inline void gen_op_eval_bge(TCGv dst, TCGv_i32 src){ gen_mov_reg_V(cpu_tmp0, src); gen_mov_reg_N(dst, src); tcg_gen_xor_tl(dst, dst, cpu_tmp0); tcg_gen_xori_tl(dst, dst, 0x1);} | |
negative | static int qcow_set_key(BlockDriverState *bs, const char *key){ BDRVQcowState *s = bs->opaque; uint8_t keybuf[16]; int len, i; Error *err; memset(keybuf, 0, 16); len = strlen(key); if (len > 16) len = 16; /* XXX: we could compress the chars to 7 bits to increase entropy */ for(i = 0;i < len;i++) { keybuf[i] = key[i]; }... | |
negative | int vhost_dev_init(struct vhost_dev *hdev, int devfd, const char *devpath, bool force){ uint64_t features; int r; if (devfd >= 0) { hdev->control = devfd; } else { hdev->control = open(devpath, O_RDWR); if (hdev->control < 0) { return -errno; } } r = ioctl(hdev->control, VHOST_SET_OWNER, NULL); if (r < 0) { goto fail; ... | |
negative | static void fw_cfg_mem_realize(DeviceState *dev, Error **errp){ FWCfgMemState *s = FW_CFG_MEM(dev); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); memory_region_init_io(&s->ctl_iomem, OBJECT(s), &fw_cfg_ctl_mem_ops, FW_CFG(s), "fwcfg.ctl", FW_CFG_SIZE); sysbus_init_mmio(sbd, &s->ctl_iomem); memory_region_init_io(&s->data_iom... | |
negative | static void hls_prediction_unit(HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int partIdx){#define POS(c_idx, x, y) \ &s->frame->data[c_idx][((y) >> s->sps->vshift[c_idx]) * s->frame->linesize[c_idx] + \ (((x) >> s->sps->hshift[c_idx]) << s->sps->pixel_shift)] HEVCLocalContext *lc = &s->HEVClc; ... | |
negative | static void select_soundhw (const char *optarg){ struct soundhw *c; if (*optarg == '?') { show_valid_cards: printf ("Valid sound card names (comma separated):\n"); for (c = soundhw; c->name; ++c) { printf ("%-11s %s\n", c->name, c->descr); } printf ("\n-soundhw all will enable all of the above\n"); exit (*optarg != '?'... | |
negative | void ide_bus_reset(IDEBus *bus){ bus->unit = 0; bus->cmd = 0; ide_reset(&bus->ifs[0]); ide_reset(&bus->ifs[1]); ide_clear_hob(bus); /* pending async DMA */ if (bus->dma->aiocb) {#ifdef DEBUG_AIO printf("aio_cancel\n");#endif bdrv_aio_cancel(bus->dma->aiocb); bus->dma->aiocb = NULL; } /* reset dma provider too */ if (bu... | |
negative | if_start(void){struct mbuf *ifm, *ifqt;DEBUG_CALL("if_start");if (if_queued == 0) return; /* Nothing to do */ again: /* check if we can really output */ if (!slirp_can_output()) return;/* * See which queue to get next packet from * If there's something in the fastq, select it immediately */if (if_fastq.ifq_next != &if_... | |
negative | MacIONVRAMState *macio_nvram_init (target_phys_addr_t size, unsigned int it_shift){ MacIONVRAMState *s; s = g_malloc0(sizeof(MacIONVRAMState)); s->data = g_malloc0(size); s->size = size; s->it_shift = it_shift; memory_region_init_io(&s->mem, &macio_nvram_ops, s, "macio-nvram", size << it_shift); vmstate_register(NULL, ... | |
negative | static void cmd646_data_write(void *opaque, target_phys_addr_t addr, uint64_t data, unsigned size){ CMD646BAR *cmd646bar = opaque; if (size == 1) { ide_ioport_write(cmd646bar->bus, addr, data); } else if (addr == 0) { if (size == 2) { ide_data_writew(cmd646bar->bus, addr, data); } else { ide_data_writel(cmd646bar->bus,... | |
negative | static uint64_t kvm_apic_mem_read(void *opaque, target_phys_addr_t addr, unsigned size){ return ~(uint64_t)0;} | |
negative | static uint64_t bonito_cop_readl(void *opaque, target_phys_addr_t addr, unsigned size){ uint32_t val; PCIBonitoState *s = opaque; val = ((uint32_t *)(&s->boncop))[addr/sizeof(uint32_t)]; return val;} | |
negative | size_t iov_memset(const struct iovec *iov, const unsigned int iov_cnt, size_t iov_off, int fillc, size_t size){ size_t iovec_off, buf_off; unsigned int i; iovec_off = 0; buf_off = 0; for (i = 0; i < iov_cnt && size; i++) { if (iov_off < (iovec_off + iov[i].iov_len)) { size_t len = MIN((iovec_off + iov[i].iov_len) - iov... | |
negative | static int img_open_password(BlockBackend *blk, const char *filename, int flags, bool quiet){ BlockDriverState *bs; char password[256]; bs = blk_bs(blk); if (bdrv_is_encrypted(bs) && !(flags & BDRV_O_NO_IO)) { qprintf(quiet, "Disk image '%s' is encrypted.\n", filename); if (qemu_read_password(password, sizeof(password)... | |
negative | void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode){ const char *codec_name; AVCodec *p; char buf1[32]; int bitrate; AVRational display_aspect_ratio; if (encode) p = avcodec_find_encoder(enc->codec_id); else p = avcodec_find_decoder(enc->codec_id); if (p) { codec_name = p->name; if (!encode &&... | |
negative | static int transcode_init(OutputFile *output_files, int nb_output_files, InputFile *input_files, int nb_input_files){ int ret = 0, i, j; AVFormatContext *os; AVCodecContext *codec, *icodec; OutputStream *ost; InputStream *ist; char error[1024]; int want_sdp = 1; /* init framerate emulation */ for (i = 0; i < nb_input_f... | |
negative | static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt){ LavfiContext *lavfi = avctx->priv_data; double min_pts = DBL_MAX; int stream_idx, min_pts_sink_idx = 0; AVFrame *frame = lavfi->decoded_frame; AVPicture pict; AVDictionary *frame_metadata; int ret, i; int size = 0; if (lavfi->subcc_packet.size) { *pkt... | |
positive | static void iothread_complete(UserCreatable *obj, Error **errp){ IOThread *iothread = IOTHREAD(obj); iothread->stopping = false; iothread->ctx = aio_context_new(); iothread->thread_id = -1; qemu_mutex_init(&iothread->init_done_lock); qemu_cond_init(&iothread->init_done_cond); /* This assumes we are called from a thread... | |
positive | static void gen_tlbre_440(DisasContext *ctx){#if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);#else if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } switch (rB(ctx->opcode)) { case 0: case 1: case 2: { TCGv_i32 t0 = tcg_const_i32(rB(ctx->opcode)); gen_help... | |
positive | target_ulong helper_evpe(target_ulong arg1){ // TODO arg1 = 0; // rt = arg1 return arg1;} | |
positive | void helper_ldmxcsr(CPUX86State *env, uint32_t val){ env->mxcsr = val; update_sse_status(env);} | |
positive | void ff_snow_horizontal_compose97i_mmx(IDWTELEM *b, int width){ const int w2= (width+1)>>1; IDWTELEM temp[width >> 1]; const int w_l= (width>>1); const int w_r= w2 - 1; int i; { // Lift 0 IDWTELEM * const ref = b + w2 - 1; i = 1; b[0] = b[0] - ((W_DM * 2 * ref[1]+W_DO)>>W_DS); asm volatile( "pcmpeqw %%mm7, %%mm7 \n\t" ... | |
positive | static int net_dump_init(VLANState *vlan, const char *device, const char *name, const char *filename, int len){ struct pcap_file_hdr hdr; DumpState *s; s = qemu_malloc(sizeof(DumpState)); s->fd = open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644); if (s->fd < 0) { qemu_error("-net dump: can't open %s\n", filename); re... | |
negative | void check_values (eq2_param_t *par){ /* yuck! floating point comparisons... */ if ((par->c == 1.0) && (par->b == 0.0) && (par->g == 1.0)) { par->adjust = NULL; }#if HAVE_MMX && HAVE_6REGS else if (par->g == 1.0 && ff_gCpuCaps.hasMMX) { par->adjust = &affine_1d_MMX; }#endif else { par->adjust = &apply_lut; }} | |
negative | static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s){ unsigned char B; int x, y; /* copy block from 2 frames ago using a motion vector; need 1 more byte */ CHECK_STREAM_PTR(s->stream_ptr, s->stream_end, 1); B = *s->stream_ptr++; if (B < 56) { x = 8 + (B % 7); y = B / 7; } else { x = -14 + ((B - 56) % 29); y = ... | |
negative | static int input_get_buffer(AVCodecContext *codec, AVFrame *pic){ AVFilterContext *ctx = codec->opaque; AVFilterBufferRef *ref; int perms = AV_PERM_WRITE; int i, w, h, stride[4]; unsigned edge; if(av_image_check_size(w, h, 0, codec)) return -1; if (codec->codec->capabilities & CODEC_CAP_NEG_LINESIZES) perms |= AV_PERM_... | |
positive | static void coroutine_fn wait_for_overlapping_requests(BlockDriverState *bs, int64_t sector_num, int nb_sectors){ BdrvTrackedRequest *req; int64_t cluster_sector_num; int cluster_nb_sectors; bool retry; /* If we touch the same cluster it counts as an overlap. This guarantees * that allocating writes will be serialized ... | |
positive | static NetSocketState *net_socket_fd_init_dgram(VLANState *vlan, const char *model, const char *name, int fd, int is_connected){ struct sockaddr_in saddr; int newfd; socklen_t saddr_len; VLANClientState *nc; NetSocketState *s; /* fd passed: multicast: "learn" dgram_dst address from bound address and save it * Because t... | |
negative | int64_t bdrv_dirty_iter_next(BdrvDirtyBitmapIter *iter){ return hbitmap_iter_next(&iter->hbi);} | |
negative | static void rtl8139_write_buffer(RTL8139State *s, const void *buf, int size){ if (s->RxBufAddr + size > s->RxBufferSize) { int wrapped = MOD2(s->RxBufAddr + size, s->RxBufferSize); /* write packet data */ if (wrapped && s->RxBufferSize < 65536 && !rtl8139_RxWrap(s)) { DEBUG_PRINT((">>> RTL8139: rx packet wrapped in buf... | |
negative | int ppc_hash32_handle_mmu_fault(CPUPPCState *env, target_ulong address, int rw, int mmu_idx){ struct mmu_ctx_hash32 ctx; int access_type; int ret = 0; if (rw == 2) { /* code access */ rw = 0; access_type = ACCESS_CODE; } else { /* data access */ access_type = env->access_type; } ret = ppc_hash32_get_physical_address(en... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.