mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge branch 'master' of git://git.qemu.org/qemu
This commit is contained in:
+10
@@ -143,6 +143,16 @@ L: kvm@vger.kernel.org
|
||||
S: Supported
|
||||
F: target-i386/kvm.c
|
||||
|
||||
Guest CPU Cores (Xen):
|
||||
----------------------
|
||||
|
||||
X86
|
||||
M: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
||||
L: xen-devel@lists.xensource.com
|
||||
S: Supported
|
||||
F: xen-*
|
||||
F: */xen*
|
||||
|
||||
ARM Machines
|
||||
------------
|
||||
Gumstix
|
||||
|
||||
+11
-5
@@ -317,7 +317,8 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
|
||||
{
|
||||
BDRVQcowState *s = bs->opaque;
|
||||
QCowSnapshot *sn;
|
||||
int i, snapshot_index, l1_size2;
|
||||
int i, snapshot_index;
|
||||
int cur_l1_bytes, sn_l1_bytes;
|
||||
|
||||
snapshot_index = find_snapshot_by_id_or_name(bs, snapshot_id);
|
||||
if (snapshot_index < 0)
|
||||
@@ -330,14 +331,19 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
|
||||
if (qcow2_grow_l1_table(bs, sn->l1_size, true) < 0)
|
||||
goto fail;
|
||||
|
||||
s->l1_size = sn->l1_size;
|
||||
l1_size2 = s->l1_size * sizeof(uint64_t);
|
||||
cur_l1_bytes = s->l1_size * sizeof(uint64_t);
|
||||
sn_l1_bytes = sn->l1_size * sizeof(uint64_t);
|
||||
|
||||
if (cur_l1_bytes > sn_l1_bytes) {
|
||||
memset(s->l1_table + sn->l1_size, 0, cur_l1_bytes - sn_l1_bytes);
|
||||
}
|
||||
|
||||
/* copy the snapshot l1 table to the current l1 table */
|
||||
if (bdrv_pread(bs->file, sn->l1_table_offset,
|
||||
s->l1_table, l1_size2) != l1_size2)
|
||||
s->l1_table, sn_l1_bytes) < 0)
|
||||
goto fail;
|
||||
if (bdrv_pwrite_sync(bs->file, s->l1_table_offset,
|
||||
s->l1_table, l1_size2) < 0)
|
||||
s->l1_table, cur_l1_bytes) < 0)
|
||||
goto fail;
|
||||
for(i = 0;i < s->l1_size; i++) {
|
||||
be64_to_cpus(&s->l1_table[i]);
|
||||
|
||||
+2
-1
@@ -905,7 +905,8 @@ int main(int argc, char **argv)
|
||||
cpu_model = "any";
|
||||
#endif
|
||||
}
|
||||
cpu_exec_init_all(0);
|
||||
tcg_exec_init(0);
|
||||
cpu_exec_init_all();
|
||||
/* NOTE: we need to init the CPU at this stage to get
|
||||
qemu_host_page_size */
|
||||
env = cpu_init(cpu_model);
|
||||
|
||||
@@ -220,14 +220,14 @@ done
|
||||
# Using uname is really, really broken. Once we have the right set of checks
|
||||
# we can eliminate it's usage altogether
|
||||
|
||||
cc="${cross_prefix}${CC-gcc}"
|
||||
ar="${cross_prefix}${AR-ar}"
|
||||
objcopy="${cross_prefix}${OBJCOPY-objcopy}"
|
||||
ld="${cross_prefix}${LD-ld}"
|
||||
strip="${cross_prefix}${STRIP-strip}"
|
||||
windres="${cross_prefix}${WINDRES-windres}"
|
||||
pkg_config="${cross_prefix}${PKG_CONFIG-pkg-config}"
|
||||
sdl_config="${cross_prefix}${SDL_CONFIG-sdl-config}"
|
||||
cc="${CC-${cross_prefix}gcc}"
|
||||
ar="${AR-${cross_prefix}ar}"
|
||||
objcopy="${OBJCOPY-${cross_prefix}objcopy}"
|
||||
ld="${LD-${cross_prefix}ld}"
|
||||
strip="${STRIP-${cross_prefix}strip}"
|
||||
windres="${WINDRES-${cross_prefix}windres}"
|
||||
pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}"
|
||||
sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
|
||||
|
||||
# default flags for all hosts
|
||||
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
|
||||
|
||||
+2
-2
@@ -852,8 +852,8 @@ int main(int argc, char **argv)
|
||||
#error unsupported CPU
|
||||
#endif
|
||||
}
|
||||
|
||||
cpu_exec_init_all(0);
|
||||
tcg_exec_init(0);
|
||||
cpu_exec_init_all();
|
||||
/* NOTE: we need to init the CPU at this stage to get
|
||||
qemu_host_page_size */
|
||||
env = cpu_init(cpu_model);
|
||||
|
||||
@@ -319,7 +319,6 @@ static void setup_frame(int sig, struct emulated_sigaction *ka,
|
||||
void *set, CPUState *env)
|
||||
{
|
||||
void *frame;
|
||||
int i, err = 0;
|
||||
|
||||
fprintf(stderr, "setup_frame %d\n", sig);
|
||||
frame = get_sigframe(ka, env, sizeof(*frame));
|
||||
|
||||
@@ -526,7 +526,8 @@ static void code_gen_alloc(unsigned long tb_size)
|
||||
}
|
||||
}
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) \
|
||||
|| defined(__DragonFly__) || defined(__OpenBSD__)
|
||||
|| defined(__DragonFly__) || defined(__OpenBSD__) \
|
||||
|| defined(__NetBSD__)
|
||||
{
|
||||
int flags;
|
||||
void *addr = NULL;
|
||||
@@ -570,16 +571,12 @@ static void code_gen_alloc(unsigned long tb_size)
|
||||
/* Must be called before using the QEMU cpus. 'tb_size' is the size
|
||||
(in bytes) allocated to the translation buffer. Zero means default
|
||||
size. */
|
||||
void cpu_exec_init_all(unsigned long tb_size)
|
||||
void tcg_exec_init(unsigned long tb_size)
|
||||
{
|
||||
cpu_gen_init();
|
||||
code_gen_alloc(tb_size);
|
||||
code_gen_ptr = code_gen_buffer;
|
||||
page_init();
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
memory_map_init();
|
||||
io_mem_init();
|
||||
#endif
|
||||
#if !defined(CONFIG_USER_ONLY) || !defined(CONFIG_USE_GUEST_BASE)
|
||||
/* There's no guest base to take into account, so go ahead and
|
||||
initialize the prologue now. */
|
||||
@@ -587,6 +584,19 @@ void cpu_exec_init_all(unsigned long tb_size)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool tcg_enabled(void)
|
||||
{
|
||||
return code_gen_buffer != NULL;
|
||||
}
|
||||
|
||||
void cpu_exec_init_all(void)
|
||||
{
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
memory_map_init();
|
||||
io_mem_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
|
||||
|
||||
static int cpu_common_post_load(void *opaque, int version_id)
|
||||
@@ -3818,7 +3828,7 @@ static void io_mem_init(void)
|
||||
static void memory_map_init(void)
|
||||
{
|
||||
system_memory = qemu_malloc(sizeof(*system_memory));
|
||||
memory_region_init(system_memory, "system", UINT64_MAX);
|
||||
memory_region_init(system_memory, "system", INT64_MAX);
|
||||
set_system_memory_map(system_memory);
|
||||
}
|
||||
|
||||
|
||||
+13
@@ -87,6 +87,13 @@ static FILE *probe_splashfile(char *filename, int *file_sizep, int *file_typep)
|
||||
/* check magic ID */
|
||||
fseek(fp, 0L, SEEK_SET);
|
||||
fop_ret = fread(buf, 1, 2, fp);
|
||||
if (fop_ret != 2) {
|
||||
error_report("Could not read header from '%s': %s",
|
||||
filename, strerror(errno));
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
return fp;
|
||||
}
|
||||
filehead_value = (buf[0] + (buf[1] << 8)) & 0xffff;
|
||||
if (filehead_value == 0xd8ff) {
|
||||
file_type = JPG_FILE;
|
||||
@@ -181,6 +188,12 @@ static void fw_cfg_bootsplash(FWCfgState *s)
|
||||
boot_splash_filedata_size = file_size;
|
||||
fseek(fp, 0L, SEEK_SET);
|
||||
fop_ret = fread(boot_splash_filedata, 1, file_size, fp);
|
||||
if (fop_ret != file_size) {
|
||||
error_report("failed to read data from '%s'.",
|
||||
boot_splash_filename);
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
fclose(fp);
|
||||
/* insert data */
|
||||
if (file_type == JPG_FILE) {
|
||||
|
||||
@@ -36,6 +36,7 @@ static bool qdev_hot_removed = false;
|
||||
|
||||
/* This is a nasty hack to allow passing a NULL bus to qdev_create. */
|
||||
static BusState *main_system_bus;
|
||||
static void main_system_bus_create(void);
|
||||
|
||||
DeviceInfo *device_info_list;
|
||||
|
||||
@@ -328,8 +329,7 @@ static int qdev_reset_one(DeviceState *dev, void *opaque)
|
||||
BusState *sysbus_get_default(void)
|
||||
{
|
||||
if (!main_system_bus) {
|
||||
main_system_bus = qbus_create(&system_bus_info, NULL,
|
||||
"main-system-bus");
|
||||
main_system_bus_create();
|
||||
}
|
||||
return main_system_bus;
|
||||
}
|
||||
@@ -784,6 +784,16 @@ BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name)
|
||||
return bus;
|
||||
}
|
||||
|
||||
static void main_system_bus_create(void)
|
||||
{
|
||||
/* assign main_system_bus before qbus_create_inplace()
|
||||
* in order to make "if (bus != main_system_bus)" work */
|
||||
main_system_bus = qemu_mallocz(system_bus_info.size);
|
||||
main_system_bus->qdev_allocated = 1;
|
||||
qbus_create_inplace(main_system_bus, &system_bus_info, NULL,
|
||||
"main-system-bus");
|
||||
}
|
||||
|
||||
void qbus_free(BusState *bus)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
||||
+2
-1
@@ -3117,7 +3117,8 @@ int main(int argc, char **argv, char **envp)
|
||||
cpu_model = "any";
|
||||
#endif
|
||||
}
|
||||
cpu_exec_init_all(0);
|
||||
tcg_exec_init(0);
|
||||
cpu_exec_init_all();
|
||||
/* NOTE: we need to init the CPU at this stage to get
|
||||
qemu_host_page_size */
|
||||
env = cpu_init(cpu_model);
|
||||
|
||||
@@ -22,12 +22,17 @@ unsigned memory_region_transaction_depth = 0;
|
||||
|
||||
typedef struct AddrRange AddrRange;
|
||||
|
||||
/*
|
||||
* Note using signed integers limits us to physical addresses at most
|
||||
* 63 bits wide. They are needed for negative offsetting in aliases
|
||||
* (large MemoryRegion::alias_offset).
|
||||
*/
|
||||
struct AddrRange {
|
||||
uint64_t start;
|
||||
uint64_t size;
|
||||
int64_t start;
|
||||
int64_t size;
|
||||
};
|
||||
|
||||
static AddrRange addrrange_make(uint64_t start, uint64_t size)
|
||||
static AddrRange addrrange_make(int64_t start, int64_t size)
|
||||
{
|
||||
return (AddrRange) { start, size };
|
||||
}
|
||||
@@ -37,7 +42,7 @@ static bool addrrange_equal(AddrRange r1, AddrRange r2)
|
||||
return r1.start == r2.start && r1.size == r2.size;
|
||||
}
|
||||
|
||||
static uint64_t addrrange_end(AddrRange r)
|
||||
static int64_t addrrange_end(AddrRange r)
|
||||
{
|
||||
return r.start + r.size;
|
||||
}
|
||||
@@ -56,9 +61,9 @@ static bool addrrange_intersects(AddrRange r1, AddrRange r2)
|
||||
|
||||
static AddrRange addrrange_intersection(AddrRange r1, AddrRange r2)
|
||||
{
|
||||
uint64_t start = MAX(r1.start, r2.start);
|
||||
int64_t start = MAX(r1.start, r2.start);
|
||||
/* off-by-one arithmetic to prevent overflow */
|
||||
uint64_t end = MIN(addrrange_end(r1) - 1, addrrange_end(r2) - 1);
|
||||
int64_t end = MIN(addrrange_end(r1) - 1, addrrange_end(r2) - 1);
|
||||
return addrrange_make(start, end - start + 1);
|
||||
}
|
||||
|
||||
@@ -245,6 +250,10 @@ static void as_memory_range_add(AddressSpace *as, FlatRange *fr)
|
||||
|
||||
static void as_memory_range_del(AddressSpace *as, FlatRange *fr)
|
||||
{
|
||||
if (fr->dirty_log_mask) {
|
||||
cpu_physical_sync_dirty_bitmap(fr->addr.start,
|
||||
fr->addr.start + fr->addr.size);
|
||||
}
|
||||
cpu_register_physical_memory(fr->addr.start, fr->addr.size,
|
||||
IO_MEM_UNASSIGNED);
|
||||
}
|
||||
@@ -407,8 +416,8 @@ static void render_memory_region(FlatView *view,
|
||||
MemoryRegion *subregion;
|
||||
unsigned i;
|
||||
target_phys_addr_t offset_in_region;
|
||||
uint64_t remain;
|
||||
uint64_t now;
|
||||
int64_t remain;
|
||||
int64_t now;
|
||||
FlatRange fr;
|
||||
AddrRange tmp;
|
||||
|
||||
@@ -482,7 +491,7 @@ static FlatView generate_memory_topology(MemoryRegion *mr)
|
||||
|
||||
flatview_init(&view);
|
||||
|
||||
render_memory_region(&view, mr, 0, addrrange_make(0, UINT64_MAX));
|
||||
render_memory_region(&view, mr, 0, addrrange_make(0, INT64_MAX));
|
||||
flatview_simplify(&view);
|
||||
|
||||
return view;
|
||||
|
||||
+9
-10
@@ -292,18 +292,17 @@ int migrate_fd_cleanup(FdMigrationState *s)
|
||||
ret = -1;
|
||||
}
|
||||
s->file = NULL;
|
||||
} else {
|
||||
if (s->mon) {
|
||||
monitor_resume(s->mon);
|
||||
}
|
||||
}
|
||||
|
||||
if (s->fd != -1)
|
||||
if (s->fd != -1) {
|
||||
close(s->fd);
|
||||
|
||||
/* Don't resume monitor until we've flushed all of the buffers */
|
||||
if (s->mon) {
|
||||
monitor_resume(s->mon);
|
||||
s->fd = -1;
|
||||
}
|
||||
|
||||
s->fd = -1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -330,9 +329,6 @@ ssize_t migrate_fd_put_buffer(void *opaque, const void *data, size_t size)
|
||||
if (ret == -EAGAIN) {
|
||||
qemu_set_fd_handler2(s->fd, NULL, NULL, migrate_fd_put_notify, s);
|
||||
} else if (ret < 0) {
|
||||
if (s->mon) {
|
||||
monitor_resume(s->mon);
|
||||
}
|
||||
s->state = MIG_STATE_ERROR;
|
||||
notifier_list_notify(&migration_state_notifiers, NULL);
|
||||
}
|
||||
@@ -458,6 +454,9 @@ int migrate_fd_close(void *opaque)
|
||||
{
|
||||
FdMigrationState *s = opaque;
|
||||
|
||||
if (s->mon) {
|
||||
monitor_resume(s->mon);
|
||||
}
|
||||
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
|
||||
return s->close(s);
|
||||
}
|
||||
|
||||
+8
-2
@@ -154,6 +154,12 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, struct in_addr
|
||||
struct ip_mreq imr;
|
||||
int fd;
|
||||
int val, ret;
|
||||
#ifdef __OpenBSD__
|
||||
unsigned char loop;
|
||||
#else
|
||||
int loop;
|
||||
#endif
|
||||
|
||||
if (!IN_MULTICAST(ntohl(mcastaddr->sin_addr.s_addr))) {
|
||||
fprintf(stderr, "qemu: error: specified mcastaddr \"%s\" (0x%08x) does not contain a multicast address\n",
|
||||
inet_ntoa(mcastaddr->sin_addr),
|
||||
@@ -197,9 +203,9 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, struct in_addr
|
||||
}
|
||||
|
||||
/* Force mcast msgs to loopback (eg. several QEMUs in same host */
|
||||
val = 1;
|
||||
loop = 1;
|
||||
ret=setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
|
||||
(const char *)&val, sizeof(val));
|
||||
(const char *)&loop, sizeof(loop));
|
||||
if (ret < 0) {
|
||||
perror("setsockopt(SOL_IP, IP_MULTICAST_LOOP)");
|
||||
goto fail;
|
||||
|
||||
+24
-2
@@ -28,6 +28,8 @@
|
||||
#include "qemu-error.h"
|
||||
|
||||
#ifdef __NetBSD__
|
||||
#include <sys/ioctl.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_tap.h>
|
||||
#endif
|
||||
|
||||
@@ -40,8 +42,12 @@
|
||||
int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required)
|
||||
{
|
||||
int fd;
|
||||
#ifdef TAPGIFNAME
|
||||
struct ifreq ifr;
|
||||
#else
|
||||
char *dev;
|
||||
struct stat s;
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
|
||||
/* if no ifname is given, always start the search from tap0/tun0. */
|
||||
@@ -77,14 +83,30 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required
|
||||
#else
|
||||
TFR(fd = open("/dev/tap", O_RDWR));
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n");
|
||||
fprintf(stderr,
|
||||
"warning: could not open /dev/tap: no virtual network emulation: %s\n",
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
fstat(fd, &s);
|
||||
#ifdef TAPGIFNAME
|
||||
if (ioctl(fd, TAPGIFNAME, (void *)&ifr) < 0) {
|
||||
fprintf(stderr, "warning: could not get tap name: %s\n",
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
pstrcpy(ifname, ifname_size, ifr.ifr_name);
|
||||
#else
|
||||
if (fstat(fd, &s) < 0) {
|
||||
fprintf(stderr,
|
||||
"warning: could not stat /dev/tap: no virtual network emulation: %s\n",
|
||||
strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
dev = devname(s.st_rdev, S_IFCHR);
|
||||
pstrcpy(ifname, ifname_size, dev);
|
||||
#endif
|
||||
|
||||
if (*vnet_hdr) {
|
||||
/* BSD doesn't have IFF_VNET_HDR */
|
||||
|
||||
+4
-1
@@ -270,7 +270,10 @@ typedef struct QEMUSGList QEMUSGList;
|
||||
|
||||
typedef uint64_t pcibus_t;
|
||||
|
||||
void cpu_exec_init_all(unsigned long tb_size);
|
||||
void tcg_exec_init(unsigned long tb_size);
|
||||
bool tcg_enabled(void);
|
||||
|
||||
void cpu_exec_init_all(void);
|
||||
|
||||
/* CPU save/load. */
|
||||
void cpu_save(QEMUFile *f, void *opaque);
|
||||
|
||||
@@ -288,6 +288,14 @@ then the modifier is Ctrl-Alt-Shift (instead of Ctrl-Alt) and if you use
|
||||
@kindex Ctrl-Alt-f
|
||||
Toggle full screen
|
||||
|
||||
@item Ctrl-Alt-+
|
||||
@kindex Ctrl-Alt-+
|
||||
Enlarge the screen
|
||||
|
||||
@item Ctrl-Alt--
|
||||
@kindex Ctrl-Alt--
|
||||
Shrink the screen
|
||||
|
||||
@item Ctrl-Alt-u
|
||||
@kindex Ctrl-Alt-u
|
||||
Restore the screen's un-scaled dimensions
|
||||
|
||||
+8
-8
@@ -24,9 +24,9 @@
|
||||
|
||||
#include "slirp.h"
|
||||
|
||||
void arp_table_add(Slirp *slirp, int ip_addr, uint8_t ethaddr[ETH_ALEN])
|
||||
void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN])
|
||||
{
|
||||
const in_addr_t broadcast_addr =
|
||||
const uint32_t broadcast_addr =
|
||||
~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr;
|
||||
ArpTable *arptbl = &slirp->arp_table;
|
||||
int i;
|
||||
@@ -60,29 +60,29 @@ void arp_table_add(Slirp *slirp, int ip_addr, uint8_t ethaddr[ETH_ALEN])
|
||||
arptbl->next_victim = (arptbl->next_victim + 1) % ARP_TABLE_SIZE;
|
||||
}
|
||||
|
||||
bool arp_table_search(Slirp *slirp, int in_ip_addr,
|
||||
bool arp_table_search(Slirp *slirp, uint32_t ip_addr,
|
||||
uint8_t out_ethaddr[ETH_ALEN])
|
||||
{
|
||||
const in_addr_t broadcast_addr =
|
||||
const uint32_t broadcast_addr =
|
||||
~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr;
|
||||
ArpTable *arptbl = &slirp->arp_table;
|
||||
int i;
|
||||
|
||||
DEBUG_CALL("arp_table_search");
|
||||
DEBUG_ARG("ip = 0x%x", in_ip_addr);
|
||||
DEBUG_ARG("ip = 0x%x", ip_addr);
|
||||
|
||||
/* Check 0.0.0.0/8 invalid source-only addresses */
|
||||
assert((in_ip_addr & htonl(~(0xf << 28))) != 0);
|
||||
assert((ip_addr & htonl(~(0xf << 28))) != 0);
|
||||
|
||||
/* If broadcast address */
|
||||
if (in_ip_addr == 0xffffffff || in_ip_addr == broadcast_addr) {
|
||||
if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) {
|
||||
/* return Ethernet broadcast address */
|
||||
memset(out_ethaddr, 0xff, ETH_ALEN);
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARP_TABLE_SIZE; i++) {
|
||||
if (arptbl->table[i].ar_sip == in_ip_addr) {
|
||||
if (arptbl->table[i].ar_sip == ip_addr) {
|
||||
memcpy(out_ethaddr, arptbl->table[i].ar_sha, ETH_ALEN);
|
||||
DEBUG_ARGS((dfd, " found hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
out_ethaddr[0], out_ethaddr[1], out_ethaddr[2],
|
||||
|
||||
+1
-7
@@ -106,9 +106,6 @@ if_output(struct socket *so, struct mbuf *ifm)
|
||||
ifs_init(ifm);
|
||||
insque(ifm, ifq);
|
||||
|
||||
/* Expiration date = Now + 1 second */
|
||||
ifm->expiration_date = qemu_get_clock_ns(rt_clock) + 1000000000ULL;
|
||||
|
||||
diddit:
|
||||
slirp->if_queued++;
|
||||
|
||||
@@ -157,9 +154,8 @@ diddit:
|
||||
void
|
||||
if_start(Slirp *slirp)
|
||||
{
|
||||
uint64_t now = qemu_get_clock_ns(rt_clock);
|
||||
int requeued = 0;
|
||||
uint64_t now;
|
||||
|
||||
struct mbuf *ifm, *ifqt;
|
||||
|
||||
DEBUG_CALL("if_start");
|
||||
@@ -172,8 +168,6 @@ if_start(Slirp *slirp)
|
||||
if (!slirp_can_output(slirp->opaque))
|
||||
return;
|
||||
|
||||
now = qemu_get_clock_ns(rt_clock);
|
||||
|
||||
/*
|
||||
* See which queue to get next packet from
|
||||
* If there's something in the fastq, select it immediately
|
||||
|
||||
@@ -738,6 +738,9 @@ int if_encap(Slirp *slirp, struct mbuf *ifm)
|
||||
slirp->client_ipaddr = iph->ip_dst;
|
||||
slirp_output(slirp->opaque, arp_req, sizeof(arp_req));
|
||||
ifm->arp_requested = true;
|
||||
|
||||
/* Expire request and drop outgoing packet after 1 second */
|
||||
ifm->expiration_date = qemu_get_clock_ns(rt_clock) + 1000000000ULL;
|
||||
}
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -208,9 +208,9 @@ typedef struct ArpTable {
|
||||
int next_victim;
|
||||
} ArpTable;
|
||||
|
||||
void arp_table_add(Slirp *slirp, int ip_addr, uint8_t ethaddr[ETH_ALEN]);
|
||||
void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN]);
|
||||
|
||||
bool arp_table_search(Slirp *slirp, int in_ip_addr,
|
||||
bool arp_table_search(Slirp *slirp, uint32_t ip_addr,
|
||||
uint8_t out_ethaddr[ETH_ALEN]);
|
||||
|
||||
struct Slirp {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user